Rocket simulation. Are my equations correct?

356 Views Asked by At

I am simulating a rocket launch (two dimensions) and I am a little unsure about my implementation of Euler Forward. I will only give the $x$ component since $y$ is done the same way. I first calculate the acceleration like this:

$$a_x = \frac{F_x - m * g_x * D_x}{m}(1)$$

where $F_x$ is the thrust, $D_x$ is the drag and $g_x$ is the universal law of graviation:

$$g_x = \frac{GMx}{(x^2 +y^2)^{\frac{3}{2}}}(2)$$

I then use $a_x$ to calculate the position and then the velocity like this:

$$x = x + v*vx*dt (3)$$ where $v$ is the total velocity of the rocket and $vx$ is the $x$ component velocity.

Last I calculate the velocity like this:

$$v_x = v_x + a_x*dt (4)$$

I worry that equation $(3)$ is not right. Can someone confirm that it is right (or wrong)?

1

There are 1 best solutions below

7
On

I think it is wrong, because you should not mix the y-contribution of the velocity to x-position.

I would re-write them as :

$v_x = v_x + a_x*dt$ $(3)$

$x = x + v_x*dt$ $(4)$