Contents

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel\(\rightarrow\)Restart) and then run all cells (in the menubar, select Cell\(\rightarrow\)Run All).

Make sure you fill in any place that says YOUR CODE HERE or “YOUR ANSWER HERE”, as well as your name and collaborators below:

NAME = ""
COLLABORATORS = ""

Consider the following third-order ODE that describes a simplified mechanical system:

y’’’ - 3y’’ + 2y’ - y = sin(t),

where t is the independent variable and y(t) is the dependent variable.

The initial conditions are: y(0) = 0, y’(0) = 1, y’’(0) = -1.

Solve this ODE numerically for t in the range [0, 1] using Python’s solve_ivp.

Use an event to find where y=0 (besides the initial condition). Plot your solution, and the places where you found the events.

Also print the y-values at the events found.

When you are done, download a PDF and turn it in on Canvas. Make sure to save your notebook, then run this cell and click on the download link.

%run ~/s25-06623/s25.py
%pdf