Articles

NUMERICAL SOLUTION OF DIFFERENTIAL EQUATIONS USING EULER’S METHOD

Introduction


In this article our objective is to develop a method for approximating the solution of an initial-value problem of the form

                                 y’ = f(x, y),     y(x0) = y0
We will not attempt to approximate y(x) for all values of x; rather, we will choose some small increment ∆x and focus on approximating the values of y(x) at a succession of x-values spaced ∆x units apart, starting from x0.  We will denote these x-values by x1=x0+∆x, x2=x1+∆x, x3=x2+∆x, x4=x3+∆x, ……… and we will denote the approximations of y(x) at these points by y1≈y(x1), y2≈y(x2), y3≈y(x3) ………….
The technique that we will describe for obtaining these approximations is called Euler’s Method.



Euler’s Method

To approximate the solution of the initial-value problem
                y’=f(x, y),         y(x0) = y0
Proceed as follows
Step 1:  Choose a nonzero number ∆x to serve as an increment or step size along the x-axis, and let
x1=x0+∆x,  x2= x1+∆x,  x3 = x2+∆x,  ………………………
Step 2:  Compute successively
                  y1 = y0 + f(x0, y0)∆x
                  y2 = y1 + f(x1, y1)∆x
                  y3 = y2 + f(x2, y2)∆x
                  …………………………………..
                  yn+1 = yn + f(xn, yn)∆x
The numbers y1, y2, y3 ……… in these equations are the approximations of y(x1), y(x2), y(x3), …………………………..
Example: Use Euler’s Method with a step size of 0.1 to make a table of approximate values of the solution of the initial-value problem
                 y’=y-x, y(0)=2 over the interval 0≤x≤1.
Solution: In this problem we have f(x, y)=y-x, x0=0 and y0=2.  Moreover, since the step size  is 0.1, the x-values at which the approximate values will be obtained are
x1=0.1, x2=0.2, x3=0.3, ……………………….., x9=0.9, x10=1
The first three approximations are
y1=y0+f(x0, y0)∆x = 2+(2-0)(0.1)=2.2
y2=y1+f(x1, y1)∆x = 2.2+(2.2-0.1)(0.1) = 2.41
y3=y2+f(x2, y2)∆x=2.41+(2.41-0.2)(0.1) = 2.631
Here is a way of organizing all 10 approximations rounded to five decimal places.

Observe that each entry in the last column becomes the next entry in the third column.

Accuracy of Euler’s Method

We can compare the approximate values of y(x) produced by Euler’s Method with decimal approximation of the exact values.  The absolute error is calculated as
Absolute error = |exact value – approximation| and the percentage error as



Exponential Growth and Decay Models

A quantity y=y(t) is said to be an exponential growth model it is increases at a rate that is proportional to the amount of the quantity present, and it is said to have an exponential decay model if ir decreases at a rate that is proportional to the amount of the quantity present.  Thus, for an exponential growth model, the quantity y(t) satisfies an equation of the form
                     dy/dt = ky (k>0)
and for an exponential decay model, the quantity y(t) satisfies an equation of the form
                     dy/dt = -ky (k>0)
The constant k is called the growth constant or the decay constant, as appropriate.
The above written two equations are first order linear equations, since they can be rewritten as
                    (dy/dt)-ky = 0 and (dy/dt) + ky=0
To illustrate how these equations can be solved, suppose that a quantity y=y(t) has an exponential growth model and we know the amount of the quantity at some point in time, y=y0 when t=0.  Thus a general formula for y(t) can be obtained by solving the initial value problem
                           (dy/dt)-ky=0, y(0)=y0
Multiplying by integrating factor, µ=e-kt yields d/dt(e-kt y)=0 and then integrating with respect to ‘t’ yields
                         e-kt y =C or y=Cekt
the initial condition implies that y=y0 when t=0, from which it follows that C=y0.  Thus, the solution of the initial-value problem is
                               y = y0ekt
We leave it for you to show that if y=y(t) has an exponential decay model, and if y(0)=y0, then
                               y = y0e-kt

Doubling time and half-life

If a quantity y has an exponential growth model, then the time required for the original size to double is called the doubling time, and if y has an exponential decay model, then the time required for the original size to reduce by half is called the half-life.  As it turns out, doubling time and half-life depend only on the growth or decay rate and not on the amount present initially.  To see why this is so, suppose that y=y(t) has an exponential growth model y=y0ekt and let T denote the amount of time required for y to double in size.  Thus, at time t=T the value of y will be 2y0 and hence the above equation becomes 2y0 = y0ekT or ekT=2
Hence T = (1/k)ln2

Now try it yourself!  Should you still need any help, click here to schedule live online session with e Tutor!

About eAge Tutoring:

eAgeTutor.com is the premium online tutoring provider.  Using materials developed by highly qualified educators and leading content developers, a team of top-notch software experts, and a group of passionate educators, eAgeTutor works to ensure the success and satisfaction of all of its students.  

Contact us today to learn more about our tutoring programs and discuss how we can help make the dreams of the student in your life come true!

Reference Links: