We can use Euler’s method to numerically approximate the solution to coupled equations:
, 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:
, 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 , 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 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 . Discuss your answer.
Exercise 1



Exercise 1 – Answers


