You will write three functions for a damped oscillator.
The idea. With a damping force , the amplitude after a time is . Set it equal to a fraction of and take the natural log to find the time.
Your tasks.
amplitude, return the amplitude after a time t, in the unit of A0.half_time, return the time in s for the amplitude to fall to half.time_to_fraction, return the time in s for the amplitude to fall to the fraction frac of its start.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…