The principle of rocket flight is based on "throwing away" the part of its mass in the form of exhaust gases. It is just like recoil when shooting the rifle - bullet flies away and you with rifle get the momentum in the opposite direction.
If we consider very small period of time, the simple equation about the change of the speed could be given:
dV = Vexhaust * dM / M
where:
dV
is the change of the speed (i.e. if the rocket has speed V
it will become V+dV
assuming that the thrust
is directed backward or V-dV
if thrust is reversed);dM
is how much fuel is burned (i.e. converted to exhaust gases) during this period of time;Vexhaust
is the speed of the exhaust gases - i.e. speed with which the aforementioned dM
is thrown away;M
is the full mass of the rocket (including the mass of the remaining fuel).What makes things complicated is that after each such period the full mass of the rocket is decreased by dM
!
Tsiolkovsky integrated this equation over the time and get his famous formula:
dV = Vexhaust * ln(M0 / M1)
Where M0
is the full mass when engines start working and M1
when they were turned off.
However for purpose of simulation you need not use this equation. Nowadays it is easier to numerically calculate change
of the speed in a loop with small time steps, say 0.1 sec
as it is described below.
Let us regard Safe Landing problem and try to see how calculations are performed in small steps.
We'll use steps of 0.1 second
:
dt = 0.1
And we start simulation with some initial height H
and speed V
directed down (i.e. in opposite direction to height
and thrust).
At each step we perform the following:
H = H - V*dt
.dM
- how much fuel is burned during dt
(depending on burning rate and whether we have fuel at all).dV = Vexhaust * dM/M
.dM
.g
at the current height as described below.g
and decrease according to dV
: V = V + g*dt - dV
.You only need to check whether fuel is ended (in which case dM
will be 0
) and whether height is above 0
(otherwise we have reached the surface).
According to Newton's Gravitation Law the gravity is reduced in proportion to distance squared from the center of the celestial body.
I.e. if the Moon has radius R
and gravity at its surface is g0
, then at the height H
above the surface we get:
g1 = g0 * R^2 / (R+H)^2
So that for example with R=1737100
, g0=1.622
and H=200000
(two hundred kilometres) we calculate:
g1 = 1.622 * 1737100^2 / (1737100+200000)^2 = 1.304
Gravitaty acceleration is expressed in m/s^2
i.e "meters per second per second" which means that, for example, near
the Moon's surface bodies increase speed by 1.6
meters per second each second when falling freely.