I have 3 variables: v, b and h.
I know how to calculate v’, b’ and h’.
Starting the simulation from an initial condition, I need to calculate v, b and h after a given time using a numerical integrator (say RK4).
If I use the simple Euler method, I write;
v= v + dt * v’
b= b + dt * b’
h= h + dt * h’
but when I switch to RK4, I don’t know what to write.
The simulation is explained here: https://mintoc.de/index.php?title=Gravity_Turn_Maneuver
For example, h’= v * cos(b) doesn’t seem a differential equation; does it mean that h= h + dt * h’ is correct and that there is no reason to use RK4?
Also, the second RK4 step is:
k2 = f(x + dx / 2, y + k1 / 2)
and we have that m’ = constant, v’= f(v, m).
When I write the above k2 f(x, y) function, I suppose that I need to consider also m at time x + dx / 2, not only v, in other words f(x, y) is:
m = m_initial – m’ * x
v’ = f(m, v)
and not only v’ = f(v).