Euler method is a numerical technique used to approximate solutions to ordinary differential equations (ODEs). It is particularly useful when exact solutions are difficult or impossible to find. The method is named after the Swiss mathematician Leonhard Euler, who developed it in the 18th century.
In this article, we will understand what Euler’s method is, and solve problems related to it.
What is Euler’s Method?The Euler method is a fundamental numerical technique used for approximating solutions to ordinary differential equations (ODEs). It is one of the simplest and oldest methods for solving initial value problems where an exact analytical solution might be difficult or impossible.
The Euler method provides an iterative process to approximate the solution of a first-order ODE of the form:
[Tex]\frac{dy}{dt} = f(t, y)[/Tex]
with an initial condition y(t0) = y0.
Example of Euler methodConsider the differential equation:
[Tex]\frac{dy}{dt} = y[/Tex]
with the initial condition:
y(0)=1
We want to approximate the solution at t=0.2 using the Euler method with a step size h=0.1.
yn+1 = yn+h⋅f(tn,yn)
where:
- yn+1is the approximated value of y at tn+1,
- yn is the value of y at tnt_ntn,
- h is the step size,
- [Tex]f(t_n, y_n)[/Tex] is the derivative [Tex]\frac{dy}{dt}[/Tex] evaluated at [Tex](t_n, y_n)[/Tex].
Step Size: The step size h determines the increment in ttt for each step and is typically chosen based on desired accuracy and stability.
For a system of ODEs, such as:[Tex]\frac{dx}{dt} = f(t, x, y)[/Tex]
[Tex]\frac{dy}{dt} = g(t, x, y)[/Tex]
The Euler method is applied to each equation individually:
[Tex]x_{n+1} = x_n + h \cdot f(t_n, x_n, y_n)[/Tex]
[Tex]y_{n+1} = y_n + h \cdot g(t_n, x_n, y_n)[/Tex]Euler’s
General StepsThe general steps include:
- Initialisation: Set t0, y0, and choose a step size h.
- Iteration: For each step n from 0 to N−1 (where tN=t0+N⋅h)
[Tex]=t_{n+1} = t_n + h[/Tex]
[Tex]=y_{n+1} = y_n + h \cdot f(t_n, y_n)[/Tex]
3. Error Analysis: Note that the Euler method introduces truncation errors, and its accuracy depends on the step size hhh. Smaller hhh generally results in more accurate results but requires more computations.
Eulers Method: Practice Problems with solutionsP1. ODE: [Tex]\frac{dy}{dt} = y – t^2 + 1[/Tex]
Initial Condition: y(0)=0.5
Step Size (h): 0.2
Solution:
Calculate the value at t=0.2:
[Tex]y_{n+1} = y_n + h \cdot f(t_n, y_n)[/Tex]
Where [Tex]f(t,y) = y – t^2 + 1[/Tex]. For t0=0 and y0=0.5:
f(0,0.5)=0.5−02+1=1.5
So,
[Tex]y_1 = y_0 + h \cdot f(0, 0.5) = 0.5 + 0.2 \cdot 1.5 = 0.5 + 0.3 = 0.8[/Tex]
Thus,[Tex] y(0.2) \approx 0.8[/Tex].
Calculate the value at t=0.4:
For t1=0.2 and y1=0.8:
f(0.2,0.8)=0.8−0.22+1=0.8−0.04+1=1.76
[Tex]y_2 = y_1 + h \cdot f(0.2, 0.8) = 0.8 + 0.2 \cdot 1.76 = 0.8 + 0.352 = 1.152[/Tex]
Thus, [Tex]y(0.4) \approx 1.152[/Tex].
P2. ODE: [Tex]\frac{dy}{dt} = y \cdot \sin(t)[/Tex]
Initial Condition: y(0)=1
Step Size (h): 0.1
Solution:
Calculate the value at t=0.1:
For t0=0 and y0=1:
[Tex]f(0,1)= \cdot \sin(0) = 0[/Tex]
[Tex]y_1 = y_0 + h \cdot f(0, 1) = 1 + 0.1 \cdot 0 = 1[/Tex]
Thus, [Tex]y(0.1) \approx 1[/Tex].
Calculate the value at t=0.2:
For t1=0.1 and y1=1:
[Tex]f(0.1, 1) = 1 \cdot \sin(0.1) \approx 0.0998[/Tex]
[Tex]y_2 = y_1 + h \cdot f(0.1, 1) = 1 + 0.1 \cdot 0.0998 \approx 1 + 0.00998 = 1.00998[/Tex]
Thus, [Tex]y(0.2) \approx 1.00998[/Tex].
P3. ODE: [Tex]\frac{dy}{dt} = t – y[/Tex]
Initial Condition: y(1)=2
Step Size (h): 0.5
Solution:
Calculate the value at t=1.5:
For t0=1 and y0=2:
f(1,2)=1−2=−1
[Tex]y_1 = y_0 + h \cdot f(1, 2) = 2 + 0.5 \cdot (-1) = 2 – 0.5 = 1.5[/Tex]
Thus, [Tex]y(1.5) \approx 1.5[/Tex].
Calculate the value at t=2.0:
For t1=1.5 and y1=1.5:
f(1.5, 1.5) = 1.5 – 1.5 = 0
[Tex]y_2 = y_1 + h \cdot f(1.5, 1.5) = 1.5 + 0.5 \cdot 0 = 1.5[/Tex]
Thus,[Tex]y(2.0) \approx 1.5[/Tex].
P4. ODE: [Tex]\frac{dy}{dt} = e^t – y[/Tex]
Initial Condition: y(0)=0
Step Size (h): 0.2
Solution:
Calculate the value at t=0.2:
For t0=0 and y0=0:
f(0, 0) = e0 – 0 = 1
[Tex]y_1 = y_0 + h \cdot f(0, 0) = 0 + 0.2 \cdot 1 = 0.2[/Tex]
Thus, [Tex]y(0.2) \approx 0.2[/Tex].
Calculate the value at t=0.4:
For t1=0.2 and y1=0.2:
[Tex]f(0.2, 0.2) = e^{0.2} – 0.2 \approx 1.2214 – 0.2 = 1.0214[/Tex]
[Tex]y_2 = y_1 + h \cdot f(0.2, 0.2) = 0.2 + 0.2 \cdot 1.0214 = 0.2 + 0.20428 = 0.40428
[/Tex]
Thus, [Tex]y(0.4) \approx 0.40428[/Tex].
P5. ODE: [Tex]\frac{dy}{dt} = t^2 – y^2[/Tex]
Initial Condition: y(0)=1
Step Size (h): 0.1
Solution:
Calculate the value at t=0.1:
For t0=0 and y0=1:
[Tex]f(0, 1) = 0^2 – 1^2 = -1
[/Tex]
[Tex]y_1 = y_0 + h \cdot f(0, 1) = 1 + 0.1 \cdot (-1) = 1 – 0.1 = 0.9
[/Tex]
Thus, [Tex]y(0.1) \approx 0.9[/Tex].
Calculate the value at t=0.2:
For t1=0.1 and y1=0.9:
f(0.1, 0.9) = 0.12 – 0.92 = 0.01 – 0.81 = -0.8
[Tex]y_2 = y_1 + h \cdot f(0.1, 0.9) = 0.9 + 0.1 \cdot (-0.8) = 0.9 – 0.08 = 0.82
[/Tex]
Thus, [Tex]y(0.2) \approx 0.82[/Tex].
P6. ODE: \frac{dy}{dt} = 2t – y
Initial Condition: y(0)=1
Step Size (h): 0.1
Solution:
Calculate the value at t=0.1:
For t0=0 and y0=1:
[Tex]f(0, 1) = 2 \cdot 0 – 1 = -1[/Tex]
[Tex]y_1 = y_0 + h \cdot f(0, 1) = 1 + 0.1 \cdot (-1) = 1 – 0.1 = 0.9
[/Tex]
Thus, [Tex]y(0.1) \approx 0.9[/Tex].
Calculate the value at t=0.2:
For t1=0.1 and y1=0.9:
[Tex]f(0.1, 0.9) = 2 \cdot 0.1 – 0.9 = 0.2 – 0.9 = -0.7
[/Tex][Tex]y_2 = y_1 + h \cdot f(0.1, 0.9) = 0.9 + 0.1 \cdot (-0.7) = 0.9 – 0.07 = 0.83
[/Tex]Thus, [Tex]y(0.2) \approx 0.83[/Tex].
P7. ODE: [Tex]\frac{dy}{dt} = -3y + 4t[/Tex]
Initial Condition: y(0)=2
Step Size (h): 0.2
Solution:
Calculate the value at t=0.2:
For t0=0 and y0=2:
[Tex]f(0, 2) = -3 \cdot 2 + 4 \cdot 0 = -6
[/Tex]
[Tex]y_1 = y_0 + h \cdot f(0, 2) = 2 + 0.2 \cdot (-6) = 2 – 1.2 = 0.8
[/Tex]
Thus, [Tex]y(0.2) \approx 0.8[/Tex].
Calculate the value at t=0.4:
For t1=0.2 and y1=0.8:
[Tex]f(0.2, 0.8) = -3 \cdot 0.8 + 4 \cdot 0.2 = -2.4 + 0.8 = -1.6
[/Tex]
[Tex]y_2 = y_1 + h \cdot f(0.2, 0.8) = 0.8 + 0.2 \cdot (-1.6) = 0.8 – 0.32 = 0.48
[/Tex]
Thus, [Tex]y(0.4) \approx 0.48[/Tex].
P8. ODE: [Tex]\frac{dy}{dt} = t^2 + y[/Tex]
Initial Condition: y(1)=0
Step Size (h): 0.5
Solution:
Calculate the value at t=1.5:
For t0=1 and y0=0:
f(1, 0) = 12 + 0 = 1
[Tex]y_1 = y_0 + h \cdot f(1, 0) = 0 + 0.5 \cdot 1 = 0.5[/Tex]
Thus, [Tex]y(1.5) \approx 0.5[/Tex].
Calculate the value at t=2.0:
For t1=1.5 and y1=0.5:
f(1.5, 0.5) = 1.52 + 0.5 = 2.25 + 0.5 = 2.75
[Tex]y_2 = y_1 + h \cdot f(1.5, 0.5) = 0.5 + 0.5 \cdot 2.75 = 0.5 + 1.375 = 1.875[/Tex]
Thus, [Tex]y(2.0) \approx 1.875[/Tex].
P9. ODE:[Tex] \frac{dy}{dt} = \cos(t) – y[/Tex]
Initial Condition: y(0)=0
Step Size (h): 0.1
Solution:
Calculate the value at t=0.1:
For t0=0 and y0=0:
f(0,0)=cos(0)−0=1
[Tex]y_1 = y_0 + h \cdot f(0, 0) = 0 + 0.1 \cdot 1 = 0.1[/Tex]
Thus,[Tex] y(0.1) \approx 0.1[/Tex].
Calculate the value at t=0.2:
For t1=0.1 and y1=0.1:
[Tex]f(0.1, 0.1) = \cos(0.1) – 0.1 \approx 0.995 – 0.1 = 0.895[/Tex]
[Tex]y_2 = y_1 + h \cdot f(0.1, 0.1) = 0.1 + 0.1 \cdot 0.895 = 0.1 + 0.0895 = 0.1895[/Tex]
Thus, [Tex]y(0.2) \approx 0.1895[/Tex].
P10. ODE: \frac{dy}{dt} = -y^2 + t[Tex]\frac{dy}{dt} = -y^2 + t[/Tex]
Initial Condition: y(0)=2
Step Size (h): 0.3
Solution:
Calculate the value at t=0.3t = 0.3t=0.3:
For t0=0 and y0=2:
f(0, 2) = -22 + 0 = -4
[Tex]y_1 = y_0 + h \cdot f(0, 2) = 2 + 0.3 \cdot (-4) = 2 – 1.2 = 0.8[/Tex]
Thus, [Tex]y(0.3) \approx 0.8[/Tex].
Calculate the value at t=0.6:
For t1=0.3 and y1=0.8:
f(0.3, 0.8) = -0.82 + 0.3 = -0.64 + 0.3 = -0.34
Read More,
Eulers Method Practice QuestionsQ1. Use the Euler method with a step size of h=0.1 to approximate the solution of the initial value problem [Tex]\frac{dy}{dt} = y[/Tex], y(0)=1 at t=0.2.
Q2. Use the Euler method to approximate the solution of [Tex]\frac{d^2y}{dt^2} = -y[/Tex] with initial conditions y(0)=1 and [Tex]\frac{dy}{dt}(0) = 0[/Tex] at t=0.1, using h=0.01.
Q3. Approximate the solution of [Tex]\frac{dy}{dt} = y^2[/Tex], y(0)=1 at t=0.1 using the Euler method with h=0.05.
Q4. Use the Euler method to solve the system:
[Tex]\frac{dx}{dt} = x – y[/Tex]
[Tex]\frac{dy}{dt} = x + y[/Tex]
with initial conditions x(0)=1, y(0)=0, and h=0.1 at t=0.2.
Q5. Approximate the solution of [Tex]\frac{dy}{dt} = t – y[/Tex], y(0)=0 at t=0.2 using h=0.1.
Q6. ODE: [Tex]\frac{dy}{dt} = 3t – y[/Tex]
Initial Condition: y(0)=1
Step Size (h): 0.1
Q7. ODE:[Tex] \frac{dy}{dt} = \cos(t) – y[/Tex]
Initial Condition: y(0)=1
Step Size (h): 0.1
Q8. ODE: [Tex]\frac{dy}{dt} = y \cdot \sin(t)[/Tex]
Initial Condition: y(0)=2
Step Size (h): 0.3
Q9. ODE: [Tex]\frac{dy}{dt} = y \cdot \sin(t)[/Tex]
Initial Condition: y(0)=0
Step Size (h): 0.01
Q10. ODE:[Tex] \frac{dy}{dt} = \cos(t) – y[/Tex]
Initial Condition: y(0)=2
Step Size (h): 0.3
Frequently Asked QuestionsEuler’s formula expresses a deep relationship between trigonometric functions and the complex exponential function. Specifically, it shows how complex exponentials can be written in terms of sine and cosine functions.
Euler’s formula is used in various fields including:
- Complex Analysis: It provides a connection between exponential and trigonometric functions.
- Electrical Engineering: It simplifies the analysis of AC circuits and signal processing.
- Signal Processing: It is used in Fourier transforms to analyze frequencies.
- Quantum Mechanics: It helps in solving problems involving wave functions and oscillations.
Euler’s formula provides a way to represent complex numbers in polar form. A complex number z can be written as: z=reiθ where r is the magnitude of the complex number and θ is the argument (angle) of the complex number.
On the unit circle in the complex plane, any point can be represented as eix, where x is the angle between the positive real axis and the line connecting the origin to the point. This is because cos(x) and sin(x) represent the x and y coordinates of the point on the unit circle.
Yes, Euler’s formula is valid for all real numbers x. It also extends to complex numbers when x is complex.
Geometrically, Euler’s formula describes a rotation in the complex plane. For a given angle x, eix represents a point on the unit circle at an angle x from the positive real axis.
|