1

Lets consider the situation of a rocket launched from the ground onto some impact function $f(x)$. Assume that the impact function is just the $x$ axis, hence the projectile hit the ground at the same altitude in which launch occur.

Goal: minimise the flight time such that the rocket reach a prescribe distance $d$. What is it the launch angle that achieves this?

Let $x,y$ be the components of the position. By Newton's second law I have found the following couple second order ODEs

\begin{align*} \ddot{x}(t)&=\frac{100\cos(\theta)}{m(t)}-k(t)\dot{x}(t)\sqrt{\dot{x}^2(t)+\dot{y}^2(t)}\\ \ddot{y}(t)&=\frac{100\sin(\theta)}{m(t)}-g-k(t)\dot{y}(t)\sqrt{\dot{x}^2(t)+\dot{y}^2(t)} \end{align*}

where

\begin{equation} m(t) = m_0-\mu t \quad k(t)=\frac{C_d}{m(t)},\quad C_d,m_0,\mu\in\mathbb{R} \end{equation}

where $m_0$ is the initial mass and $\mu$ the burn rate of the fuel.

Let $X(t) = (x(t),y(t),\dot{x}(t),\dot{y}(t))^T$ and $\gamma(t) = \sqrt{\dot{x}^2(t)+\dot{y}^2(t)}$, then the system of ODEs is equivalent to \begin{align*} \dot{X}(t) &= \begin{bmatrix} 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & -k(t)\gamma(t) & 0\\ 0 & 0 & 0 & -k(t)\gamma(t) \end{bmatrix} X(t) + \begin{bmatrix} 0 \\ 0 \\ \frac{100\cos\theta}{m_0-\mu t}\\ \frac{100\sin\theta}{m_0-\mu t} - g \end{bmatrix}\\ &= A(t)X(t)+B(t)\\ &=F(t,X(t)) \end{align*} The initial conditions are (initial velocity is assumed to be zero) \begin{align*} x(0)=0&\quad y(0)=0\\ x'(0)=u_0\cos(\theta)=0&\quad y'(0)=v_0\sin(\theta)=0 \end{align*} where $\theta$ is the launch angle at $t=0$ and is the tangent angle to the curve when $t>0$ (we assumed that the thrust is always in the direction of motion)

How can I implement the Fourth-Order Runge–Kutta Method such that the rocket reach the prescribe distance $d$ in the small time period?

It would be helpful some advice, I don't want the problem solved (I want to do it by myself).

Lorenzo
  • 103
  • You have a boundary value problem with variable upper boundary. You can use a single-shooting approach. That is to say, implementing RK4 for this is the easier part. // Is $θ$ constant or, more likely, the tangent angle of the curve, the thrust aligned with the current flight direction? – Lutz Lehmann May 01 '22 at 08:37
  • @LutzLehmann Thank you for your reply. But I don't know the final time, how can I implement RK4? Yes, theta is constant, theta is the launch angle. What is the single-shooting approach? – Lorenzo May 01 '22 at 08:47
  • $θ$ is not only the launch angle, the rocket motor is working over the whole flight. You would need some active control to keep the resulting force vector in the same direction, even on the downward arc. // You integrate until the last position is below ground, then interpolate the last step to get a better approximation of the intersection point. Change the parameters a little, integrate, then extrapolate better parameters. // Single shooting and multiple shooting are standard methods, see wikipedia or other resources. – Lutz Lehmann May 01 '22 at 11:38
  • @LutzLehmann Thank you for you help. This helped me a lot :) – Lorenzo May 01 '22 at 14:13
  • As your equations are currently written they cannot be correct. The dimension of acceleration is length per time squared. On the right-hand side, you have reciprocal mass, perhaps it is just a missing constant, but something is certainly off. The thrust should almost certainly be pushing the rocket in the current direction. When you can compute the range $r$ as a function of $\theta$, then you can also solve the nonlinear equation $r(\theta)=d$ where $d$ is the distance to the target using the secant method. This will also provide the time-to-target. – Carl Christian May 01 '22 at 23:34
  • Mind the fact that the rocket my run out of fuel before it hits the ground. – Carl Christian May 01 '22 at 23:34
  • @CarlChristian thank you for your reply. In writing my code I have considered the fact that the rocket may run out of fuel (I.e, no more thrust in the odes). Initially I wanted to compute the range as a function of $\theta$ but I was not able to do it, so I searched others ways. I believe this is due to impossibility to solve analytically this coupled odes. – Lorenzo May 02 '22 at 05:48
  • @CarlChristian about the correctness of the odes i think they are because I just applied the Newton’s second law: $m\ddot{\mathbf{x}}= \sum F =thrust + F_g +F_{air}$ where $\mathbf{x}$ is the vector position of the rocket (i.e, it has $x,y$ components). The thrust is assumed to be constant 100kN, $F_{air} = -C_d\mathbf{x}^2$ . Which in the end gives the found odes. Note that $F_{air} = -C_d\mathbf{u}^2 =-C_du^2\frac{\mathbf{u}}{|u|}=-C_du\mathbf{u}$ where $\mathbf{u}$ is the vector velocity and $u$ the modulo of it. – Lorenzo May 02 '22 at 06:11
  • Ok, on the thrust issue. The way to write it so that you don't confuse people such as myself, is to use a variable, say $F_T$ in the equations and give it a value in the main text. This builds up the reader's trust :) – Carl Christian May 02 '22 at 12:31
  • Here, the term $100(\cos\theta,\sin\theta)$ should be considered as initial conditions involved in the launch process. So $\dot x(0) = 100\cos\theta$ and $\dot y(0) = 100\sin\theta$. – Cesareo May 03 '22 at 10:43
  • @Cesareo I don't understand why you said so. $F_T:=$thrust of the rocket= 100kN , why do you said that 100 is the initial velocity? the thrust is a force that accelerate the object, so the initial velocity can be zero. Anyway, I think I know how to solve it now. Thank you everyone for the insights :) – Lorenzo May 03 '22 at 18:06
  • Because then, the control variable should be $\theta(t)$. When you say "where $\theta$ is the launch angle at $t=0$" it is implicitly assumed that (initial conditions). A thrust of $100(\cos\theta,\sin\theta)$ with $\theta$ constant along all trajectory does not make sense at all. – Cesareo May 03 '22 at 18:22
  • Yes, $\theta$ is time dependent. I have also found the equation that specified how theta change with respect of time. – Lorenzo May 03 '22 at 20:33

0 Answers0