CompSciHW9

Introduction to Scientific Computing, HW 9. Due Friday, Apr. 15, 2016.

1) Use the van der Pol oscillator class to simulate 60 second (6000 steps) trajectories with 3 initial conditions,  x, v = [4, 3], [4, 4], and [4, 5]  Here, v = dot x = dx/dt

2) Add a method to calculate the energy of a harmonic oscillator, E(x, v) = (x^2 + v^2)/2

3) Plot E(t) for all 3 simulations on the same axes. Remember to scale t = arange(6000)*dt.

4) Is there a pattern that would let you know when the oscillator is near the steady-state?

Remember, we built the van der Pol integrator on CompSciWeek13. The complete code is below,