ContentsFoundations to FrontierBezhig

integration_code/starters/simulation.py

All lab code. Download this file.

# Exercise scaffold. Reference implementation is in a separate directory.
"""W05: velocity Verlet for x''=-omega^2*x, unit mass, fixed time step."""
import math

def verlet(x=1.0, v=0.0, omega=1.0, dt=0.1, steps=100):
    raise NotImplementedError('Implement this contract from the book.')

def exact(t, x0=1.0, v0=0.0, omega=1.0):
    raise NotImplementedError('Implement this contract from the book.')