Intro to modeling April 22 2011. Part of the course: Introduction to biological modeling 1.Intro to modeling 2.Intro to biological modeling (Floor) 3.Modeling.

Slides:



Advertisements
Similar presentations
Aim: Creating the model of thermal decomposition of energetic material (tetryl). Data:4 results (data sets) of DSC experiment carried out in linear heating.
Advertisements

Linear Inverse Problems
Partial Differential Equations
Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 9 Instructor: Tim Warburton.
1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 10.
Using MatLab and Excel to Solve Building Energy Simulation Problems Jordan Clark
Lecture 4.
SPM 2002 C1C2C3 X =  C1 C2 Xb L C1 L C2  C1 C2 Xb L C1  L C2 Y Xb e Space of X C1 C2 Xb Space X C1 C2 C1  C3 P C1C2  Xb Xb Space of X C1 C2 C1 
Experiments and Variables
Differential Equations Math Review with Matlab: Finding Solutions to Differential Equations S. Awad, Ph.D. M. Corless, M.S.E.E. D. Cinpinski E.C.E. Department.
P. Venkataraman Mechanical Engineering P. Venkataraman Rochester Institute of Technology DETC2013 – 12269: Continuous Solution for Boundary Value Problems.
Lecture 18 - Numerical Differentiation
Chapter 3 Steady-State Conduction Multiple Dimensions
Functions.
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
A B C k1k1 k2k2 Consecutive Reaction d[A] dt = -k 1 [A] d[B] dt = k 1 [A] - k 2 [B] d[C] dt = k 2 [B] [A] = [A] 0 exp (-k 1 t) [B] = [A] 0 (k 1 /(k 2 -k.
Matlab Matlab is a powerful mathematical tool and this tutorial is intended to be an introduction to some of the functions that you might find useful.
SIMULINK Dr. Samir Al-Amer. SIMULINK SIMULINK is a power simulation program that comes with MATLAB Used to simulate wide range of dynamical systems To.
Numerical Solutions of Ordinary Differential Equations
Chapter 13 Finite Difference Methods: Outline Solving ordinary and partial differential equations Finite difference methods (FDM) vs Finite Element Methods.
Linear Simultaneous Equations
CISE301_Topic8L1KFUPM1 CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1.
Fin500J Topic 7Fall 2010 Olin Business School 1 Fin500J Mathematical Foundations in Finance Topic 7: Numerical Methods for Solving Ordinary Differential.
Linearizing ODEs of a PID Controller Anchored by: Rob Chockley and Scott Dombrowski.
Introduction to MATLAB ENGR 1187 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
Tutorial 5: Numerical methods - buildings Q1. Identify three principal differences between a response function method and a numerical method when both.
Continous system: differential equations Deterministic models derivatives instead of n(t+1)-n(t)
1 Tips for solving Project 1 Reactor SO 3 SO 2 +O 2.
Hydroinformatics: Session4 Dr Ivan Stoianov Room 328B Dr Andrew Ireson (Room 304) Mr Juan Rodriguez-Sanchez (411A) Mr Baback.
Lecture 16 Solving the Laplace equation in 2-D Remember Phils Problems and your notes = everything Only 6 lectures.
Numerical Computation Lecture 2: Introduction to Matlab Programming United International College.
MATLAB Basics. The following screen will appear when you start up Matlab. All of the commands that will be discussed should be typed at the >> prompt.
Scientific Computing Numerical Solution Of Ordinary Differential Equations - Euler’s Method.
CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation
MATLAB Harri Saarnisaari, Part of Simulations and Tools for Telecommunication Course.
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 23.
Scientific Computing Introduction to Matlab Programming.
Elliptic PDEs and the Finite Difference Method
Solution of a Partial Differential Equations using the Method of Lines
Introduction Examples of differential equations and related problems Analytical versus numerical solutions Ideas of numerical representations of solutions.
Mathematical Applications using MATLAB (Cont….)
Ch 1.3: Classification of Differential Equations
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
SIMULINK-Tutorial 1 Class ECES-304 Presented by : Shubham Bhat.
Recap Cubic Spline Interpolation Multidimensional Interpolation Curve Fitting Linear Regression Polynomial Regression The Polyval Function The Interactive.
Recap Functions with No input OR No output Determining The Number of Input and Output Arguments Local Variables Global Variables Creating ToolBox of Functions.
Dr. Mujahed AlDhaifallah ( Term 342)
University of Colorado Boulder ASEN 5070: Statistical Orbit Determination I Fall 2015 Professor Brandon A. Jones Lecture 8: State Transition Matrix, Part.
Ordinary Differential Equations
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
1 Dept. of Agricultural & Biological Engineering University of Illinois ABE223: ABE Principles – Machine Systems ABE223: ABE Principles – Machine Systems.
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 32.
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.
Differential Equations
Modelling & Simulation of Semiconductor Devices Lecture 1 & 2 Introduction to Modelling & Simulation.
Introduction to Differential Equations
Engineering Problem Solution
L – Modeling and Simulating Social Systems with MATLAB
Curve fitting methods for complex and rank deficient chemical data
MATLAB DENC 2533 ECADD LAB 9.
Mechanical Engineering at Virginia Tech
525602:Advanced Numerical Methods for ME
MATH My research interests lie primarily in the area of numerical analysis and scientific computing, …
Getting Started With Simulink
MATH My research interests lie primarily in the area of numerical analysis and scientific computing, …
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L2.
Presentation transcript:

Intro to modeling April

Part of the course: Introduction to biological modeling 1.Intro to modeling 2.Intro to biological modeling (Floor) 3.Modeling oscillators (Rob)

Today’s goal: Learn how to solve ODE models in MATLAB

Example: Heating of water

Set the model dT w /dt = Rate of change of temperature of the water [°C s -1 ] T w = Temperature of the water [°C] T h = Temperature of the heater [°C] T a = Temperature of the air [°C] c 1 = Heat transfer coefficient 1 [s -1 ] c 2 = Heat transfer coefficent 2 [s -1 ] We will measure T w

Initial parameter values From scientific literature. Decide which one(s) will be estimated from the experimental data.

Fit the experimental data with the model

P1 = 1 P2 = 1 SS = 350 P1 = 1.1 P2 = 3 SS = 55 P1 = 1.13 P2 = 4 SS = 12 Manual estimation of the parameters

How precise are the estimated parameters? We can look at the sum of squares surface:

Why modeling? Simulate the system Estimate parameters Control the system

Menu  The math behind modeling (45 min)  Break (5 min)  A few words about programming (10 min)  Hands-on tutorial (45 min)  What’s next (5 min)

What’s a model?

Types of models Deterministic Non-deterministic Probabilistic Discrete Continuous (in time) (in variable values)

Grey box How do we build a model? White box: First principles Black box: Measurements

Modeling techniques in biology Boolean Bayesian Differential Equations – Ordinary (ODE) – Partial (PDE) – Delay (DDE) …

ODEs Rate of change One independent variable One or more dependent variables Order

True or false? TRUE Only valid when x is the independent variable.

Are these ODEs? YES Independent Dependent; First order YES Independent Dependent; Third order

How to solve ODEs? General Solution Particular Solution

How to solve ODEs? Analytical or Numerical solution – Euler – ode45

Analytical solution Solve:

Numerical solution The basis is Taylor’s series expansion:

Taylor’s series example 1

Taylor’s series example 2

Euler’s method Under which condition is this valid?

Euler’s method Solution in multiple time-steps. Iterate: Solution in one time-step:

Example # Time steps15 f(x)

What does it have to do with my ODE model? Model Initial value Step Time step

ode45 ODE solver in MATLAB Uses information from the fourth and fifth derivative How to use it: [t,x] = time, x0, [], *) *You can pass whatever, for example the parameters (p) and/or the inputs (u) Mandatory. Always put in the same order. Put it here if more info will be passed.

What do we need to use ode45? i.Model ii.Parameter(s) values iii.Input(s) values iv.Independent variable (time) values = t o, t f and Δt v.Initial values of dependant variable(s)

Model Re-write in state-space form: 1.State variables(x): terms with derivative 2.Parameters(p): constants 3.Input(u): what‘s left

From paper to MATLAB Re-write model in state space form. Save the model as a MATLAB function. Write a script that calls ode45 and your model. Identify state variables, parameters, inputs. Define equations and parameter values. Define initial values, call functions, plot results.

Example: an irreversible reaction

Now the language details…

20 x0 = time = …1

0.5 p = 0.02 Magic word: Function 20 x0 = time = …1 dxdt = 3x11 t0t1t2 x1 x2 x3 t3… t10

20 x0 = 3000 time = …1 IN OUT dxdt = 11x3 x1x2x3 t0 t1 t2 t3 … t10 Summary: model function data Row vector Matrix

0 t = …1 x = 11x3 x1x2x3 t0 t1 t2 t3 … t10

Summary: script data 20 x0 = 3000 time = …1 IN OUT x = 11x3 x1x2x3 t0 t1 t2 t3 … t10 0 t = …1 Row vector Matrix Row vector

From paper to MATLAB Re-write model in state space form. Save the model as a MATLAB function. Write a script that calls ode45 and your model. Identify state variables, parameters, inputs. Define equations and parameter values. Define initial values, call functions, plot results.

Break

A few words about programming  All programs run in a defined ‘vertical’ way.  MATLAB is an interpreted language.  Errors can be found at any time.  Read the errors messages.  Most errors are in manipulation of row/column vectors.

A few words about programming Shell/command line = type commands interactively Scripts (.m) = save commands Functions (.m) = define a command. Give same name to the function and the file. Variables – Any word/letter that stores data – They remain after the program ends Semicolon (;)

Hands-on Tutorial

Your turn! I. Biological system: Irreversible reaction (15 min)

Your turn! I. Physical system: Greenhouse temperature (30 min)

Homework III. Biological system: Bioreactor

What’s next Learn/Teach:  Introduction to biological modeling (Floor)  Modeling oscillators (Rob) Reproduce modeling by Danino et al. 2010:  MATLAB 7.0  Team: Brendan, Floor, Rob, Dorett, Mariana,... May 6 th presentation