Professional Documents
Culture Documents
Introduction
Numerical Analysis
Computer Programming
TION
SIMULA
Computer simulation
Some simulation techniques for solving some of the systems of equations
Solution of (nonlinear) algebraic equations Ordinary differential equations (ODEs) Partial differential equations (PDEs)
Numerical methods
Iterative methods Discrete difference methods Femlab, Fortran, Ansys
Matlab/Simulink
Computer simulation
Computer programming
Assume that you know some computer programming language We are not interested in generating the most efficient and elegant code but in solving problems (from point of view of engineers)
Including extensive comment statements Use of symbols (the same ones in the equations describing the systems) Debugging (for mistakes in coding and/or in logic)
Computer simulation
Example:
Computer simulation
Computer simulation
Computer simulation
Interval halving (chia i khong)
Computer simulation
This problem can be formulated under the following form:
f (x) = 0, x R
The goal is to find the solution of this nonlinear equations (in ONE VARIABLE) Tools (Iterative methods)
Bisection method (phng php phn on) Newtons (or Newton-Raphson) method
Iterative method
Intermediate value theorem
If f is a real-valued continuous function on the interval [a, b], and u is a number between f(a) and f(b), then there is a c [a, b] such that f(c) = u
If f(a) and f(b) are of opposite sign, there exist a number p in [a, b] with f(p)=0
Iterative method
Bisection method
Iterative method
Newtons method
Numerical solutions of nonlinear systems of equations (of SEVERAL VARIABLES) (See Ref.)
Computer simulation
Interpolation and polynomial approximation
Interpolation and the Lagrange polynomial Cubic spline interpolation
(See Ref.)
y(tN )
x
t0 t1
tN t
y 0 = y t2 + 1, t [0 2] y(0) = 0.5
P/p Euler n=10? Approximate solution?
Exact solution?
n = 10 h =
ba n
= 0.2
O(h)
(2)
(t, y) = f (t, y) +
h 0 f (t, y) 2 0
f (t, y)
(2)
(t, y) = f (t, y) +
h 0 f (t, y) 2 t
Cn tm a1 , 1 , 1 vi sai s O(h2 )
ng nht hai v
a1 = 1 a1 1 = h 2 a1 1 = h f (t, y) 2
a1 = 1 1 = h 2 h 1 = 2 f (t, y)
S trung im (R_K bc 2)
u = u(x . . . , t)
dV n chemical species P k k Sk = 0
H PHN B
{C, T . . . }
Local observation
+
u t
2u y 2
= f (x, y)
2 2u a x2
2 2u a x2
u(x,t) t
u(x,t+t)u(x,t) t
Xp x sai phn
t (x x, t) (x + x, t) x (x, t) x
2 u(x,t) x2
u(x+x,t)2u(x,t)+u(xx,t) (x)2
Xp x sai phn
y P4 y P1 x P P2
P3 P = (x, y) x
h = x = y
2 u(P ) x2
2 u(P ) y 2
BI TON ELLIPTIC
(
Bi ton elliptic vi iu kin bin Dirichlet
2u x2
2u y 2
BI TON ELLIPTIC
Phn hoch v to li : chia nh bi cc ng thng // vi Ox v Oy
To li bc chia cch u
h = x = y
K hiu P1, P2, P3 v P4 l 4 im ri rc x/q P u(P1 )+u(P2 )+u(P3 )+u(P4 )4u(P ) h2
u(P ) Ln lt thay Pk = (xk , yk ) vo phng trnh elliptic, s H PTTT n uk = u(Pk ) dng cng thc xp x & iu kin bin
BI TON ELLIPTIC
Example
Li 4 nt n
H PTTT
M phng Matlab
Xp x o hm ring cp 1:
u(x,t) t
TIN - LI
S n (s/p li)
Min
= {(x, t)|0 x 1, t 0}
Xp x
u u 2 u , , t x x2
& K bin, u
Gi tr u ti cc im li
Outline
General introduction
Structure and operation of chemical engineering systems What is a chemical process? Motivation examples
Part I: Process modeling Part II: Computer simulation Part III: Optimization of chemical processes