Modelling & Simulation of Chemical Engineering Systems Department of Chemical Engineering King Saud University 501 هعم : تمثيل الأنظمة الهندسية على الحاسب.

Slides:



Advertisements
Similar presentations
Courant and all that Consistency, Convergence Stability Numerical Dispersion Computational grids and numerical anisotropy The goal of this lecture is to.
Advertisements

Boundary Value Problems and Partial Differential Equations (PDEs)
Partial Differential Equations
MATLAB EXAMPLES Initial-value problems
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L8&9 KFUPM.
ORDINARY DIFFERENTIAL EQUATIONS (ODE)
Partial Differential Equations (PDEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE Daniel Baur ETH Zurich, Institut für Chemie-
Ordinary Differential Equations
PART 7 Ordinary Differential Equations ODEs
ECE602 BME I Partial Differential Equations in Biomedical Engineering.
REVIEW. What processes are represented in the governing equation that we use to represent solute transport through porous media? Advection, dispersion,
Part 6 Chapter 22 Boundary-Value Problems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Mech300 Numerical Methods, Hong Kong University of Science and Technology. 1 Part Seven Ordinary Differential Equations.
Lecture 34 - Ordinary Differential Equations - BVP CVEN 302 November 28, 2001.
Modelling & Simulation of Chemical Engineering Systems Department of Chemical Engineering King Saud University 501 هعم : تمثيل الأنظمة الهندسية على الحاسب.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Solve the differential equation. y'' - 10y' + 74y = 0
Solve the differential equation. y'' - 6y' + 45y = 0
Differential Equations and Boundary Value Problems
CISE301_Topic8L1KFUPM1 CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1.
COMPUTATIONAL MODELING FOR ENGINEERING MECN 6040 Professor: Dr. Omar E. Meza Castillo Department.
Numerical Solution of Ordinary Differential Equation
Numerical methods for PDEs PDEs are mathematical models for –Physical Phenomena Heat transfer Wave motion.
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
Lecture 35 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
DIFFERENTIAL EQUATIONS, INTEGRATION, POLYNOMIALS, RANDOM NUMBERS MEKANIKA SOFTWARE SEMINARS.
Finite Differences Finite Difference Approximations  Simple geophysical partial differential equations  Finite differences - definitions  Finite-difference.
Introduction to Numerical Methods for ODEs and PDEs Methods of Approximation Lecture 3: finite differences Lecture 4: finite elements.
1 Tips for solving Project 1 Reactor SO 3 SO 2 +O 2.
Fin500J Topic 6Fall 2010 Olin Business School 1 Fin500J: Mathematical Foundations in Finance Topic 6: Ordinary Differential Equations Philip H. Dybvig.
Analytical vs. Numerical Minimization Each experimental data point, l, has an error, ε l, associated with it ‣ Difference between the experimentally measured.
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 19.
Boundary Value Problems and Least Squares Minimization
Copyleft  2005 by Media Lab Ordinary Differential Equations Boundary Value Problems.
Modelling & Simulation of Chemical Engineering Systems Department of Chemical Engineering King Saud University 501 هعم : تمثيل الأنظمة الهندسية على الحاسب.
Boundary-Value Problems Boundary-value problems are those where conditions are not known at a single point but rather are given at different values of.
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
Modelling & Simulation of Chemical Engineering Systems Department of Chemical Engineering King Saud University 501 هعم : تمثيل الأنظمة الهندسية على الحاسب.
Solution of a Partial Differential Equations using the Method of Lines
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapter 24 Boundary Value Problems.
Mathematical Applications using MATLAB (Cont….)
Akram Bitar and Larry Manevitz Department of Computer Science
Boundary Value Problems l Up to this point we have solved differential equations that have all of their initial conditions specified. l There is another.
Engineering Analysis – Computational Fluid Dynamics –
Engineering Analysis – Computational Fluid Dynamics –
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Finite Deference Method
Recap Cubic Spline Interpolation Multidimensional Interpolation Curve Fitting Linear Regression Polynomial Regression The Polyval Function The Interactive.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 271 Boundary-Value.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 27.
FALL 2015 Esra Sorgüven Öner
The Finite Element Method A self-study course designed for engineering students.
1 Chapter 1 Introduction to Differential Equations 1.1 Introduction The mathematical formulation problems in engineering and science usually leads to equations.
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
© 2016 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 38.
Nonlinear balanced model residualization via neural networks Juergen Hahn.
Computers in Civil Engineering 53:081 Spring 2003 Lecture #10 Pipe Network as a Systems of Non-Linear Equations.
An Introduction to Computational Fluids Dynamics Prapared by: Chudasama Gulambhai H ( ) Azhar Damani ( ) Dave Aman ( )
Ordinary Differential Equations (ODEs). Objectives of Topic  Solve Ordinary Differential Equations (ODEs).  Appreciate the importance of numerical methods.
Math for CS Fourier Transforms
S5.40. Module Structure 30% practical tests / 70% written exam 3h lectures / week (except reading week) 3 x 2h of computer labs (solving problems practicing.
Finite Difference Methods
Boundary-Value Problems
Numerical Solutions of Ordinary Differential Equations
ME/AE 339 Computational Fluid Dynamics K. M. Isaac Topic2_PDE
Chapter 27.
The Finite Element Method
Objective Numerical methods Finite volume.
6th Lecture : Numerical Methods
Akram Bitar and Larry Manevitz Department of Computer Science
Presentation transcript:

Modelling & Simulation of Chemical Engineering Systems Department of Chemical Engineering King Saud University 501 هعم : تمثيل الأنظمة الهندسية على الحاسب الآلى

LECTURE #9 Numerical Solution of Boundary-Value Differential Equations

BVP Examples Diffusion with chemical reaction in a catalyst. Diffusion or condition in a tubular reactor Heat & mass transfer in boundary layer problems. Disecretization of nonlinear PDEs

Initial & Boundary Conditions

Numerical Methods Shooting Method Finite difference method Methods of weight residuals, Collocation method

BVP Formulation Canonical Form Original Form

Shooting Method An initial-value technique Use successive approximation to solve for the missing initial conditions. It can utilize highly efficient initial value procedure. Shooting can be tried from either end of the BVP.

Shooting Method Algorithm Problem: Guess initial condition for y 2 : Integrate the system forward, calculated y 2 at x f is Define the function Solution : Nonlinear function need to be solved for 

Example Solve the boundary-value differential equation: Canonical Form: T'=z; z'=0.01(T-20)^1.4; T(0)=200; T(10)=40 Convert the BVP into IVP: T'=z; z'=0.01(T-20)^1.4; T(0)=200; z(0)= 

MATLAB Code % Shooting Method for BVP % dT^2/dx2=0.01(T-20)^1.4 % T(0)=200, T(10)=40 % % Canonical Form: T'=z; z'=0.01(T-20)^1.4; %T(0)=200; z(0)=g1 g0=20; t0=200; y2f_exact=40 tspan=[0 10]'; g=g0 xx0=[t0 g]'; [x,y]=ode23('bvp1', tspan, xx0); z=size(y) y1f_g=y(z(1),1); delta_g=0.1 delta_y2=1.0 while delta_y2 >= g=g+delta_g x0=[t0 g]'; yold=y1f_g [x,y]=ode45('bvp1', tspan, x0); z=size(y) y1f_g=y(z(1),1) delta_y2=y1f_g-y2f_exact dif_y2=y1f_g-yold Der_y2_g=dif_y2/delta_g delta_g=-delta_y2/Der_y2_g end g plot(x,y(:,2),x,y(:,1))

Finite Difference Method Replace the derivative with finite difference approximation ODEs become algebraic equations Forward Backward Central Example:

Example of FD method c(0)=c(0.25)=0.546, c(0.5)=0.615, c(0.75)=0.760, c(1)=1 Let h=0.25 h

Example: solve the BVP using FD technique function f=bvp_fd(t) f(1)=t(2)-2*t(1) *(t(1)-20)^1.4; for n=2:8 f(n)=t(n+1)-2*t(n)+t(n-1)-0.01*(t(n)-20)^1.4; end f(9)=40-2*t(9)+t(8)-0.01*(t(9)-20)^1.4; h=1 % Finite differnce method for solving %nonlinear BVP % Initial conditions % nine nodes to=[ ] xx=[ ]' t=fsolve('bvp_fd',to)

MATLAB command BVP4C Solve two-point boundary value problems for ODEs by collocation. SOL = BVP4C(ODEFUN,BCFUN,SOLINIT) integrates a system of ordinary differential equations of the form y' = f(x,y) on the interval [a,b], Example solinit = bvpinit([ ],[1 0]); sol = solve a BVP on the interval [0,4] with differential equations and boundary conditions computed by functions twoode and twobc, respectively. This example uses [ ] as an initial mesh, and [1 0] as an initial approximation of the solution components at the mesh points. xint = linspace(0,4); yint = deval(sol,xint); evaluate the solution at 100 equally spaced points in [0 4]. The first component of the solution is then plotted with plot(xint,yint(1,:));

function dydx = ge501pvb(x,y) dydx = [ y(2); 0.01*(y(1)-20)^1.4 ]; function res = ge501_bc(ya,yb) res = [ ya(1)-200; yb(1)-40 ]; solin=bvpinit([ ],[50 50]); xint=linspace(0,10); yint=deval(sol,xint); plot(xint,yint(1,:))

HW Solve the problem of flow of a Newtonian flow fluid in a pipe described by the equation: Compare the solutions obtained using the shooting method, finite difference and MATLAB bvp4c solver