11. Euler's Method - a numerical solution for Differential Equations (2024)

Why numerical solutions?

For many of the differential equations we need to solve in the real world, there is no "nice" algebraic solution. That is, we can't solve it using the techniques we have met in this chapter (separation of variables, integrable combinations, or using an integrating factor), or other similar means.

As a result, we need to resort to using numerical methods for solving such DEs. The concept is similar to the numerical approaches we saw in an earlier integration chapter (Trapezoidal Rule, Simpson's Rule and Riemann Sums).

Even if we can solve some differential equations algebraically, the solutions may be quite complicated and so are not very useful. In such cases, a numerical approach gives us a good approximate solution.

The General Initial Value Problem

We are trying to solve problems that are presented in the following way:

`dy/dx=f(x,y)`; and

`y(a)` (the inital value) is known,

where `f(x,y)` is some function of the variables `x`, and `y` that are involved in the problem.

Examples of Initial Value Problems

(a) `dy/dx=6-2y/x`

`y(3)=1`

(b) `dy/dx=(y ln y)/x`

`y(2)=e`

(c) `dy/dx=(50x^2-10y)/3`

`y(0)=0`

Note that the right hand side is a function of `x` and `y` in each case.

Let's now see how to solve such problems using a numerical approach.

Euler's Method

Euler's Method assumes our solution is written in the form of a Taylor's Series.

That is, we'll have a function of the form:

`y(x+h)` `~~y(x)+h y'(x)+(h^2y''(x))/(2!)` `+(h^3y'''(x))/(3!)` `+(h^4y^("iv")(x))/(4!)` `+...`

This gives us a reasonably good approximation if we take plenty of terms, and if the value of `h` is reasonably small.

For Euler's Method, we just take the first 2 terms only.

`y(x+h)` `~~y(x)+h y'(x)`

The last term is just `h` times our `dy/dx` expression, so we can write Euler's Method as follows:

`y(x+h)` `~~y(x)+h f(x,y)`

How do we use this formula?

We start with some known value for `y`, which we could call `y_0`. It has this value when `x=x_0`. (We make use of the initial value `(x_0,y_0)`.)

The result of using this formula is the value for `y`, one `h` step to the right of the current value. Let's call it `y_1`. So we have:

`y_1` `~~y_0+h f(x_0,y_0)`

where

`y_1` is the next estimated solution value;

`y_0` is the current value;

`h` is the interval between steps; and

`f(x_0,y_0)` is the value of the derivative at the starting point, `(x_0,y_0)`.

Next value: To get the next value `y_2`, we would use the value we just found for `y_1` as follows:

`y_2` `~~y_1+h f(x_1,y_1)`

where

`y_2` is the next estimated solution value;

`y_1` is the current value;

`h` is the interval between steps;

`x_1 = x_0+h`; and

`f(x_1,y_1)` is the value of the derivative at the current `(x_1,y_1)` point.

We continue this process for as many steps as required.

What's going on?

The right hand side of the formula above means, "start at the known `y` value, then move one step `h` units to the right in the direction of the slope at that point,which is `dy/dx = f(x,y)`. We will arrive at a good approximation to the curve's y-value at that new point."

We'll do this for each of the sub-points, `h` apart, from some starting value `x=a` to some finishing value, `x=b`, as shown in the graph below.

11. Euler's Method - a numerical solution for Differential Equations (1)

Let's see how it works with an example.

Example: Euler's Method

Let's solve example (b) from above. We had the initial value problem:

`dy/dx=(y ln y)/x`

`y(2)=e`

Step 1

We'll start at the point `(x_0,y_0)=(2,e)` and use step size of `h=0.1` and proceed for 10 steps. That is, we'll approximate the solution from `t=2` to `t=3` for our differential equation. We'll finish with a set of points that represent the solution, numerically.

We already know the first value, when `x_0=2`, which is `y_0=e` (the initial value).

We now calculate the value of the derivative at this initial point. (This tells us the direction to move.)

`dy/dx = f(2,e)` `=(e ln e)/2` ` = e/2~~1.3591409`

This means the slope of the line from `t=2` to `t=2.1` is approximately `1.3591409`.

Step 2

Now, for the second step, (since `h=0.1`, the next point is `x+h=2+0.1=2.1`), we substitute what we know into Euler's Method formula, and we have:

`y(x+h)` `~~y(x)+h f(x,y)`

`y_1 = y(2.1)` ` ~~ e + 0.1(e/2)` ` = 2.8541959`

This means the approximate value of the solution when `x=2.1` is `2.8540959`.

Let's see what we've done on a graph.

11. Euler's Method - a numerical solution for Differential Equations (2)

We'll need the new slope at this point, so we'll know where to head next.

`dy/dx = f(2.1,2.8541959)` `=(2.8541959 ln 2.8541959)/2.1` ` = 1.4254536`

This means the slope of the approximation line from `x=2.1` to `x=2.2` is `1.4254536`. So it's a little bit steeper than the first slope we found.

Step 3

Now we are trying to find the solution value when `x=2.2`. We substitute our known values:

`y(x+h)` `~~y(x)+h f(x,y)`

`y(2.2) ~~` ` 2.8540959 + 0.1(1.4254536)` ` = 2.99664126`

With this new value, our graph is now:

11. Euler's Method - a numerical solution for Differential Equations (3)

We'll need the new slope at this point, so we'll know where to head next.

`f(2.2,2.99664126)` `=(2.99664126 ln 2.99664126)/2.2` ` = 1.49490457`

This means the slope of the approximation line from `x=2.2` to `x=2.3` is `1.49490456`. So it's a little more steep than the first 2 slopes we found.

Step 4

Now we are trying to find the solution value when `x=2.3`. We substitute our known values:

`y(x+h)` `~~y(x)+h f(x,y)`

`y(2.3) ~~` ` 2.99664126 + 0.1(1.49490456)` ` = 3.1461317`

With this new value, our graph is now:

11. Euler's Method - a numerical solution for Differential Equations (4)

Subsequent Steps

We present all the values up to `x=3` in the following table.

Of course, most of the time we'll use computers to find these approximations. I used a spreadsheet to obtain the following values. Don't use your calculator for these problems - it's very tedious and prone to error. You could use an online calculator, or Google search.

`x``y``dy/dx`
2.0e = 2.7182818285(e ln e)/2 = 1.3591409142
2.1e+0.1(e/2) = 2.8541959199(2.8541959199 ln 2.8541959199)/2 = 1.4254536226
2.22.99674128211.4949999323
2.33.14624127541.5679341197
2.43.30303468731.6444180873
2.53.46747649611.7246216904
2.63.63993866511.8087230858
2.73.82081097371.8969091045
2.84.01050188411.9893756448
2.94.20943944862.08632809
3.04.4180722576

(There's no final `dy/dx` value because we don't need it. We've found all the required `y` values.)

Here is the graph of our estimated solution values from `x=2` to `x=3`.

11. Euler's Method - a numerical solution for Differential Equations (5)

How good is it?

This particular question actually is easy to solve algebraically, and we did it back in the Separation of Variables section. (It was Example 7.)

Our solution was `y = e^(x"/"2)`. In the next graph, we see the estimated values we got using Euler's Method (the dark-colored curve) and the graph of the real solution `y = e^(x"/"2)` in magenta (pinkish). We can see they are very close.

11. Euler's Method - a numerical solution for Differential Equations (6)

In this case, the solution graph is only slightly curved, so it's "easy" for Euler's Method to produce a fairly close result.

In fact, at `x=3` the actual solution is `y=4.4816890703`, and we obtained the approximation `y=4.4180722576`, so the error is only:

`(4.4816890703 - 4.4180722576)/4.4816890703` ` = 1.42%`.

Exercise

The following question cannot be solved using the algebraic techniques we learned earlier in this chapter, so the only way to solve it is numerically.

Solve using Euler's Method:

`dy/dx=sin(x+y)-e^x`

`y(0) = 4`

Use `h=0.1`

Answer

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)-e^x`

`=sin(0+4)-e^0`

`=-1.75680249531`

We substitute our starting point and the derivative we just found to obtain the next point along.

`y(x+h)~~y(x)+hf(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)-e^x`

`=sin(0.1+3.82431975047)` `-e^0.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`
04-1.7568024953
0.13.8243197505-1.8103864498
0.23.6432811055-1.8669109257
0.33.4565900129-1.926815173
0.43.2639084956-1.9907132334
0.53.0648371723-2.0594421065
0.62.8588929616-2.1341215746
0.72.6454808042-2.2162311734
0.82.4238576868-2.3077132045
0.92.1930863664-2.4111158431
11.9519747821

Here's the graph of this solution.

11. Euler's Method - a numerical solution for Differential Equations (7)

In the next section, we see a more sophisticated numerical solution method for differential equations, called the Runge-Kutta Method.


Need help solving a different Calculus problem? Try the Problem Solver.


Disclaimer: IntMath.com does not guarantee the accuracy of results. Problem Solver provided by Mathway.

11. Euler's Method - a numerical solution for Differential Equations (2024)

FAQs

What is Euler method to solve differential equation? ›

It is the most basic explicit method for numerical integration of ordinary differential equations and is the simplest Runge–Kutta method. The Euler method is named after Leonhard Euler, who first proposed it in his book Institutionum calculi integralis (published 1768–1770). (Figure 1) Illustration of the Euler method.

Is Euler's method a numerical method? ›

The method we will study in this chapter is “Euler's method”. It is but one of many methods for generating numerical solutions to differential equations.

How to find exact solution in Euler's method? ›

1: Euler's method for approximating the solution to the initial-value problem dy/dx = f (x, y), y(x0) = y0. Setting x = x1 in this equation yields the Euler approximation to the exact solution at x1, namely, y1 = y0 + f (x0,y0)(x1 − x0), which we write as y1 = y0 + hf (x0,y0).

What is Euler's equation in differential equation? ›

In mathematics, an Euler–Cauchy equation, or Cauchy–Euler equation, or simply Euler's equation, is a linear hom*ogeneous ordinary differential equation with variable coefficients. It is sometimes referred to as an equidimensional equation.

What is an example of Euler's formula? ›

It is written F + V = E + 2, where F is the number of faces, V the number of vertices, and E the number of edges. A cube, for example, has 6 faces, 8 vertices, and 12 edges and satisfies this formula.

Why do we need numerical methods to solve differential equations? ›

Often, systems described by differential equations are so complex, or the systems that they describe are so large, that a purely analytical solution to the equations is not tractable. It is in these complex systems where computer simulations and numerical methods are useful.

How do you solve Euler's formula? ›

The basic approach to solving Euler equations is similar to the approach used to solve constant-coefficient equations: assume a particular form for the solution with one constant “to be determined”, plug that form into the differential equation, simplify and solve the resulting equation for the constant, and then ...

How do you find the solution of an exact differential equation? ›

HOWTO: Procedure For Solving An Exact Equation (Method 1)
  1. Check that the equation M(x,y)dx+N(x,y)dy=0. ...
  2. Integrate ∂F(x,y)∂x=M(x,y) ...
  3. Differentiate Equation 2.5. ...
  4. Equate the right side of this equation to N and solve for ϕ′; thus, ∂G(x,y)∂y+ϕ′(y)=N(x,y),soϕ′(y)=N(x,y)−∂G(x,y)∂y.
Jun 23, 2024

What is exact solution in numerical method? ›

An exact solution is a symbolic representation of a value which solves a given equation exactly, while a numerical solution is numerical (often decimal) representation of a value which solves a given equation exactly or approximately. There are cases where these overlap, and cases where they are entirely different.

Why is Euler's method useful? ›

Euler's method is used for approximating solutions to certain differential equations and works by approximating a solution curve with line segments. In the image to the right, the blue circle is being approximated by the red line segments.

What is the characteristic equation of the Euler differential equation? ›

[r(r − 1) + p0r + q0]xr = 0 ⇔ r(r − 1) + p0r + q0 = 0. The last equation involves only r, not x. This equation is called the indicial equation, and is also called the Euler characteristic equation.

Why does Euler's equation work? ›

And when you look into it actually does explain why it works because since both the derivatives of trig functions and powers of i have a "cycle" of 4, only the powers of x and the factorials don't cycle, which is exactly like the Maclaurin expansion of trig functions so you can factor out the cos(x) and i*sin(x) to get ...

What is the Euler formula in differential geometry? ›

Euler's formula: v — e +f = c + 1.

Which method is used to solve differential equations? ›

For some differential equations, application of standard methods—such as the Euler method, explicit Runge–Kutta methods, or multistep methods (for example, Adams–Bashforth methods)—exhibit instability in the solutions, though other methods may produce stable solutions.

How do you use the Euler equation? ›

The basic approach to solving Euler equations is similar to the approach used to solve constant-coefficient equations: assume a particular form for the solution with one constant “to be determined”, plug that form into the differential equation, simplify and solve the resulting equation for the constant, and then ...

What is Euler method stochastic differential equation? ›

The Euler scheme is one of the standard schemes to obtain numerical approximations of solutions of stochastic differential equations (SDEs). Its convergence properties are well known in the case of globally Lipschitz continuous coefficients.

References

Top Articles
How, where and when to get updated Covid booster shots targeting BA.5
The Smart Way To Talk to Your Child's Teacher
Funny Roblox Id Codes 2023
Golden Abyss - Chapter 5 - Lunar_Angel
Www.paystubportal.com/7-11 Login
Joi Databas
DPhil Research - List of thesis titles
Shs Games 1V1 Lol
Evil Dead Rise Showtimes Near Massena Movieplex
Steamy Afternoon With Handsome Fernando
Which aspects are important in sales |#1 Prospection
Detroit Lions 50 50
18443168434
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Grace Caroline Deepfake
978-0137606801
Nwi Arrests Lake County
Justified Official Series Trailer
London Ups Store
Committees Of Correspondence | Encyclopedia.com
Pizza Hut In Dinuba
Jinx Chapter 24: Release Date, Spoilers & Where To Read - OtakuKart
How Much You Should Be Tipping For Beauty Services - American Beauty Institute
Free Online Games on CrazyGames | Play Now!
Sizewise Stat Login
VERHUURD: Barentszstraat 12 in 'S-Gravenhage 2518 XG: Woonhuis.
Jet Ski Rental Conneaut Lake Pa
Unforeseen Drama: The Tower of Terror’s Mysterious Closure at Walt Disney World
Ups Print Store Near Me
C&T Wok Menu - Morrisville, NC Restaurant
How Taraswrld Leaks Exposed the Dark Side of TikTok Fame
Dashboard Unt
Access a Shared Resource | Computing for Arts + Sciences
Speechwire Login
Healthy Kaiserpermanente Org Sign On
Restored Republic
Lincoln Financial Field, section 110, row 4, home of Philadelphia Eagles, Temple Owls, page 1
Jambus - Definition, Beispiele, Merkmale, Wirkung
Netherforged Lavaproof Boots
Ark Unlock All Skins Command
Craigslist Red Wing Mn
D3 Boards
Jail View Sumter
Nancy Pazelt Obituary
Birmingham City Schools Clever Login
Thotsbook Com
Vérificateur De Billet Loto-Québec
Funkin' on the Heights
Vci Classified Paducah
Www Pig11 Net
Ty Glass Sentenced
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 5453

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.