ÍÍÍÍÍ Problem: E:\MERCURY\ROCKET.EKA ÍÍÍÍÍ
; Program "ROCKET.EKA"                 October 3, 1992

; For a given rocket engine and aerodynamic characteristics,
; this Mercury program determines the optimum launch mass of
; a single stage rocket which maximizes total altitude.

; Input

;  alt.site   = altitude at launch site          (meters)
;  temp.site  = temperature at launch site       (degrees F)
;  tburn      = thrust duration of rocket engine (seconds)
;  impulse    = total impulse of rocket engine   (newtons)
;  mprop      = rocket engine propellant mass    (kilograms)
;  diameter   = frontal diameter of rocket       (millimeters)
;  cd         = drag coefficient of rocket       (non-dimensional)


; Output

;  alt.bo   = burnout altitude            (meters)
;  vel.bo   = burnout velocity            (meters per second)
;  mass.bo  = burnout mass                (kilograms)
;  tcoast   = coast time                  (seconds)
;  tflight  = total flight time           (seconds)
;  alt.max  = maximum altitude            (meters)
;  massi    = optimum initial rocket mass (kilograms)


; maximize the total altitude with Mercury's "maximize" directive

maximize alt.max

; define the acceleration of gravity
; (meters per second per second)

gravity = 9.80665

; ---------------------------------------------------------

; NOTE: the next nine items are user inputs

; launch site altitude (meters)

alt.site = 100

; launch site temperature (degrees F)

temp.site = 70

; rocket engine thrust duration (seconds)

tburn = 1.2

; rocket engine total impulse (newton-seconds)

impulse = 5

; rocket engine propellant mass (kilograms)

mprop = .00833

; rocket frontal diameter (millameters)

diameter = 18

; drag coefficent (non-dimensional)

cd = .321

; ---------------------------------------------------------

; constrain the initial launch mass to a value greater than
; the rocket's propellant mass (kilograms)

massi > .0083

; provide Eureka with an initial guess for the rocket's
; initial launch mass (kilograms)

; "massi" is initially set equal to the propellant mass

massi := .00833

; ---------------------------------------------------------

; compute the atmospheric density at the launch site
; (kilograms per cubic meter)

density = 1.22557*(1-2.2556913E-5*alt.site)^4.256116/(1+(temp.site-59)/518.67)

; calculate the rocket's average thrust (newtons)

thrust = impulse / tburn

; calculate the rocket's average mass (kilograms)

mass =(massi - .5 * mprop )

; calculate the rocket's average "weight" (newtons)

weight = mass * gravity

; determine the rocket's "total" aerodynamic coefficient

k = .5*density*cd*pi*diameter^2/4e6

; compute burnout altitude (meters)

alt.bo =(mass/k)*ln(cosh(tburn*sqrt(k*(thrust-weight))/mass))

; compute burnout velocity (meters per second)

vel.bo = sqrt((thrust-weight)/k)*tanh(tburn*sqrt(k*(thrust-weight))/mass)

; compute burnout mass (kilograms)

mass.bo = massi - mprop

; compute burnout "weight" (newtons)   

weight.bo = gravity * mass.bo

; compute coast time (seconds)

tcoast = sqrt(mass.bo/(k*gravity))*atan(vel.bo*sqrt(k/weight.bo))

; compute the total flight time of the rocket (seconds)

tflight = tburn + tcoast

; solve for the rocket's maximum altitude (meters)

alt.max = alt.bo+(.5*mass.bo/k)*ln(k*vel.bo^2/weight.bo+1)



ÍÍÍÍÍ Solution ÍÍÍÍÍ
Variables:
  alt.max  = 0.5*(-0.00833+massi)/4.8546693611572E-05*LN(4.8546693611572E-05*(
SQRT((4.16666666666667-(-0.04084469725+9.80665*massi))/4.8546693611572E-05)*
TANH(1.2*SQRT(4.8546693611572E-05*(4.16666666666667-(-0.04084469725+9.80665*
massi)))/(-0.004165+massi)))^2/(-0.0816893945+9.80665*massi)+1)+(-0.004165+
massi)/4.8546693611572E-05*LN(COSH(1.2*SQRT(4.8546693611572E-05*(
4.16666666666667-(-0.04084469725+9.80665*massi)))/(-0.004165+massi)))
           = +546.24548660164760   
  gravity  = +9.80665000000000    { = +196133 / 20000 }
  alt.site = +100.00000000000000   
  temp.site = +70.000000000000000   
  tburn    = +1.200000000000000    { = +6 / 5 }
  impulse  = +5.0000000000000000   
  mprop    = +0.00833000000000000 { = +833 / 100000 }
  diameter = +18.000000000000000   
  cd       = +0.3210000000000000   { = +321 / 1000 }
  massi    = +0.0248723584909050 
  density  = 0.5*(-0.00833+massi)/4.8546693611572E-05*LN(4.8546693611572E-05*(
SQRT((4.16666666666667-(-0.04084469725+9.80665*massi))/4.8546693611572E-05)*
TANH(1.2*SQRT(4.8546693611572E-05*(4.16666666666667-(-0.04084469725+9.80665*
massi)))/(-0.004165+massi)))^2/(-0.0816893945+9.80665*massi)+1)+(-0.004165+
massi)/4.8546693611572E-05*LN(COSH(1.2*SQRT(4.8546693611572E-05*(
4.16666666666667-(-0.04084469725+9.80665*massi)))/(-0.004165+massi)))
           = +546.24548660164760   
  thrust   = +4.16666666666667    { = +25 / 6 }
  mass     = -0.004165+massi
           = +0.020707358490905044 
  weight   = -0.04084469725+9.80665*massi
           = +0.20306981714483394  
  k        = +4.8546693611572E-05
  alt.bo   = (-0.004165+massi)/4.8546693611572E-05*LN(COSH(1.2*SQRT(
4.8546693611572E-05*(4.16666666666667-(-0.04084469725+9.80665*massi)))/(
-0.004165+massi)))
           = +125.11498133626417   
  vel.bo   = SQRT((4.16666666666667-(-0.04084469725+9.80665*massi))/
4.8546693611572E-05)*TANH(1.2*SQRT(4.8546693611572E-05*(4.16666666666667-(
-0.04084469725+9.80665*massi)))/(-0.004165+massi))
           = +190.35441642504557   
  mass.bo  = -0.00833+massi
           = +0.016542358490905042 
  weight.bo = -0.0816893945+9.80665*massi
           = +0.16222511989483396  
  tcoast   = SQRT((-0.00833+massi)/0.00047608043290592)*ATAN(SQRT((
4.16666666666667-(-0.04084469725+9.80665*massi))/4.8546693611572E-05)*TANH(1.2*
SQRT(4.8546693611572E-05*(4.16666666666667-(-0.04084469725+9.80665*massi)))/(
-0.004165+massi))*SQRT(4.8546693611572E-05/(-0.0816893945+9.80665*massi)))
           = +7.5213865801020958   
  tflight  = 1.2+SQRT((-0.00833+massi)/0.00047608043290592)*ATAN(SQRT((
4.16666666666667-(-0.04084469725+9.80665*massi))/4.8546693611572E-05)*TANH(1.2*
SQRT(4.8546693611572E-05*(4.16666666666667-(-0.04084469725+9.80665*massi)))/(
-0.004165+massi))*SQRT(4.8546693611572E-05/(-0.0816893945+9.80665*massi)))
           = +8.7213865801020951   

Residuals and derived equations:
  { 0 }  gravity=9.80665
  { 0 }  alt.site=100
  { 0 }  temp.site=70
  { 0 }  tburn=1.2
  { 0 }  impulse=5
  { 0 }  mprop=0.00833
  { 0 }  diameter=18
  { 0 }  cd=0.321
  { 0 }  0.0083<massi
  { 0 }  density=1.18863832299518
  { 0 }  thrust=4.16666666666667
  { 0 }  mass=-0.004165+massi
  { 0 }  weight=9.80665*(-0.004165+massi)
  { 0 }  k=4.8546693611572E-05
  { 0 }  alt.bo=(-0.004165+massi)/4.8546693611572E-05*LN(COSH(1.2*SQRT(
4.8546693611572E-05*(4.16666666666667-(-0.04084469725+9.80665*massi)))/(
-0.004165+massi)))
  { 0 }  vel.bo=SQRT((4.16666666666667-(-0.04084469725+9.80665*massi))/
4.8546693611572E-05)*TANH(1.2*SQRT(4.8546693611572E-05*(4.16666666666667-(
-0.04084469725+9.80665*massi)))/(-0.004165+massi))
  { 0 }  mass.bo=-0.00833+massi
  { 0 }  weight.bo=9.80665*(-0.00833+massi)
  { 0 }  tcoast=SQRT((-0.00833+massi)/0.00047608043290592)*ATAN(SQRT((
4.16666666666667-(-0.04084469725+9.80665*massi))/4.8546693611572E-05)*TANH(1.2*
SQRT(4.8546693611572E-05*(4.16666666666667-(-0.04084469725+9.80665*massi)))/(
-0.004165+massi))*SQRT(4.8546693611572E-05/(-0.0816893945+9.80665*massi)))
  { 0 }  tflight=1.2+SQRT((-0.00833+massi)/0.00047608043290592)*ATAN(SQRT((
4.16666666666667-(-0.04084469725+9.80665*massi))/4.8546693611572E-05)*TANH(1.2*
SQRT(4.8546693611572E-05*(4.16666666666667-(-0.04084469725+9.80665*massi)))/(
-0.004165+massi))*SQRT(4.8546693611572E-05/(-0.0816893945+9.80665*massi)))
  { 0 }  alt.max=0.5*mass.bo/4.8546693611572E-05*LN(4.8546693611572E-05*vel.bo^
2/weight.bo+1)+alt.bo

Largest residual is 0
Method: Iterative
Numeric processor: 80387

