Day 17: In-class Assignment: Modeling with Ordinary Differential Equations#
✅ Put your name here
#
Goals for Today’s In-Class Assignment#
By the end of this assignment, you should be able to:
Use functions to define derivatives that model the evolution of a physical system.
Use loops to update the state of an evolving system.
Use
solve_ivpto model a physical systemUse
matplotlibto plot the evolution of the system.Use NumPy when necessary to manipulate arrays or perform mathematical operations
Compare the differences between different numerical solutions to ODEs
Assignment instructions#
Today, with your group, you’re going to try to apply what you’ve learned in the pre-class assignment to solve ODEs to model a physical system.
This assignment is due at the end of class and should be uploaded into the appropriate “In-class Assignments” submission folder. Submission instructions can be found at the end of the notebook.
Part 1: Modeling a falling skydiver without air resistance#
In this assignment, we will be modeling the motion of a skydiver. There are two variables that will be changing that we need to consider:
The height of the skydiver (I.e., how far above the ground they are). This value will change with time as the skydiver gets closer and closer to the ground during their fall.
The speed (or, really, the velocity) of the skydiver (I.e., how fast they are falling towards the ground). The longer the skydiver falls, the faster they will be falling.
Since we have two values that are changing, we will need two differential equations. Without air resistance, these equations are
The main variables to know are: \(h\) refers to height, and \(v\) refers to velocity. \(g\) is acceleration due to gravity, and is a constant equal to \(-9.81\). (Everything on Earth picks up speed at roughly the same rate, as long as we ignore air resistance.)
Part 1a: Solving the ODEs using update equations#
For your first solution, you’re going to model the motion of the skydiver using loops and update equations. Remember that update equations can be expressed as the following:
✅ As a group, write some pseudocode to implement a model (system of equations) that describes the motion of the skydiver.
You and your groups members are expected to use your whiteboard for this..
Things to think about:
What are your key variables?
You should define a function to calculate the derivatives. What will that function look like?
What steps will you need to take within your loop?
✎ Put the pseudocode for your model here; Discuss your key variables; Basic equations; Steps to solve this problem
✅ Once you have a plan, translate it into code. Again, you should use loops and update equations to solve the problem. You should make a plot of the height and the velocity as a function of time.
The values you should use in your model are:
\(h_0 = 3000\) meters
\(v_0 = 0\) meters/second
\(g = -9.81\) gravity: meters/second^2
\(t_{max} = 30\) falling duration: seconds
\(dt = 1\) timestep
# Put your code here
✅ Question: If you want the model to stop when the skydiver hits the ground (going far too fast at the moment!), how might you build that into the model?
✎ Put your answer here.
Part 1b: Solving the ODEs with solve_ivp#
Above, you performed numerical update equations to solve for length and velocity. For your second solution, you’re going to model the motion of the bungee jumper using solve_ivp, a flexible python solution for these types of problems (systems modeled with 1st order differential equations).
The basic anatomy for the use of solve_ivp can be seen here:

✅ Write some pseudocode to describe the model using solve_ivp. What will be different about this implementation in comparison with the update equations from above?
✎ Put the pseudocode for your model here; Discuss your key variables; Basic equations; Steps to solve this problem
Then, write the actual code! Once you have a working model, you should again make a plots of the height and velocity as a function of time.
Note: You should be able to use what you figured out from the update equation solution to help guide your solve_ivp solution.
# Put your code here
Part 2: Adding air resistance to the model#
As we can see from our plots above, without air resistance the skydiver continously decreases velocity (or, “accelerates”) under the force of gravity. If they start high enough, they could reach very big velocities! In reality, this isn’t how skydiving works, eventually the skydiver reaches a constant “terminal velocity”. Check out this video to learn more about air resistance and terminal velocity if you’re interested.
In this case, the derivative of velocity (also known as acceleration) becomes dependent on the skydiver’s velocity. It is defined to be:
In this equation, \(A\) is the projected area of the skydiver, \(\left|v\right|\) is the absolute value of the velocity, and the \(m\) is the mass of skydiver. These make up the left term, or the acceleration due to air resistance. The right term, \(g\), is the acceleration from gravity, which was used in the code above.
As before, you are going to model the free-fall of the sky-diver for a total of 30 seconds, but now you need to take into account air resistance, using the formula above.
You can assume that:
The projected area (A) of the skydiver is 0.4 m\(^2\)
Their mass (m) is 80 kg
Their initial height is 2000 m
Finally,
Use a timestep (dt) of 0.1 seconds.
✅ Copy and paste the code from above and modify it to use the new timestep and initial height and dvdt to account for air resistance. Think about how a skydiver might move in the air and see if your plots match those ideas. You should see that the velocity flattens out to a constant value, the terminal velocity.
You should do this twice: once using the update equations, and once using the solve_ivp function.
#Put your update equations code here
#Put your solve_ivp code here
✅ Question: Do your plots of the height and velocity of the skydiver from solve_ivp agree with your solution when you used the update equations?
✎ Put your answer here.
✅ Question: Based on your results, what does the terminal velocity of the skydiver appear to be?
✎ Put your answer here.
Part 3 Give ‘em a parachute! (Time Permitting)#
Now, let’s make a final modification to make this a little more realistic, and give the skydiver a parachute. Modify your solve_ivp code from above to do the following:
simulate freefall with air resistance for heights above 1000 meters
implement a parachute once the height is less than 1000 meters.
Use your modified model to answer the following questions:
What parameter(s) do you need to modify in the model to approximate parachute behavior?
What are the specifications needed for the parachute in order to achieve a final speed of 5 m/s? (You should be able to answer this from the derivative equations and verify with the model!)
#Put your solve_ivp code here
Assignment wrapup#
Please fill out the form that appears when you run the code below. You must completely fill this out in order to receive credit for the assignment!
from IPython.display import HTML
HTML(
"""
<iframe
src="https://cmse.msu.edu/cmse201-ic-survey"
width="800px"
height="600px"
frameborder="0"
marginheight="0"
marginwidth="0">
Loading...
</iframe>
"""
)
Congratulations, you’re done!#
Submit this assignment by uploading it to the course D2L web page. Go to the “Pre-class assignments” folder, find the appropriate submission link, and upload it there.
See you in class!
© Copyright 2025, Michigan State University Board of Trustees