What’s the terminal velocity of someone falling with a parachute? (this is our system)
Assumptions
Let’s say we have a model for this problem:
\[\frac{dv}{dt} = g -\frac{c}{m}v\]
where \(g\) is gravitational acceleration, \(c\) is a drag coefficient, \(m\) is the parachutist’s mass, and \(v\) is their velocity. The solution to this differential equation is:
\[ v(t) = \frac{gm}{c}(1 - e^{ct/m})\]
Write a function that finds the terminal velocity of a parachutist of a given mass and drag coefficient.
Summarize the goal(s) of the problem in your own words.
Similar as last time, but now use a functions. And the function itself should find the terminal velocity
Describe your plan to solve the problem.
Copy code from the previous exercise. Start a function signature and move content into it incrementally. Inside the function, check wether velocity is changing as time is increased incrementally.
Write Python code to solve the problem
# Your code heredef terminal_velocity(mass, drag, g=9.81):# mass in kg# drag in kg/s# g in m/s/s e =2.718# Euler's number new_vel =0 old_vel =-1 t =0while old_vel < new_vel: t +=1 old_vel = new_vel new_vel = (g * mass / drag) * (1- e**( -drag * t / mass))print(f"For a parachutist with mass of {mass} kg and drag coeff. of {drag} kg/s, the terminal velocity is {new_vel:.2f} m/s")pass# assign values to known parametersm =70# kgc =12# kg/sterminal_velocity(m,c,g=24.8)
For a parachutist with mass of 70 kg and drag coeff. of 12 kg/s, the terminal velocity is 144.67 m/s
Looking back at your code and the resulting output, reflect on whether your code achieved the problem goal(s). To the extent the problem models a physical system, how realistic does the behavior seem? Are there any changes you would make to your approach if you were to solve this problem again (e.g., to make your code more re-usable or to avoid dead ends)?
The code achieves the goal - it now uses a function to find the terminal velocity. It checks that velocity has not changed to determine that the value is the terminal value.
The behavior still seems realisitc: * increasing mass increases the terminal velocity * increasing drag coefficient decreases the terminal velocity
I’d like to modify the code to create plots of velocity vs. time.