Car motion example - Your turn#
When the speed of the car reaches \(50\) km/h, it stops accelerating and begins to slow down. At the beginning, the brakes are applied slowly, and as the time increases, the braking force increases. The breaking force exerted on the car can be modeled as follows: \(F_{\mathrm{break}} = -100 tv^2\) in Newtons, with \(t\) in seconds. The equations of motion become:
The discretized equations are then written as follows:
The goal of this exercise is to compute the distance driven and the time needed for the car to slow down from \(50\) km/h to \(10\) km/h.
Part 1#
Write a script to solve these equations numerically. Choose \(0\) for both the initial position and time and \(13.89\) m/s for the initial velocity. Use the same time step as in the example. Stop the iteration when the velocity reaches \(2.78\) m/s (\(10\) km/h).
# TODO: Write your solution below
Part 2#
Plot the position and velocity as a function of time in the same figure using subplots. Add a title and axes labels.
# TODO: Write your solution below
Part 3#
Determine the time and the distance traveled to slow down to \(10\) km/h.
# TODO: Write your solution below
Exporting your work#
When you’re ready, the easiest way to export the notebook is to File > Print
it and save it as a PDF.
Remove any excessively long, unrelated outputs first by clicking the arrow → next to the output box and then Show/hide output
.
Obviously don’t obscure any necessary output or graphs!