0% found this document useful (0 votes)
6 views20 pages

Differential Equations week 11

The document discusses differential equations and their applications, focusing on the Laplace transform and Euler's method for numerical solutions. It provides examples of solving differential equations both analytically and using Euler's method, including error calculations for approximations. The document also outlines the process of applying Euler's method to specific differential equations with detailed calculations.

Uploaded by

samerelking3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views20 pages

Differential Equations week 11

The document discusses differential equations and their applications, focusing on the Laplace transform and Euler's method for numerical solutions. It provides examples of solving differential equations both analytically and using Euler's method, including error calculations for approximations. The document also outlines the process of applying Euler's method to specific differential equations with detailed calculations.

Uploaded by

samerelking3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Differential

Equations and
Applications

Lecture 11

1
The Laplace transform of a unit step:

1 𝑡≥0
𝑢 𝑡 =ቊ
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

In particular, if we let f(t) = u(t) and take the Laplace



𝐿𝑢 𝑡 = න 1 𝑒 −𝑠𝑡 𝑑𝑡
0

1 −𝑠𝑡 1
𝑒 =
𝑠 𝑠

Notes:-
𝑓 𝑡 𝑢 𝑡 =𝑓 𝑡 f(t) u(t)
𝑓 𝑡 𝑢 𝑡 − 𝑡0 = 𝑓(𝑡 − 𝑡0 )

𝑳 𝒇 𝒕 − 𝒕𝟎 = 𝑭(𝒔)𝒆−𝒕𝟎 𝒔 0 t0
3
NU, MATH 203, A. G. Radwan 4
Example:

5
6
7
Part 2
NUMERICAL METHOD

8
NUMERICAL METHOD
Euler’s Method

9
A NUMERICAL METHOD
Euler’s Method
Euler’s Method
Is the simplest method in find approximate solutions to first order equations
𝑦 ′ = 𝑓 𝑥, 𝑦 , 𝑦(𝑥0 )=𝑦0

𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )
At n=0

𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 )
At n=1

𝑦2 = 𝑦1 + ℎ𝑓 𝑥1 , 𝑦1
At n=2

𝑦3 = 𝑦2 + ℎ𝑓(𝑥2 , 𝑦2 )
Q1) Solve 𝒚′=𝒚 − 𝒚𝒆𝒙 , 𝒚 (𝟎) = 1 analytically then use Euler method
to obtain an approximation of 𝒚 (0.5) with 𝒉 = 𝟎.𝟏 and their errors.
Solution
Analytical Solution:- By separation
𝒅𝒚
= 𝒚 𝟏 − 𝒆𝒙
𝒅𝒙
𝒅𝒚
‫ 𝟏 ׬ = 𝒚 ׬‬− 𝒆𝒙 𝒅𝒙
𝒍𝒏𝒚 = 𝒙 − 𝒆𝒙 + 𝑪
At x=0, y=1 C=1

𝒙−𝒆 𝒙 +𝟏
𝒚= 𝒆
𝒙−𝒆 𝒙 +𝟏
𝒚= 𝒆
𝑦0 = 1

0.4 𝑥𝑓 = 0.5
𝑥0 = 0 0.1 0.2 0.3

• 𝒚𝟎 = 𝟏
𝟎.𝟏−𝒆𝟎.𝟏 +𝟏
• 𝒚𝟏 = 𝒆 = 𝟎. 𝟗𝟗𝟒𝟖𝟒
𝟎.𝟐−𝒆𝟎.𝟐 +𝟏
• 𝒚𝟐 = 𝒆 = 𝟎. 𝟗𝟕𝟖𝟖
𝟎.𝟑−𝒆𝟎.𝟑 +𝟏
• 𝒚𝟑 = 𝒆 = 𝟎. 𝟗𝟓𝟏𝟑
𝟎.𝟒−𝒆𝟎.𝟒 +𝟏
• 𝒚𝟒 = 𝒆 = 𝟎. 𝟗𝟏𝟐𝟐𝟔
𝟎.𝟓−𝒆𝟎.𝟓 +𝟏
• 𝒚𝟓 = 𝒆 = 𝟎. 𝟖𝟔𝟏𝟖
Numerical Solution: Euler method
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉 𝒇 𝒙𝒏 , 𝒚𝒏 = 𝒚𝒏 + 𝒉(𝒚𝒏 − 𝒚𝒏 𝒆𝒙𝒏 )
𝑦0 = 1 𝑦1 = 1 𝑦2 = 0.9894 𝑦3 = 0.96749 𝑦4 = 0.93364 𝑦5 = 0.88772

𝑥0 = 0 𝑥2 = 0.2 𝑥3 = 0.3 𝑥4 = 0.4 𝑥5 = 0.5


𝑥1 = 0.1
𝒚𝟎 = 𝟏

𝒚𝟏 = 𝟏 + 𝟎. 𝟏 ∗ (𝟏 − 𝒆𝟎 ) = 𝟏

𝒚𝟐 = 𝟏 + 𝟎. 𝟏 ∗ (𝟏 − 𝒆𝟎.𝟏 ) = 𝟎. 𝟗𝟖𝟗𝟒

𝒚𝟑 = 𝟎. 𝟗𝟖𝟗𝟒 + 𝟎. 𝟏 ∗ (𝟎. 𝟗𝟖𝟗𝟒 − 𝟎. 𝟗𝟖𝟗𝟒 𝒆𝟎.𝟐 ) = 𝟎. 𝟗𝟔𝟕𝟒𝟗

𝒚𝟒 = 𝟎. 𝟗𝟔𝟕𝟒𝟗 + 𝟎. 𝟏 ∗ (𝟎. 𝟗𝟔𝟕𝟒𝟗 − 𝟎. 𝟗𝟔𝟕𝟒𝟗 𝒆𝟎.𝟑 ) = 𝟎. 𝟗𝟑𝟑𝟔𝟒

𝒚𝟓 = 𝟎. 𝟗𝟑𝟑𝟔𝟒 + 𝟎. 𝟏 ∗ (𝟎. 𝟗𝟑𝟑𝟔𝟒 − 𝟎. 𝟗𝟑𝟑𝟔𝟒 𝒆𝟎.𝟒 ) = 𝟎. 𝟖𝟖𝟕𝟕𝟐


Analytical Solution Numerical Solution
• 𝒚𝟎 = 𝟏 𝒚𝟎 = 𝟏
𝒚𝟏 = 𝟏
• 𝒚𝟏 = 𝟎. 𝟗𝟗𝟒𝟖𝟒 𝒚𝟐 = 𝟎. 𝟗𝟖𝟗𝟒
• 𝒚𝟐 = 𝟎. 𝟗𝟕𝟖𝟖 𝒚𝟑 = 𝟎. 𝟗𝟔𝟕𝟒𝟗
• 𝒚𝟑 = 𝟎. 𝟗𝟓𝟏𝟑 𝒚𝟒 = 𝟎. 𝟗𝟑𝟑𝟔𝟒
𝒚𝟓 = 𝟎. 𝟖𝟖𝟕𝟕𝟐
• 𝒚𝟒 = 𝟎. 𝟗𝟏𝟐𝟐𝟔
• 𝒚𝟓 = 𝟎. 𝟖𝟔𝟏𝟖

• Error (at 𝑥 = 0.1) = 1- 0.99484 = 5.16 × 10−3


• Error (at 𝑥 = 0.2) = 0.9894-0.9788 = 0.0106
Example 2:-
solve 𝒚′ = 𝒙𝒚 + 𝒚, 𝒚 𝟎 = 𝟐 analytically then get the
first two steps using Euler method with 𝒉 = 𝟎. 𝟎𝟏 and
their errors.
Example:- solve 𝒚′ = 𝒙𝒚 + 𝒚, 𝒚 𝟎 = 𝟐 analytically then get the first two steps
using Euler method with 𝒉 = 𝟎. 𝟎𝟏 and their errors.
Analytical Solution:- By separation 𝒚′ = 𝒚 𝒙 + 𝟏
𝑑𝑦
= 𝑥 + 1 𝑑𝑥
𝑦
𝑥2
𝑙𝑛𝑦 = + 𝑥 + 𝑐
2

𝑥2 𝑥2
+𝑥+𝑐 +𝑥
𝑦=𝑒 2 = 𝑐1 𝑒 2

at 𝑥 = 0, 𝑦 = 2 then 𝑐1 = 2
𝒙𝟐
𝒚(𝒙) = 𝟐𝒆 𝟐 +𝒙
Euler Method:-
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓 𝑥𝑛 , 𝑦𝑛 = 𝑦𝑛 + ℎ 𝑦𝑛 𝑥𝑛 + 1

n = 0 (𝑓𝑖𝑟𝑠𝑡 𝑠𝑡𝑒𝑝): ➔ 𝑥0 = 0, 𝑦0 = 2
𝑦1 = 𝑦 0.01 = 2 + 0.01(2 0 + 1 ) = 2.02

n = 1 𝑠𝑒𝑐𝑜𝑛𝑑 𝑠𝑡𝑒𝑝 : ➔ 𝑥1 = 0.01, 𝑦1 = 2.02


𝑦2 = 𝑦 0.02 = 2.02 + 0.01(2.02 0.01 + 1 ) = 2.040402

Error(at 𝑥 = 0.01)=2𝑒 0.01005 − 2.02 = 2.0134 × 10−4


Error(at 𝑥 = 0.02)=2𝑒 0.0202 − 2.040402 = 3.908 × 10−4

17
Example 3:-
Find approximate to 𝑥 1 𝑖𝑓 𝑥 ′ (𝑡) = 𝑡 2 − 𝑒 𝑥 sin 𝑡 through the interval [0, 1] that divided to equally
four steps starting with x(0)=1.
𝑥1 𝑥2 𝑥3 𝑥4
𝑥0 = 1

1 2 3 4
𝒕𝟎 = 𝟎 𝒕𝒇 =
1
1−0
h= 4
= 0.25
𝑥𝑛+1 = 𝑥𝑛 + ℎ 𝑓 𝑥𝑛 , 𝑡𝑛

𝑥𝑛+1 = 𝑥𝑛 + ℎ 𝑡𝑛2 − 𝑒 𝑥𝑛 sin(𝑡𝑛 )

➔𝑥0 = 1, 𝑡0 = 0
➔ 𝑥1 = 1 + 0.25 02 − 𝑒 1 0 = 1
➔ 𝑥2 = 1 + 0.25 0.252 − 𝑒 1 sin(0.25) = 0.8475
➔ 𝑥3 = 0.6303
➔ 𝑥4 = 0.4508

18
19
Example 4:- try to solve

20

You might also like