Académique Documents
Professionnel Documents
Culture Documents
EXAMPLE 2
Consider Poissons equation
2u 2u
( x , y ) ( x , y ) xe y
, 0 x 2, 0 y 1
x 2
y 2
Tolerance = 10-10
1
Poisson Equation Finite-Difference
Main function
2
Poisson Equation Finite-Difference
3
Poisson Equation Finite-Difference
Result
4
Poisson Equation Finite-Difference
Integers m=5, n=6
5
Poisson Equation Finite-Difference
EXERCISE
Consider Poissons equation
2u 2u
( x , y ) ( x , y ) ( x 2
y 2
) e xy
, 0 x 2, 0 y 1
x 2 y 2
The boundary conditions
u (0, y ) 1, u (2, y ) e 2 y , 0 y 1
u ( x, 0) 1, u ( x, 1) e x , 0 x 2
Tolerance = 10-10
6
Poisson Equation Finite-Difference
Result
7
Heat Equation Backward-Difference
EXAMPLE 2
Backward-Difference method with h=0.1 and k=0.01
u 2u
( x, t ) 2 ( x, t ) 0, 0 x 1, 0 t
t x
Subject to the constrains
8
Heat Equation Backward-Difference
Main function
9
Heat Equation Backward-Difference
Result
Integers m=10, n=50
10
Crank-Nicolson Method
Main function
11
Crank-Nicolson Method
Result
12
Wave Equation Finite-Difference
EXAMPLE
Consider the hyperbolic problem
2u 2u
( x, t ) 4 2 ( x, t ) 0, 0 x 1, 0 t
t 2
x
boundary conditions
u (0, t ) u (1, t ) 0, 0 t
Initial conditions
u
u ( x, 0) sin x, 0 x 1, and ( x, 0) 0, 0 x 1
Easily verified that the solution to this
t problem
u ( x, t ) sin x cos 2t
Endpoint l=1
Maximum time T=1
Constant a=2
Integers m=10, N=20
13
Wave Equation Finite-Difference
Main function
14
Wave Equation Finite-Difference
Result
15
Wave Equation Finite-Difference
EXERCISE
Consider the hyperbolic problem
2u 2u
( x, t ) 2 ( x, t ) 0, 0 x 1, 0 t
t 2
x
boundary conditions
u (0, t ) u (1, t ) 0, 0 t
Initial conditions
u
u ( x, 0) sin x, 0 x 1, and ( x, 0) 0, 0 x 1
Easily verified that the solution to this
t problem
u ( x, t ) cos t sin x
Endpoint l=1
Maximum time T=1
Constant a=1
Integers m=4, N=4
16
Wave Equation Finite-Difference
Result
17
Finite-Element
EXAMPLE
Consider the problem
2u 2u
( x, y ) 2 ( x, y ) 0
x 2
y
boundary conditions
u ( x, y ) 4, for ( x, y ) L6 and ( x, y ) L7
u
( x, y ) x, for ( x, y ) L2 and ( x, y ) L4
n
u
( x, y ) y, for ( x, y ) L5
n
u x y
( x, y ) , for ( x, y ) L1 and ( x, y ) L3
n 2
Actual solution to the boundary-value problem
u ( x, y ) xy 4
18
Finite-Element
Main function
19
Finite-Element
20
Finite-Element
21
Finite-Element
22
Finite-Element
Result
23