It can be shown that the motion with respect to time of a vehicle which travels in a straight line, subject to aerodynamic drag, is governed by the following ODE:
The thing that makes this tricky to solve analytically is the non-linear drag component, which is a function of the square of the velocity (
At this stage, it makes sense to break something out from the numerical methods toolbox.
One possible way to overcome the absence of an analytical solution is to approximate the first and second-order derivatives à la Taylor series expansion:
$$\dot{x} \cong \frac{x_{i+1}-x_{i-1}}{2h} - \mathcal{O}(h^2)$$
$$\ddot{x} \cong \frac{x_{i+1}-2x_{i}+x_{i-1}}{h^2} + \mathcal{O}(h^2)$$
where
This is what the equation looks like after substituting these terms in:
$$m\left( \frac{x_{i+1}-2x_{i}+x_{i-1}}{h^2} \right) + c\left( \frac{x_{i+1}-x_{i-1}}{2h} \right)\left( \frac{x_{i+1}-x_{i-1}}{2h} \right) - F = 0$$
My goal with this equation is to predict the position of the next time instance,
After some rearrangement, this jungle of a quadratic equation results:
$$ \alpha \cdot x^2_{i+1} + \beta \cdot x_{i+1} + \gamma = 0$$
where
Yuck. Let's clean that up some more by utilizing a common denominator,
$$ c \cdot x^2_{i+1} + ( 4m - 2cx_{i-1} ) \cdot x_{i+1} + x_{i-1}(4m+cx_{i-1})-8mx_{i}-4Fh^2 = 0$$
A bit better.
I'm not too concerned about encountering imaginary roots (where
I'm also expecting that one of the roots will be positive, the other negative. Since
$$ x_{i+1} = \frac{-\beta + \sqrt{\beta^2-4\alpha\gamma}}{2\alpha} $$