IBDP. AI. HL. DEs. Couple Equations – Euler’s Method

We can use Euler’s method to numerically approximate the solution to coupled equations:

\frac{dx}{dt} = f_1 (x,y,t)

\frac{dy}{dt} = f_2 (x,y,t) , for selected initial conditions x0 and y0 at initial time t0.

We choose a small time step, h>0 and then as before we calculate:

t1 = t0 + h

x1 = x0 + hf1(x0,y0,t0)

y1 = y0 + hf2(x0,y0,t0)

We then take the newly generated point (x1,y1) and generate a sequence of coordinates (xi,yi) for each time ti, using:

ti+1 = ti + h

xi+1 = xi + hf1(xi,yi,ti)

yi+1 = yi + hf2(xi,yi,ti)

Note that the solution curve is only an approximation.

If the system has the following form:

\frac{dx}{dt} = f_1(x,y)

\frac{dy}{dt} = f_2(x,y) , i.e. with derivatives independent of time, then the system is steady and we can also generate a phase portrait to study the system.

Worked Example 1

The damped simple harmonic motion of a mass on a spring is given by \frac{d^2x}{dt^2} + 0.2 \frac{dx}{dt}  + 4.01x = 0 , where x is the displacement at time t. The mass has initial displacement 5cm and is released with velocity 0.5cms-1 downwards.

(a.) Let y = \frac{dx}{dt} be the velocity function. Hence describe the system using coupled differential equations.

(b.) Apply Euler’s method by hand with h = 0.01 to generate (x1,y1)

(c.) Calculate Euler’s method with h=0.01 for the first 5 seconds of motion. Plot the set of points {(ti,xi)} on the same set of axes as the analytic solution x(t) = 5e^{-0.1t} cos(2t) . Discuss your answer.

Exercise 1

Screenshot
Screenshot
Screenshot

Exercise 1 – Answers