0% found this document useful (0 votes)
7 views8 pages

LEC7

Uploaded by

mohamed mousa
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)
7 views8 pages

LEC7

Uploaded by

mohamed mousa
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/ 8

2/14/2023

Finite Differences Method(FDM)

Overview of FDM:

Step1 Write down DE.


Step2 Decompose domain.
Step3 Approximate derivatives.
Step4 Assemble linear system with FD stencil.
Step5 Solve linear system.
Step6 Visualize and postprocess solution.

Finite Difference Approximation:

In X - direction

1
2/14/2023

Finite Difference Approximation:

In Y - direction

Finite Difference Approximation:

In 2direction

2
2/14/2023

Ordinary Differential Equations (ODE)


Example:
Given the Boundary- Value Problem (BPV)
𝒅𝒚
= −𝟐𝒙𝟑 + 𝟏𝟐𝒙𝟐 − 𝟐𝟎𝒙 + 𝟖. 𝟓
𝒅𝒙
Use The FDM to approximate the solution

The domain:
𝑥 = 𝑎 𝑡𝑜 𝑏 = 0 𝑡𝑜 4 𝑖 = 1,2,3, … … . . 𝑛 (𝑙e𝑡 𝑛 = 4) 𝑏−𝑎 4−0
ℎ= = =1
𝑛 4
𝒃𝒐𝒖𝒏𝒂𝒓𝒚 𝑪𝒐𝒏𝒊𝒕𝒊𝒐𝒏 𝑦 0 = 0 &𝑦 4 = 3

Approximate derivatives:
𝑑𝑦 𝑦𝑖+1 − 𝑦𝑖
= = 𝑓(𝑥𝑖 ) = −2𝑥 3 + 12𝑥 2 − 20𝑥 + 8.5
𝑑𝑥 ℎ
𝑦𝑖+1 − 𝑦𝑖 = 𝑓 𝑥𝑖 ℎ

Ordinary Differential Equations (ODE)


Assemble linear system
𝑦𝑖+1 − 𝑦𝑖 = −2𝑥 3 + 12𝑥 2 − 20𝑥 + 8.5 ℎ

𝑖=0 𝑦1 − 𝑦0 = 𝑓 𝑥0 ℎ = 8.5
𝑖=1 𝑦2 − 𝑦1 = 𝑓 𝑥1 ℎ = −2 ∗ 13 + 12 ∗ 12 − 20 ∗ 1 + 8.5 = −1.5
𝑖=2 𝑦3 − 𝑦2 = 𝑓 𝑥2 ℎ = −2 ∗ 23 + 12 ∗ 22 − 20 ∗ 2 + 8.5 = 0.5
𝑖=3 𝑦4 − 𝑦3 = 𝑓 𝑥3 ℎ = −2 ∗ 33 + 12 ∗ 32 − 20 ∗ 3 + 8.5 = 2.5
𝑖=4 𝑦4 = 3

Solve linear system

3
2/14/2023

Ordinary Differential Equations (ODE)


Example:

4
2/14/2023

5
2/14/2023

Partial Differential Equations (PDE)

Example:

Partial Differential Equations (PDE)

Example:

Using matrix methods

𝒖𝟏 = 𝟐
𝒖𝟐 = 𝟑

𝒖𝟑 = 𝟑

𝒖𝟒 = 𝟒

6
2/14/2023

Partial Differential Equations (PDE)

Example:

7
2/14/2023

Partial Differential Equations (PDE)

Example:

Partial Differential Equations (PDE)

Example:

You might also like