Solution of a System of ODEs with POLYMATH and MATLAB, Boundary Value Iterations with MATLAB For a system of n simultaneous first-order ODEs: where x is.

Slides:



Advertisements
Similar presentations
Partial Differential Equations
Advertisements

Numerical Solution of Nonlinear Equations
Lect.3 Modeling in The Time Domain Basil Hamed
Prof. R. Shanthini 05 March CP302 Separation Process Principles Mass Transfer - Set 3.
HW/Tutorial Week #10 WWWR Chapters 27, ID Chapter 14 Tutorial #10 WWWR # 27.6 & To be discussed on March 31, By either volunteer or class list.
Dept of Chemical and Biomolecular Engineering CN2125E Heat and Mass Transfer Dr. Tong Yen Wah, E , (Mass Transfer, Radiation)
Equation of Continuity. differential control volume:
Chapter 4 Roots of Equations
GG 313 Geological Data Analysis # 18 On Kilo Moana at sea October 25, 2005 Orthogonal Regression: Major axis and RMA Regression.
Part 6 Chapter 22 Boundary-Value Problems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.
Transfer Functions Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: The following terminology.
Discussion D2.4a September 2006 Chapter 2 Section 2-8
Transfer Functions Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: The following terminology.
COMP322/S2000/L23/L24/L251 Camera Calibration The most general case is that we have no knowledge of the camera parameters, i.e., its orientation, position,
CHE/ME 109 Heat Transfer in Electronics LECTURE 11 – ONE DIMENSIONAL NUMERICAL MODELS.
Math 3120 Differential Equations with Boundary Value Problems
Differential Equations and Boundary Value Problems
CISE301_Topic8L1KFUPM1 CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1.
Solving ODEs UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Lecture 24 Introduction to state variable modeling Overall idea Example Simulating system response using MATLAB Related educational modules: –Section 2.6.1,
Louisiana Tech University Ruston, LA Slide 1 Mass Transport Steven A. Jones BIEN 501 Friday, April 13, 2007.
Calibration & Curve Fitting
Roots of a Polynomial: Root of a polynomial is the value of the independent variable at which the polynomial intersects the horizontal axis (the function.
Lecture 3 Differential Constraints Method Andrei D. Polyanin.
1 Tips for solving Project 1 Reactor SO 3 SO 2 +O 2.
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 19.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Roots of Equations ~ Open Methods Chapter 6 Credit:
CY3A2 System identification Assignment: The assignment has three parts, all relating.
Terry Rigdon. Ethanol (ethyl alcohol) Made from biomass such as corn or sugar Ethanol added to gasoline Benefits of ethanol over gasoline Brazil has introduced.
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 23.
Autar Kaw Humberto Isaza Transforming Numerical Methods Education for STEM Undergraduates.
Solution of a Partial Differential Equations using the Method of Lines
Equation of Continuity II. Summary of Equations of Change.
ECE 8443 – Pattern Recognition ECE 8423 – Adaptive Signal Processing Objectives: ML and Simple Regression Bias of the ML Estimate Variance of the ML Estimate.
Bayes Theorem The most likely value of x derived from this posterior pdf therefore represents our inverse solution. Our knowledge contained in is explicitly.
Recap Cubic Spline Interpolation Multidimensional Interpolation Curve Fitting Linear Regression Polynomial Regression The Polyval Function The Interactive.
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 27.
Dr. Mujahed AlDhaifallah ( Term 342)
DIFFERENTIAL EQUATIONS Note: Differential equations are equations containing a derivative. They can be solved by integration to obtain a general solution.
Computers in Civil Engineering 53:081 Spring 2003 Lecture #8 Roots of Equations: Systems of Equations.
Lecture 14: Pole placement (Regulator Problem) 1.
ERT 210/4 Process Control & Dynamics DYNAMIC BEHAVIOR OF PROCESSES :
Section 1.1 Basic Definitions and Terminology. DIFFERENTIAL EQUATIONS Definition: A differential equation (DE) is an equation containing the derivatives.
The formulae for the roots of a 3rd degree polynomial are given below
State Equations BIOE Processes A process transforms input to output States are variables internal to the process that determine how this transformation.
State Space Models The state space model represents a physical system as n first order differential equations. This form is better suited for computer.
Computers in Civil Engineering 53:081 Spring 2003 Lecture #10 Pipe Network as a Systems of Non-Linear Equations.
Lecture 6. Strategy for Solving Material Balance Problems.
1 CHEM-E7130 Process Modeling Exercise Multicomponent mass transfer.
Ordinary Differential Equations (ODEs). Objectives of Topic  Solve Ordinary Differential Equations (ODEs).  Appreciate the importance of numerical methods.
© 2016 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 40.
Exercise 1 Suppose we have a simple mass, spring, and damper problem. Find The modeling equation of this system (F input, x output). The transfer function.
Section 9.4 – Solving Differential Equations Symbolically Separation of Variables.
CHEM-E7130 Process Modeling Lecture 5
Transfer Functions Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: The following terminology.
Modeling and Simulation Dr. Mohammad Kilani
Discussion D2.3 Chapter 2 Section 2-7
We will be looking for a solution to the system of linear differential equations with constant coefficients.
Lecture 26 Chemical Reaction Engineering (CRE) is the field that studies the rates and mechanisms of chemical reactions and the design of the reactors.
Lecture 19 MA471 Fall 2003.
A First Course on Kinetics and Reaction Engineering
Diffusion of gases A and B Plus Convection
5.4 General Linear Least-Squares
5.1 Introduction to Curve Fitting why do we fit data to a function?
Equivalent State Equations
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Presentation transcript:

Solution of a System of ODEs with POLYMATH and MATLAB, Boundary Value Iterations with MATLAB For a system of n simultaneous first-order ODEs: where x is the independent variable and y 1, y 2,... y n are dependent variables Some initial and some final values of the dependent variables are specified and some of the problem parameters may not be known. Such a problem is a boundary value problem and iterative methods should be used to identify the unknown initial values and/or problem parameters

Simultaneous Multicomponent Diffusion of Gases Gases A and B are diffusing through stagnant gas C between two points 1 and 2 where the compositions and distance apart are known. Calculate and plot the concentration profiles and determine the molar fluxes.

Simultaneous Multicomponent Diffusion of Gases The Stefan-Maxwell equations describe this multi-component diffusion process where

Simultaneous Multicomponent Diffusion of Gases The parameters N A and N B (the molar fluxes of components A and B respectively) are unknown. They can be calculated using the boundary conditions: at point 2 (z = 0.001m) CA = 0 and CB = Estimates of NA and NB can be obtained from application of the Fick's law assuming simple binary diffusion. Estimates for N A and N B can be obtained from:

Simultaneous Multi-Component Diffusion of Gases – POLYMATH Code Estimated Values

Simultaneous Multi-Component Diffusion of Gases – POLYMATH Solution for Estimated N A and N B values No match between the specified and calculated final values

Application of the Newton-Raphson Method for the Solution of Two Point Boundary Value Problems Let us define x as the vector of unknown parameters (in this particular case x = (N A N B ) T ) and f as a vector of functions representing the difference between the desired and calculated concentration values as point 2, thus

The Newton-Raphson Method using Forward Difference to Calculate the Derivatives The Newton-Raphson (NR) method can be written where k is the iteration number, x 0 is the initial estimate and ∂f/∂x is the matrix of partial derivatives at x = x k. The matrix of partial derivatives can be calculated using forward differences, thus where δ j is a vector containing the value of δ j at the j th position and zeroes elsewhere.. The Newton-Raphson (NR) method can be written where k is the iteration number, x 0 is the initial estimate and ∂f/∂x is the matrix of partial derivatives at x = x k. The matrix of partial derivatives can be calculated using forward differences, thus where δ j is a vector containing the value of δ j at the j th position and zeroes elsewhere..

Simultaneous Multi-Component Diffusion of Gases – A MATLAB function Generated by POLYMATH Input parameters are transferred to the function in an array Output parameters should be placed into a column vector

Template for solving an ODE System* *Available in the HELP section of POLYMATH The MATLAB library function ode45 is used to solve the ODE system Data Generated by POLYMATH

Simultaneous Multi-Component Diffusion of Gases – Newton- Rapson Iterations for Identifying the Parameters Input N A and N B as a parameters into the function Newton-Raphson iterations loop Initial estimates for N A and N B Derivative calculation loop

Multi-Component Diffusion – Results of Parameter Values