]> permondes.de Git - Analog_Engine.git/blob - scripts/EP1 04.02 Starting a Rocket_a.LACE
25b05465aa2bade0b4c442313d7b217cffe92836
[Analog_Engine.git] / scripts / EP1 04.02 Starting a Rocket_a.LACE
1 # A rocket is started from the surface of the earth. Calculating the height as function of its mass and fuel consumption.
2 # Approximation of gravity of earth by g
3 # Equation of motion
4 # r'' = alpha / (m0 - alpha*t) * v0 - g
5 # alpha: fuel consumption, e.g. 2000t in 2,5 min = 13,333*10^3 kg/s
6 # m0: initial mass of rocket, e.g. Saturn V: 2900 t = 2,9*10^6 kg
7 # v0: the velocity of the exhaust of the rocket: 3,180*10^3 m/s
8 # g: acceleration of earth = 9,81 m/s^2
9
10 include CompoundFunctions.LACE # include idivide
11
12 coefficient.1 -> alpha1
13 coefficient.2(+1) -> alpha2 # == alpha1
14 coefficient.3(-1) -> -m0
15 coefficient.4 -> v0
16 coefficient.5(+1) -> g
17
18 # generate t-ramp
19 iintegrate (-1) -> t
20
21 cmultiply (alpha1, t) -> alpha*t
22 isum (-m0, alpha*t) -> m0-alpha*t
23 idivide (alpha2, m0-alpha*t) -> -alpha/(m0-alpha*t)
24 cmultiply (-alpha/(m0-alpha*t), v0) -> -alpha/(m0-alpha*t)*v0
25 isum(-alpha/(m0-alpha*t)*v0, g) -> alpha/(m0-alpha*t)*v0-g
26
27 iintegrate (alpha/(m0-alpha*t)*v0-g) -> -v
28 invert (-v) -> v
29 iintegrate (-v) -> z
30
31 output (t) -> out.x
32 output (v) -> out.y
33 output (z) -> out.z