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's method in differential equations? ›

In mathematics and computational science, the Euler method (also called the forward Euler method) is a first-order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value.

What is the numerical method of Euler? ›

Euler's method is based on approximating the graph of a solution y(x) with a sequence of tangent line approximations computed sequentially, in “steps”. Our first task, then, is to derive a useful formula for the tangent line approximation in each step.

Which numerical method is used to solve differential equations? ›

This is the implicit Euler method formula. Runge-Kutta method, are widely used in solving differential equations. However, a question remains: The Forward Difference is an approximation.

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 the differential form of Euler's equation? ›

A differential equation is called an Euler equation if it can be written in the form anxny(n)(x)+⋯+a1xy′+a0y=f(x).

What is Euler's formula used for? ›

What is Euler's Formula Used For? Euler's formula in geometry is used for determining the relation between the faces and vertices of polyhedra. And in trigonometry, Euler's formula is used for tracing the unit circle.

What is the Euler method formula? ›

What is Euler's method formula? The formula for Euler's method is y_{n+1} = y_n + h f(x_n, y_n). y_n represents the current value of a point on the solution, and y_{n+1} is the next value, for an increment in the x variable equal to the step size h.

How to solve a differential equation? ›

We can solve these differential equations using the technique of an integrating factor. We multiply both sides of the differential equation by the integrating factor I which is defined as I = e∫ P dx. ⇔ Iy = ∫ IQ dx since d dx (Iy) = I dy dx + IPy by the product rule.

What is the forward Euler method of numerical differentiation? ›

The basis of Forward Euler: keeping the rate of change constant. Given the differential equation (1), we know what the initial rate of change of y must be. This initial slope of y(t) is f(t0). Unless f(t) happens to be a constant function, f(t) will change to different values for t>t0.

What is the numerical method of numerical differentiation? ›

Three primary methods of numerical differentiation, based on the Taylor series, include: Forward difference method, Backward difference method and Central difference method. The usage depends on the required accuracy and computational resources. Error analysis is crucial in numerical differentiation.

What are the advantages of the Euler method? ›

The advantage of using Euler's method is that it can be used to solve many nonlinear differential equations as well as linear differential equations. , ∆t, to use. You must also decide on a start value for t and for x. The disadvantage of using Euler's method is that you must use a small enough of a step size.

What are numerical methods solutions of equations? ›

Numerical methods are used to approximate solutions of equations when exact solutions can not be determined via algebraic methods. They construct successive ap- proximations that converge to the exact solution of an equation or system of equations.

What is the Euler's method to solve ordinary differential equations? ›

One of the simplest and oldest methods for approximating differential equations is known as the Euler's method. The Euler method is a first-order method, which means that the local error is proportional to the square of the step size, and the global error is proportional to the step size.

When to use Euler's method? ›

Euler's Method, is just another technique used to analyze a Differential Equation, which uses the idea of local linearity or linear approximation, where we use small tangent lines over a short distance to approximate the solution to an initial-value problem.

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 formula in differential geometry? ›

Theorem: Let φ be the angle, in the tangent plane, measured counterclockwise from the direction of minimum curvature κ1 . Then the normal curvature κn(φ) in direction φ is given by κn(φ)=κ1cos2φ+κ2sin2φ.

What is the Euler method in hidden figures? ›

Euler's Method in Hidden Figures

In the film, the method is used to find a solution between two different types of orbit that the capsule moves during its journey from space to earth. Although the method is described as 'old math' in the film, many engineers and mathematicians frequently use it in their work today.

Top Articles
The Kangs Yeesu Chapter 31
Pell City Jail Roster
English Bulldog Puppies For Sale Under 1000 In Florida
Otterbrook Goldens
Wausau Marketplace
How do you mix essential oils with carrier oils?
Overzicht reviews voor 2Cheap.nl
Qhc Learning
4Chan Louisville
The Binding of Isaac
2016 Hyundai Sonata Price, Value, Depreciation & Reviews | Kelley Blue Book
OSRS Dryness Calculator - GEGCalculators
Local Collector Buying Old Motorcycles Z1 KZ900 KZ 900 KZ1000 Kawasaki - wanted - by dealer - sale - craigslist
Learn2Serve Tabc Answers
The ULTIMATE 2023 Sedona Vortex Guide
New Stores Coming To Canton Ohio 2022
Pekin Soccer Tournament
Inter-Tech IM-2 Expander/SAMA IM01 Pro
Msu 247 Football
Keurig Refillable Pods Walmart
PowerXL Smokeless Grill- Elektrische Grill - Rookloos & geurloos grillplezier - met... | bol
Finalize Teams Yahoo Fantasy Football
Blue Rain Lubbock
Valic Eremit
Cookie Clicker Advanced Method Unblocked
Soul Eater Resonance Wavelength Tier List
Weathervane Broken Monorail
Combies Overlijden no. 02, Stempels: 2 teksten + 1 tag/label & Stansen: 3 tags/labels.
Stickley Furniture
Dell 22 FHD-Computermonitor – E2222H | Dell Deutschland
Skepticalpickle Leak
Toonkor211
Myaci Benefits Albertsons
Kiddie Jungle Parma
UPC Code Lookup: Free UPC Code Lookup With Major Retailers
Frommer's Belgium, Holland and Luxembourg (Frommer's Complete Guides) - PDF Free Download
Kokomo Mugshots Busted
Wow Quest Encroaching Heat
Craigslist Org Sf
Sinfuldeeds Vietnamese Rmt
Why Holly Gibney Is One of TV's Best Protagonists
The disadvantages of patient portals
Fwpd Activity Log
Tedit Calamity
Birmingham City Schools Clever Login
2Nd Corinthians 5 Nlt
Stosh's Kolaches Photos
White County
Food and Water Safety During Power Outages and Floods
Lagrone Funeral Chapel & Crematory Obituaries
Primary Care in Nashville & Southern KY | Tristar Medical Group
Latest Posts
Article information

Author: Greg Kuvalis

Last Updated:

Views: 5578

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Greg Kuvalis

Birthday: 1996-12-20

Address: 53157 Trantow Inlet, Townemouth, FL 92564-0267

Phone: +68218650356656

Job: IT Representative

Hobby: Knitting, Amateur radio, Skiing, Running, Mountain biking, Slacklining, Electronics

Introduction: My name is Greg Kuvalis, I am a witty, spotless, beautiful, charming, delightful, thankful, beautiful person who loves writing and wants to share my knowledge and understanding with you.