0% found this document useful (0 votes)
17 views24 pages

Partial Differential Equations: Hoang Hai Ha

Uploaded by

dungbeotb17
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)
17 views24 pages

Partial Differential Equations: Hoang Hai Ha

Uploaded by

dungbeotb17
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/ 24

Partial differential equations

Hoang Hai Ha

HCMUT-OISP
Email: [email protected]

Hoang Hai Ha (HCMUT) Partial differential equations 1 / 15


Outline

1 Introduction

2 Numerical methods for solving PDEs

Hoang Hai Ha (HCMUT) Partial differential equations 2 / 15


Definition 1.1
Partial differential equations (PDE) are mathematical equations
that describe relationships between unknown functions with
multiple variables and its partial derivatives.

Hoang Hai Ha (HCMUT) Partial differential equations 3 / 15


Definition 1.1
Partial differential equations (PDE) are mathematical equations
that describe relationships between unknown functions with
multiple variables and its partial derivatives.
The order of a PDE is the highest order of partial derivatives
occurring in the equation.

Partial differential equations arise in the study of some physical


phenomena such as: vibrating strings, mechanics of membrane, rods,
heat flow...

Hoang Hai Ha (HCMUT) Partial differential equations 3 / 15


Some typical examples of PDE

∂ 2u 2
2∂ u
1) = c : one dimensional wave equation.
∂t 2 ∂x 2

We find a function u(x, t) that satisfies this equation, herein, x : the


spatial variable and t : the time .

∂ 2u ∂ 2u ∂ 2u
 
2) 2 = c 2 + : two dimensional wave equation.
∂t ∂x 2 ∂y 2

∂u ∂ 2u
3) = c 2 2 : one dimensional heat equation.
∂t ∂x

Hoang Hai Ha (HCMUT) Partial differential equations 4 / 15


Some typical examples of PDE

∂ 2u ∂ 2u
 
∂u
3) = c2 + : two dimensional heat equation.
∂t ∂x 2 ∂y 2

A solution of this equation is the function u(t, x, y ), where


(x, y ) ∈ Ω ⊂ R2 and t ∈ [0, ∞).

∂ 2u ∂ 2u
4) + = 0: the Laplacian equation.
∂x 2 ∂y 2

∂ψ ℏ2 ∂ 2 ψ
5) iℏ =− + V (x)ψ: one dimensional Schrödinger
∂t 2m ∂x 2
equation.

Hoang Hai Ha (HCMUT) Partial differential equations 5 / 15


Numerical methods for solving PDEs

In this part, we aim to find numerical solutions of a one dimensional


heat equation via the finite difference method. We want to know the
temperature distribution of a uniform bar of length L with an
insulated lateral surface and no internal sources of heat, subject to
certain boundary and initial conditions.

Hoang Hai Ha (HCMUT) Partial differential equations 6 / 15


Let u(x, t) represent the temperature of the point x on the bar and
at the moment t. We consider the problem
∂ 2u 2
2∂ u
= c , 0 < x < L, t ≥ 0, (1)
∂t 2 ∂x 2
satisfying the Dirichlet boundary conditions:

u(0, t) = 0, u(L, t) = 0, for all t ≥ 0 (2)

and the initial condition:

u(x, 0) = f (x), 0 ≤ x ≤ L. (3)

Hoang Hai Ha (HCMUT) Partial differential equations 7 / 15


The finite difference method: an explicit scheme

Creating grids for x and t: we divide [0, L] into N subintervals


L
with the step size h := , the grid points of x are
N
x 0 = 0, x i = ih, x N = L, i = 1, . . . N − 1; the grid points of t
are tj = jk, j = 0, 1 . . ., k is the time step size.

Hoang Hai Ha (HCMUT) Partial differential equations 8 / 15


The finite difference method: an explicit scheme

Creating grids for x and t: we divide [0, L] into N subintervals


L
with the step size h := , the grid points of x are
N
x 0 = 0, x i = ih, x N = L, i = 1, . . . N − 1; the grid points of t
are tj = jk, j = 0, 1 . . ., k is the time step size.
Let u(xi , tj ) ≈ ui,j . We aim to find ui,j .

Hoang Hai Ha (HCMUT) Partial differential equations 8 / 15


The finite difference method: an explicit scheme

Creating grids for x and t: we divide [0, L] into N subintervals


L
with the step size h := , the grid points of x are
N
x 0 = 0, x i = ih, x N = L, i = 1, . . . N − 1; the grid points of t
are tj = jk, j = 0, 1 . . ., k is the time step size.
Let u(xi , tj ) ≈ ui,j . We aim to find ui,j .
∂ 2u
Applying the centered difference formula, is approximated
∂x 2
by:
∂ 2u u (xi + h, tj ) − 2u (xi , tj ) + u (xi − h, tj )
2
(xi , tj ) ≈ , i = 1, . . . N −
∂x h2

Hoang Hai Ha (HCMUT) Partial differential equations 8 / 15


The finite difference method: an explicit scheme
∂u
Applying the forward difference formula, is evaluated by
∂t
∂u u (xi , tj + k) − u (xi , tj )
(xi , tj ) = .
∂t k

Substituting two difference formulas into the equation (1), we


obtain
ui,j+1 − ui,j ui+1,j − 2ui,j + ui−1,j
− c2 = 0. (4)
k h2

Hoang Hai Ha (HCMUT) Partial differential equations 9 / 15


The finite difference method: an explicit scheme
∂u
Applying the forward difference formula, is evaluated by
∂t
∂u u (xi , tj + k) − u (xi , tj )
(xi , tj ) = .
∂t k

Substituting two difference formulas into the equation (1), we


obtain
ui,j+1 − ui,j ui+1,j − 2ui,j + ui−1,j
− c2 = 0. (4)
k h2

2c 2 k
 
k
(4) ⇒ ui,j+1 = 1− 2 ui,j + c 2 (ui+1,j + ui−1,j ).
h h2

Hoang Hai Ha (HCMUT) Partial differential equations 9 / 15


The finite difference method: an explicit scheme
Using the initial condition u(x, 0) = f (x) (see (3)), we have
u0,0 = f (0), u1,0 = f (x1 ), . . . , uN,0 = f (xN ).

Hoang Hai Ha (HCMUT) Partial differential equations 10 / 15


The finite difference method: an explicit scheme
Using the initial condition u(x, 0) = f (x) (see (3)), we have
u0,0 = f (0), u1,0 = f (x1 ), . . . , uN,0 = f (xN ).

Using the boundary conditions u(0, t) = u(L, t) = 0 (see (2)), we


have
⋆ u0,1 = u(0, t1 ) = 0.

Hoang Hai Ha (HCMUT) Partial differential equations 10 / 15


The finite difference method: an explicit scheme
Using the initial condition u(x, 0) = f (x) (see (3)), we have
u0,0 = f (0), u1,0 = f (x1 ), . . . , uN,0 = f (xN ).

Using the boundary conditions u(0, t) = u(L, t) = 0 (see (2)), we


have
⋆ u0,1 = u(0, t1 ) = 0.
2c 2 k
 
k
⋆ u1,1 = 1 − 2 u0,0 + c 2 2 (u2,0 + u0,0 ) .
h h
2
 
2c k k
⋆ u2,1 = 1 − 2 u2,0 + c 2 2 (u3,0 + u1,0 ).
h h
⋆ ...
2c 2 k
 
k
⋆ uN−1,1 = 1 − 2 uN−1,0 + c 2 2 (uN,0 + uN−2,0 ).
h h
Hoang Hai Ha (HCMUT) Partial differential equations 10 / 15
The finite difference method: an explicit scheme
Since the values ui,0 ; (i = 1 . . . N − 1) are known, we can
evaluate ui,1 , (i = 1 . . . N − 1) and so ui,2 , (i = 1 . . . N − 1).
Now, we are going to describe this method by using the matrix form.
c 2k
We denote λ := 2 ;
h
U (0) := (f (x 1) , f (x 2) , . . . , f (x N −1))T ; and
U (j ) := (u 1,j , u 2,j , . . . , u N −1,j )T , j = 1, 2, . . .

Hoang Hai Ha (HCMUT) Partial differential equations 11 / 15


The finite difference method: an explicit scheme
Since the values ui,0 ; (i = 1 . . . N − 1) are known, we can
evaluate ui,1 , (i = 1 . . . N − 1) and so ui,2 , (i = 1 . . . N − 1).
Now, we are going to describe this method by using the matrix form.
c 2k
We denote λ := 2 ;
h
U (0) := (f (x 1) , f (x 2) , . . . , f (x N −1))T ; and
U (j ) := (u 1,j , u 2,j , . . . , u N −1,j )T , j = 1, 2, . . .
Thus we have
U (j ) = AU (j −1),
where A is a tri-diagonal matrix with the form
 
(1 − 2λ) λ 0 ... 0
 λ (1 − 2λ) λ 0 
A= . . .
 
 0 λ .. .. .. .

 .
.. . ..

 λ 
0 0 . . . λ (1 − 2λ)
Hoang Hai Ha (HCMUT) Partial differential equations 11 / 15
The finite difference method: an explicit scheme

Hoang Hai Ha (HCMUT) Partial differential equations 12 / 15


Figure: The value at blue point is evaluated by neighboring values at black points
on the previous time

Hoang Hai Ha (HCMUT) Partial differential equations 13 / 15


The finite difference method: an explicit scheme

Example 2.1
Approximate solutions of
∂u ∂ 2u
(x, t) − 2 (x, t) = 0, 0 < x < 1, 0 ≤ t
∂t ∂x
satisfying
the boundary conditions: u(0, t) = u(1, t) = 0, 0 < t
the initial conditions: u(x, 0) = sin(πx), 0 ≤ x ≤ 1.
Let the step size for x is h = 0.1 and for t is 0.0005. Compare the
2
numerical results with the exact solution: u(x, t) = e −π t sin(πx).

Hoang Hai Ha (HCMUT) Partial differential equations 14 / 15


The finite difference method: an explicit scheme

Example 2.1
Approximate solutions of
∂u ∂ 2u
(x, t) − 2 (x, t) = 0, 0 < x < 1, 0 ≤ t
∂t ∂x
satisfying
the boundary conditions: u(0, t) = u(1, t) = 0, 0 < t
the initial conditions: u(x, 0) = sin(πx), 0 ≤ x ≤ 1.
Let the step size for x is h = 0.1 and for t is 0.0005. Compare the
2
numerical results with the exact solution: u(x, t) = e −π t sin(πx).
k
We have c = 1. Thus λ = c 2 = 0.05 và N = 10.
h2
We approximate the values of solution at t = 0.5.

Hoang Hai Ha (HCMUT) Partial differential equations 14 / 15


The convergence condition

The sequence of values {ui,j } obtained by the explicit scheme


converges to the exact solutions if

λ ≤ 0.5.

Hoang Hai Ha (HCMUT) Partial differential equations 15 / 15


The convergence condition

The sequence of values {ui,j } obtained by the explicit scheme


converges to the exact solutions if

λ ≤ 0.5.

Example 2.2
Consider the above example with k = 0.01.

Hoang Hai Ha (HCMUT) Partial differential equations 15 / 15

You might also like