https://www.clipsafari.com/clips/o260577-parachuting-man
This problem aims to find a parachutist velocity throughout their flight and exactly when the forces given by drag and weight even out. The parachutist mass is 68.1kg , a constant drag force coefficient of 12.5kg/s, on earth with a constant gravity of 9.81 m/s2.
The two forces are applied on the person, the force of gravity (mg) and the force of drag (C(d)V). Using Newtons second law, F = ma, the forces are rewritten to solve for mass times acceleration. Acceleration is then exchanged for the derivative of velocity over time and the final equation is listed.
m (dv/dt) = mg - C (d) v
Using the equation (1) for acceleration along with Euler's method shown above the approximation for the derivative of the function can be iterated.
(1) 𝑑𝑣𝑑𝑡 = 𝑔 −𝐶(𝑑)𝑚𝑣(𝑡)
Equation (2) is used to approximate the derivative where time is (i).
(2) 𝑣(𝑡 (2)𝑖+1) ≈ 𝑣(𝑡𝑖) + (𝑔 −𝐶(𝑑)𝑚𝑣(𝑡𝑖))(𝑡𝑖+1 − 𝑡𝑖)
By defining acceleration as a derivative of velocity, in regards to time, the integral of equation (1) can be derived.
𝑢 = 𝑔 − 𝐶(𝑑) 𝑚 𝑣 𝑑𝑢 = − 𝐶(𝑑)
𝑚 𝑑𝑣 𝑢 = − 𝑚 𝐶(𝑑) 𝑑𝑢 𝑑𝑡 𝑢 = (𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡)𝑒 (− 𝐶(𝑑) 𝑚 )
Using u-substitution the integral is found and simplified to represent v(t) in regards to mass (m), drag force (Cd ), and time (t). Equation (3) 𝑣(𝑡) = (3) 𝑚𝑔 𝐶(𝑑) (1 − 𝑒 (− 𝐶(𝑑) 𝑚 )
In matlab the analytical and numerical solutions can be graphed over time given the equations from before. The analytical solution is shown in a smooth exponential curve, while the numerical solution is a dotted line slightly over the other. The numerical is over the analytical because of it being an approximation. The one shown in the graph has a .5 half step from 0- 30 seconds.
Pseudocode
The constant parameters grams (g), drag coefficient (c), and mass (m) are defined at the start of the pseudocode. Then delta t is defined. Using E.Q.(2) from the numerical solution to the problem the true velocity can be calculated. FOR loop is written for the length of time given as ( length(v) - 1 ). This will be the number of iterations the code does. For the analytical solution the linspace acts as a time interval that can match the numerical values. The analytical velocity (av) uses (ttrue) at time. The hold on command allows for editing the graphs.
Error
The Pseudocode on the right depicts the graphs below showing absolute error and true fractional relative error.
Absolute error is calculated from subtracting the difference in v (numerical solution) and av (analytical solution). Plotting that over time and multiplying by a 100 represents this graph.
True fractional relative error is the absolute error divided over the analytical solution.Plotting that over time and multiplying by a 100 represents this graph.