Nội dung của bài giảng trình bày ba dạng phương trình đạo hàm riêng cơ bản; bài toán Parabolic (mô hình truyền nhiệt); bài toán Parabolic (mô hình truyền nhiệt tổng quát); bài toán Elliptic; xấp xỉ sai phân...
Trang 1Phần 2: mô phỏng máy tính
Modeling, simulation and optimization for chemical process
Instructor: Hoang Ngoc Ha Email: ha.hoang@hcmut.edu.vn
Bộ môn QT&TB
Trang 2Numerical Analysis
Computer Programming
S IMU L AT I O N
Trang 3Computer 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
Trang 4Computer 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)
…
Trang 5Computer simulation
Example:
Trang 6Computer simulation
Trang 7Computer simulation
Trang 8Computer simulation
Interval halving (chia đôi khoảng)
Trang 9Computer simulation
This problem can be formulated under the following form:
The goal is to find the solution of this
nonlinear equations ( in ONE VARIABLE )
Tools (Iterative methods)
Bisection method (phương pháp phân đoạn)
Newton’s (or Newton-Raphson) method
f (x) = 0, x ∈ R
Trang 10Iterative 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 such that f(c) = u c ∈ [a, b]
If f(a) and f(b) are of opposite sign, there exist a number p in [a, b] with f(p)=0
Trang 11Iterative method
Bisection method
Computer programming: Matlab
Trang 12Iterative method
Newton’s method
Numerical solutions of nonlinear systems of equations ( of
SEVERAL VARIABLES )Î (See Ref.)
Trang 13Computer simulation
Interpolation and polynomial approximation
Cubic spline interpolation
Trang 14Numerical intergration of Ordinary
Differential Equations (ODEs)
Trang 15Numerical intergration of Ordinary
Differential Equations (ODEs)
Interpolation
Trang 16Numerical intergration of Ordinary
Differential Equations (ODEs)
Trang 17Numerical intergration of Ordinary
Differential Equations (ODEs)
Euler’s method
Trang 18Numerical intergration of Ordinary
Differential Equations (ODEs)
Euler’s method
Trang 19Numerical intergration of Ordinary
Differential Equations (ODEs)
Trang 20Numerical intergration of Ordinary
Differential Equations (ODEs)
Local truncation error
The local truncation error in Euler’s method is O(h)
Definition
Trang 21Numerical intergration of Ordinary
Differential Equations (ODEs)
Higher-Order Taylor methods
Trang 22Numerical intergration of Ordinary
Differential Equations (ODEs)
Higher-Order Taylor methods
Trang 23Numerical intergration of Ordinary
Differential Equations (ODEs)
Runge-Kutta methods
Trang 24Numerical intergration of Ordinary
Differential Equations (ODEs)
Runge-Kutta methods
Xây dựng công thức tính theo mà không phải đạo hàm « tay », cần xấp xỉ mà không dùng đạo hàm với
Minh họa qua k=2
T (k) O(h k )
f (t, y)
T (2) (t, y) = f (t, y) + h 2 f 0 (t, y)
f 0 (t, y) = f t 0 (t, y) + f y 0 (t, y)y 0 (t)
Trang 25Numerical intergration of Ordinary
Differential Equations (ODEs)
Trang 26Numerical intergration of Ordinary
Differential Equations (ODEs)
Trang 27Numerical intergration of Ordinary
Differential Equations (ODEs)
Sơ đồ trung điểm (R_K bậc 2)
Trang 28Numerical intergration of Ordinary
Differential Equations (ODEs)
Trang 29Numerical intergration of Partial
Differential Equations (PDEs)
Click here
Trang 30Giới thiệu chung
u = u(x , t) một đại lượng vật lý của hệ khảo sát
n chemical species
Inlet material and/or
energetic flux
Outlet material and/or energetic flux
Trang 31Ba dạng phương trình đạo hàm riêng cơ bản
Trang 32Ba dạng phương trình đạo hàm riêng cơ
bản
Phương pháp tìm nghiệm
Phương pháp giải tích
Phương pháp số
Ý tưởng : xấp xỉ sai phân các đạo hàm riêng tại các điểm rời rạc (kg,tg)
và tính giá trị của u = u(x , t) tại đó
u(x, t)
Trang 35BÀI TOÁN ELLIPTIC
Bài toán elliptic với điều kiện biên Dirichlet
(
∆u = ∂ ∂x 2 u 2 + ∂ ∂y 2 u 2 = f (x, y), (x, y) ∈ Ω ⊂ R 2
Trang 36BÀI TOÁN ELLIPTIC
Phân hoạch và tạo lưới : chia nhỏ bởi
Lần lượt thay vào phương trình elliptic, sử
dụng công thức xấp xỉ & điều kiên biên
P k = (x k , y k )
Hệ PTTT ẩn u k = u(P k )
Trang 37BÀI TOÁN ELLIPTIC
Example
Lưới 4 nút ẩn đánh số 4 giá trị cần tìm SD PTSP & Giá trị trên biên Hệ PTTT
Mô phỏng Matlab
Trang 38BÀI TOÁN PARABOLIC (mô hình
truyền nhiệt)
Trang 39BÀI TOÁN PARABOLIC (mô hình
truyền nhiệt)
Trang 41BÀI TOÁN PARABOLIC (mô hình
truyền nhiệt)
Ví dụ
Sơ đồ hiện (s/p tiến) Sơ đồ ẩn (s/p lùi)
Trang 42BÀI TOÁN PARABOLIC (mô hình
truyền nhiệt tổng quát)
Trang 43BÀI TOÁN PARABOLIC (mô hình
truyền nhiệt)
Trang 44BÀI TOÁN PARABOLIC (mô hình
truyền nhiệt)
Trang 45BÀI TOÁN PARABOLIC (mô hình
truyền nhiệt)
Sơ đồ Crank-Nicholson
Trang 46 Part III: Optimization of chemical processes