Targeting solutions become significantly more difficult when drag is taken into account. We want to calculate a firing solution for any two position vectors with drag as a factor.
We want to find a way to calculate a solution without the usage of the As we will see, this requires the Lambert W function.
Reference Frame
We consider two bodies: A (the launcher) and B (the target). Placing A at the origin of our reference frame:
PA=⟨0,0⟩,PB=⟨xB,yB⟩.
The projectile is launched from PA with initial velocity vector
v0=v0cosθx^+v0sinθy^,
where v0=∣v0∣ is the launch speed and θ is the elevation angle.
Solving an Ideal Projectile
For an ideal projectile, the differential equations below model velocity, where g=9.81 m/s2:
dtdvx=0
dtdvy=−g⋅dt
The only rate of change in velocity is across the y-axis, thus the velocity along the x-axis remains constant.
Therefore, we can model vpx(t) as
vpx(t)=vpxi
To solve for vpy(t), we will solve the differential equation.
Thus, we have solved our set of differential equations for velocity.
Now, given the elementary physics concept:
v(t)=dtdr
We can relate our equations
vpy(t)=dtdpy
vpx(t)=dtdpx
Creating a parametric equation to solve for this equation is ideal, as a value of x will directly correspond to a y value which we can check for displacement.
dtdpy⋅dpxdt=dpxdpy
dpxdpy=vpxi−g⋅dt+vpyi
However, dt is still in the equation and we need a relation between dt and px. Thus, we can integrate dtdpx
px(t)=∫dtdpxdt=∫vpxidt=vpxi⋅t+C
We can infer C=0 since the initial displacement of the projectile is 0. So we are left with
Thus, the following equation will solve for any stationary target given a displacement ax and ay. Solving for a moving target leads to a quartic equation, to be addressed in a future section.
Drag Definition
In this system, drag will be acting on this projectile where ζ=(0,1], where at ζ value of 1 is an ideal system with no drag. Drag is modeled by the differential:
dv=v⋅ζ⋅dt
We can rewrite this differential
dv=dtdp⋅ζ⋅dt=dp⋅ζ
We know that when the projectile's velocity is equal to 0, it has come to rest with respect to a certain axis. As the gravitational force is exclusive to the y-axis, we can model the maximum possible distance to be traveled along a certain axis to be.
ζv0x=Δpxmax
We consider the two forces to be acting on the projectile to be the gravitational and the drag force, such that
ax=−vx⋅ζay=−g+−vy⋅ζ
X-Axis Differential
Let us first derive a closed function for position along the x axis by taking the integral of the differential equation.
vx(t)=∫dtdvxdt=−vx⋅ζ=e−ζt⋅vx0
We integrate once more with respect to time to get a closed function for position with respect to the x-axis
px(t)=∫vx(t)dt=−ζvx0⋅e−ζt+ζvx0
Which can be rewritten as:
px(t)=ζvx0⋅(1−e−ζt)
Differential with Gravity
We now need to integrate with respect to the y-axis, where gravity is a factor in this differential. Let g=10m/s2.
vy(t)=∫dtaydt=(vy0+ζg)⋅e−dx+ζg−vy0
We integrate once more to get a closed function for position with respect to the y-axis