You will follow the energy of a block on a spring through one period, and check that the total stays the same.
The idea. With , the velocity is . The potential energy is and the kinetic energy is . Their sum should always be .
Your tasks.
omega, return the angular frequency .potential, return the potential energy of the spring at displacement x.kinetic, return the kinetic energy of the block at speed v.average_kinetic, the list ke holds the kinetic energy at many equally spaced moments of one period. Return its average.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…