The algorithm is basically as follows. The notation is slightlydifferent from that in the website you were given, but there is nodifference in the method.
Given the initial value problem
dy/dx=f(x,y),y(a)= y_0
Euler’s Method with step size h consists in applying theiterative formula
y_(n+1)= y_n+h?f(x_n,y_n ),n?0
To compute successive approximations y_1,y_2,y_3,? to the (true)values ?y(x?_1),?y(x?_2),?y(x?_3),? of the exact solution y=y(x) atthe points x_1,x_2,x_3,?, respectively.
In plain English:
You want to approximate the value of dy/dx (or y’) at some point inan interval.
Step 1: Depending on how accurate you need to be, divide theinterval up into little pieces of equal length; this length is thestep size h. For purposes of discussion, let’s use the interval[0,1] and use ten intervals, so h = 0.1.
Step 2: y_0=0
Step 3: y_1=y_0+0.1f(x_0,y_0)
Step 4: y_2=y_1+0.1f(x_1,y_1)
…
Stop after ten steps, in this case. Usually the stopping criterionis a level of accuracy.
You can easily set this up in Excel.
Exercises
Use Euler’s Method with step sizes h =0.1,0.02, 0.004, 0.0008 (thatis, do the problem 4 times, each with a more precise value of h) ,10 equally spaced iterations.
1. y^'=x^2+y^2,y(0)=0,0?x?1
2. y^'=x^2-y^2,y(0)=1,0?x?2
3. y^'=ln?y,y(1)=2,1?x?2
4. y^'=x^(2/3)+y^(2/3),y(0)=1,0?x?2
5. y^'=x+?x,y(0)=1,0?x?2
6. y^'=x+?x,y(0)= -1,0?x?2