Sie sind auf Seite 1von 12

Leonhard Euler

Portrait by Jakob Emanuel Handmann (1753)


EULER METHOD
Ordinary differential equation
Euler method

•Euler's method is a numerical method to solve


first order first degree differential equation
with a given initial value. It is the most basic
explicit method for numerical integration of
ordinary differential equations and is the
simplest Runge–Kutta method.
Informal geometrical description
• In general, this curve does not diverge too far from the original
unknown curve, and the error between the two curves can be made
small if the step size is small enough and the interval of
computation is finite

• Choose a value h for the size of every step and set


Now, one step of the Euler method from t n to
Example
• Given the initial value problem

• so first we must compute f ( t 0 , y 0 ) In this simple differential


equation, the function f is defined by f ( t , y ) = y . We have
• By doing the above step, we have found the slope of the line that is
tangent to the solution curve at the point ( 0 , 1 ). Recall that the
slope is defined as the change in y divided by the change in t, or Δ y
/ Δ t.
• The next step is to multiply the above value by the step size h,
which we take equal to one here:
• Since the step size is the change in t, when we multiply the step size
and the slope of the tangent, we get a change in y} value. This value
is then added to the initial y value to obtain the next value to be
used for computations.

• The above steps should be repeated to find


y 2, y 3 and y 4.
• Due to the repetitive nature of this
algorithm, it can be helpful to organize
computations in a chart form, as seen
below, to avoid making errors.
yn tn f(tn,yn) h Δy yn+1

0 1 0 1 1 1 2
1 2 1 2 1 2 4
2 4 2 4 1 4 8
3 8 3 8 1 8 16
• The conclusion of this computation is that
y 4 = 16. The exact solution of the differential equation is y ( t ) = e
t, so y ( 4 ) = e 4 ≈ 54.598. Although the approximation of the Euler
method was not very precise in this specific case, particularly due to
a large value step size h, its behaviour is qualitatively correct as the
figure shows.
Solve using Euler's Method:
• dy /dx= sin (x + y)−ex
• y(0)=4
• Use h=0.1
• Step 1 :We start at the initial value(0,4) and calculate the value of
the derivative at this point. We have:
dy/dx=sin(x+y)−ex
=sin(0+4)−e0
=−1.7568024953
We substitute our starting point and the derivative we just found to
obtain the next point along.
y (x+h)≈y(x)+h f (x,y)
y(0.1)≈4+0.1(−1.75680249531)
≈3.82431975047
• Step 2: Now we need to calculate the value of the derivative at this
new point (0.1,3.82431975047). We have:
dy/dx=sin(x+y)−ex
=sin(0.1+3.82431975047) −e0.1
=−1.8103864498
Once again, we substitute our current point and the derivative we
just found to obtain the next point along.
y(x+h)≈y(x)+hf(x,y)
y(0.2)≈3.82431975047+ 0.1(−1.8103864498)
≈3.64328110549
We proceed for the required number of steps and obtain these values:

x y dy/dx

0 4 -1.7568024953
0.1 3.8243197505 -1.8103864498
0.2 3.6432811055 -1.8669109257
0.3 3.4565900129 -1.926815173
0.4 3.2639084956 -1.9907132334
0.5 3.0648371723 -2.0594421065
0.6 2.8588929616 -2.1341215746
0.7 2.6454808042 -2.2162311734
0.8 2.4238576868 -2.3077132045
0.9 2.1930863664 -2.4111158431
1 1.9519747821

Das könnte Ihnen auch gefallen