Programming and Computation in Physics - FTCS Method
Programming and Computation in Physics - FTCS Method
Programming and Computation in Physics - FTCS Method
FTCS Method
Syeilendra Pramuditya
Physics Program
Institut Teknologi Bandung
1
2
Grid-based Computation
Euler-type Methods
Differential equations
Temporal domain (variation in time)
Initial conditions
Finite Difference Methods
Differential equations
Spatial domain (variation in space)
Dirichlet boundary conditions: value of solution
at boundaries
Von Neumann boundary conditions: derivative
of solution at boundaries
3
Fick’s Law
dt General PDE:
T j
n 1
T 2 T jn1 2T jn T jn1
j
n
dx T (r , t )
2T (r , t )
t
9
Explicit FTCS Method
Boundary conditions
10
Explicit FTCS Method
11
Explicit FTCS Method
12
Explicit FTCS Method
Calculation parameters
T initial = 0 C
T left = 400 C
T right = 0 C
Sigma = 1 m2/sec
dx = 1 m
jbar = 50
dt = 0.1 sec
13
Explicit FTCS Method
Results
14
Explicit FTCS Method
Results
15
Explicit FTCS Method
You can make the code now, yes?
16
Newton Method
Bisection Method
Secant Method
Regula-Falsi Method
And many many more..
22
Root Finding by Newton Method
Taylor Series
f (a)( x a) f (a)( x a) 2 f (a)( x a )3
f ( x) f (a)
1! 2! 3!
f (a)
xa
f (a)
f ( xold )
xnew xold
f ( xold )
23
Implicit FTCS Method
24
Implicit FTCS Method
25
Implicit FTCS Method
Result
dt
T jn 1 T jn
dx 2
T j
n
1 2T j
n
T j
n
1
dt
2
10
dx
Numerically stable!
26
Implicit FTCS Method
Analytic solution
27
Implicit FTCS Method
You can make the code now, yes?