The Nature of Mathematical Modelling

7.1

What is the second-order approximation error of the Heun method, which averages the slope at the beginning and the end of the interval?

7.2

For a simple harmonic oscillator y¨+y = 0, with initial conditions y(0) = 1, y˙(0) = 0, find y(t) from t = 0 to 100π. Use an Euler method and a fixed-step fourth-order Runge–Kutta method. For each method check how the average local error, and the error in the final value and slope, depend on the step size.

See the Pen Wpopya by Ann (@beansbeansbeans) on CodePen.

7.3

Write a fourth-order Runge–Kutta adaptive stepper for the preceding problem, and check how the average step size that it finds depends on the desired local error.

See the Pen GWNWPQ by Ann (@beansbeansbeans) on CodePen.

7.4

Numerically solve the differential equation found in Problem 5.3: l ¨θ + (g + z¨)sin θ = 0 . (7.34) Take the motion of the platform to be periodic, and interactively explore the dynamics of the pendulum as a function of the amplitude and frequency of the excitation.