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.

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 main disadvantage of Euler's method? ›

Limitations of Euler's Method

Though Euler's Method is a simple and direct algorithm, it is less accurate than many algorithms like it. As previously mentioned, using a smaller step size h can increase accuracy but it requires more iterations and thus an unreasonably larger computational time.

Is Euler's method old or new math? ›

First off, Euler's Method is indeed pretty old, if not exactly ancient. It was developed by Leonhard Euler (pronounced oy-ler), a prolific Swiss mathematician who lived 1707-1783.

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 ...

What is the real part of Euler's formula? ›

Definition. Euler's Formula states that for any real x , eix=cosx+isinx, e i x = cos ⁡ x + i sin ⁡ where i is the imaginary unit, i=√−1 .

What is the conclusion of the Euler method? ›

The method will provide error-free predictions if the solution of the differential equation is linear, because for a straight line the second derivative would be zero. This latter conclusion makes intuitive sense because Euler's method uses straight-line segments to approximate the solution.

What is the Euler method of numerical methods? ›

In Euler's method, you can approximate the curve of the solution by the tangent in each interval (that is, by a sequence of short line segments), at steps of h . In general, if you use small step size, the accuracy of approximation increases.

Why is Euler's method inaccurate? ›

Expert-Verified Answer

The inaccuracy stems from the large step size in Euler's method. Large step sizes increase the deviation from the actual curve as this method makes local linear approximations. Greater deviation results in inaccuracies.

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.

Top Articles
LG 4620ER4002B STOPERLEGANTI VIBRATION BOOT
Best Archer Commanders in Rise of Kingdoms - OCG
2016 Hyundai Sonata Refrigerant Capacity
Hamlett Dobson Funeral Home Obituaries Kingsport Tn
Bon plan – Le smartphone Motorola Edge 50 Fusion "4 étoiles" à 339,99 €
Royal Bazaar Farmers Market Tuckernuck Drive Richmond Va
Minus8 Patreon
Sdn Wright State 2023
What Is the Z-Track Injection Method?
Defense Immunity 2K23 Meaning
When Does Dtlr Close
Walmart Front Door Wreaths
Ups Store Near Publix
Pokemon Infinite Fusion Good Rod
Who is Harriet Hageman, the Trump-backed candidate who beat Liz Cheney?
Einfaches Spiel programmieren: Schritt-für-Schritt Anleitung für Scratch
Busted Newspaper Hart County Ky
8 Garden Sprayers That Work Hard So You Don't Have To
Dallascowgirl Leaked Of
Shoulder Ride Deviantart
What To Do With Mysterious Camera In Sakura Stand
9:00 A.m. Cdt
New Jersey Map | Map of New Jersey | NJ Map
Director, Regional People
Kfc $30 Fill Up Substitute Sides
A vintage funfair / fairground
Forum Train Europe FTE on LinkedIn: #freight #traffic #timetablingeurope #fted
Violetken 5E
Walgreens Pharmacy On Jennings Station Road
Between Friends Comic Strip Today
Virtualrewardcenter.com/Activate
Back Doctor Near Me That Accept Medicaid
Shaw Funeral Home Vici Oklahoma
Marukai Honolulu Weekly Ads
Bellagio Underground Tour Lobby
Free Stuff Craigslist Roanoke Va
Bakkesmod Preset
Stellaris Resolution
Target Minute Clinic Hours
Papa Louie When Pizzas Attack Unblocked
Franchisee Training & Support | Papa Johns Pizza Franchise UK
Robin Herd: 1939-2019
Shs Games 1V1 Lol
Alineaciones De Rcd Espanyol Contra Celta De Vigo
Realidades 2 Capitulo 2B Answers
Fgo Spirit Root
Flow Free 9X9 Level 4
Online Reading Resources for Students & Teachers | Raz-Kids
Sc4 Basketball
Dtm Urban Dictionary
Potassium | History, Uses, Facts, Physical & Chemical Characteristics
Local artist makes award-winning reflection of his home, Duluth
Latest Posts
Article information

Author: Margart Wisoky

Last Updated:

Views: 6457

Rating: 4.8 / 5 (78 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Margart Wisoky

Birthday: 1993-05-13

Address: 2113 Abernathy Knoll, New Tamerafurt, CT 66893-2169

Phone: +25815234346805

Job: Central Developer

Hobby: Machining, Pottery, Rafting, Cosplaying, Jogging, Taekwondo, Scouting

Introduction: My name is Margart Wisoky, I am a gorgeous, shiny, successful, beautiful, adventurous, excited, pleasant person who loves writing and wants to share my knowledge and understanding with you.