Physics Theory — Project 1: Ballistics and Projectile Launching
Objective
This project introduces the numerical simulation of two-dimensional motion under gravity, with and without air resistance. Its teaching goal is to connect:
- two-dimensional kinematics;
- Newton’s second law;
- numerical integration of ordinary differential equations;
- extraction of physical metrics such as flight time, horizontal range, and apex.
Conventions
- length: meter (m)
- time: second (s)
- mass: kilogram (kg)
- velocity: m/s
- acceleration: m/s²
- launch angle in the interface: degree (deg)
- angle in the integrator: radian (rad)
In the physical domain, the axis increases to the right and the axis increases upward.
Case without air resistance
When gravity acts alone, the acceleration is constant:
If the initial velocity has magnitude and angle , then:
The kinematic equations are:
Flight time
For launch and landing at the same level:
Horizontal range
Maximum height
The apex occurs when :
and the maximum height is:
These expressions serve as analytical references for validating numerical integration in the drag-free case.
Case with air resistance
In the current project, air resistance is modeled as quadratic drag. The drag force points opposite to the velocity:
where:
- is the air density;
- is the drag coefficient;
- is the cross-sectional area;
- is the instantaneous velocity.
Because the projectile is treated as a sphere, the area used is:
Dividing the force by the mass gives the drag acceleration:
The total acceleration is therefore:
with
This term makes the problem nonlinear and removes the simple closed-form solution of the ideal case. Numerical integration therefore becomes essential.
Formulation as a system of ODEs
The dynamic state of the projectile is:
Its time derivative is:
With drag, and depend on the instantaneous velocity, so the integrator must re-evaluate the derivative field during the step.
Numerical methods used
Symplectic Euler
The symplectic method updates the velocities first and then the position using the already corrected velocity. Schematically:
It is simple and inexpensive, and it often preserves the qualitative behavior of mechanical systems better than traditional explicit Euler.
Fourth-order Runge-Kutta (RK4)
RK4 uses four intermediate evaluations per step:
with each obtained from derivatives evaluated at intermediate states. This method significantly reduces local error and is the project’s default integrator.
Ground impact detection
The ground is at . The current project ends the simulation at the first ground impact. This implementation has neither restitution nor bouncing after the collision.
Because the integrator works in discrete steps, the state can cross the ground between two samples. To keep the range from depending too heavily on the step size, the project uses cubic Hermite interpolation within the last step to locate the impact instant more precisely.
In practice, this substantially improves:
- the flight-time estimate;
- the final-range estimate;
- test stability when varies.
Extracted physical metrics
The project records and displays:
- global simulation time;
- current or final horizontal range;
- apex point;
- time to apex;
- a history of unique launches with their parameters.
The apex is estimated from the recorded trajectory samples using local quadratic interpolation over neighboring points.
Relevant physical validation
Without drag
- compare the numerical range with the analytical expression ;
- compare the flight time with the corresponding analytical expression;
- check the apex against the closed-form kinematic solution.
With drag
- compare stability between coarser and finer time steps;
- verify that the solution remains physically plausible;
- compare different integrators to understand cost versus accuracy.
Assumptions and simplifications of the current model
- the projectile is treated as a particle whose radius is used only to compute the cross-sectional area;
- projectile spin is not modeled;
- there is no Magnus effect;
- wind is not modeled;
- the ground is a rigid boundary at ;
- impact ends the trajectory instead of simulating a collision with restitution.
These simplifications make the project an ideal first numerical laboratory: it already requires integration, impact interpolation, and comparison between ideal and dissipative models, without introducing excessive complexity too early.