ballistic-motion
This is a Python program to solve an ODE describing a projectile motion in fields of gravity and air resistance. It applies only near Earth's surface at altitudes less than 10 km, distances less than 100 km and speeds much less than the speed of light.
Description
Write Newton's second law:
where:
-
$\overrightarrow{F_i}$ - sum of forces acting on a body; -
$\overrightarrow{p}$ - momentum of a body.
In this problem sum of forces is combined from the force of gravity
(
Rewrite right part assuming constant mass
where
Forces are defined as followes:
where:
-
$C_d$ - drag coefficient, constant; -
$\rho$ - air density , constant; -
$A$ - cross sectional area of the body; -
$\overrightarrow{v}$ - speed of the body; -
$k = -\frac{1}{2} C_d \rho A$ .
Substitute forces to (1) and divide both sides by
Add to the system definition of speed
Find projections on the axis (gravity acts only along Oy):
When given initial values for
Examples
CD = 0, t_max = 1.45, v_0 = 10, angle = 45 degrees
Theoretical values without drag force:
- time of flight =
$\frac{2 v_0 \sin \theta}{g} \approx \frac{2 \cdot 10 \cdot 0.707}{9.8} = 1.44$ s; - distance at 1.44 s =
$\frac{v_0^2}{g} \sin \left( 2 \theta \right) \approx \frac{10^2}{9.8} \cdot 1 = 10.2$ m; - maximum height =
$\frac{v_0^2 \sin^2 \theta}{2g} \approx 2.55$ m.
CD = 0.1, t_max = 0.5, v_0 = 700, angle = 0
CD = 0.1, t_max = 2.5, v_0 = 700, angle = 1 degree
Theoretical values:
- time of flight: 2.49 s;
- distance: 1744.97 m;
- maximum height: 7.61 m.