Part 6 Chapter 21 Adaptive Methods and Stiff Systems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.

Slides:



Advertisements
Similar presentations
Part 2 Chapter 6 Roots: Open Methods
Advertisements

Chapter 6: Roots: Open Methods
Part 2 Chapter 6 Roots: Open Methods
Roots: Bracketing Methods
Part 5 Chapter 19 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Part 3 Chapter 9 Gauss Elimination
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Ordinary Differential Equations Equations which are.
Part 3 Chapter 10 LU Factorization PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill Companies,
Part 6 Chapter 22 Boundary-Value Problems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
General Linear Least-Squares and Nonlinear Regression
Part 4 Chapter 13 Linear Regression
Initial-Value Problems
ODEs: Adaptive Methods and Stiff Systems
Polynomial Interpolation
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 4 Image Slides.
Chapter 17 Objectives Recognizing that Newton-Cotes integration formulas are based on the strategy of replacing a complicated function or tabulated data.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Part 3 Chapter 8 Linear Algebraic Equations and Matrices PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
Ordinary Differential Equations (ODEs)
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Matrix Mathematics in MATLAB and Excel
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 2 Image Slides.
Numerical Integration Formulas
Chapter 8 Traffic-Analysis Techniques. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 8-1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
EE3561_Unit 8Al-Dhaifallah14351 EE 3561 : Computational Methods Unit 8 Solution of Ordinary Differential Equations Lesson 3: Midpoint and Heun’s Predictor.
1 Tips for solving Project 1 Reactor SO 3 SO 2 +O 2.
Part 2 Chapter 7 Optimization
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 111.
Part 3 Chapter 11 Matrix Inverse and Condition PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Part 4 Chapter 17 Polynomial Interpolation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Part 2 Chapter 5 Roots: Bracketing Methods PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. ~ Ordinary Differential Equations ~ Stiffness and Multistep.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 261 Stiffness.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 3 - Chapter 9 Linear Systems of Equations: Gauss Elimination.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapter 24 Boundary Value Problems.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 16 Image Slides.
Beginning Programming for Engineers
Ordinary Differential Equations (ODEs) 1Michael Sokolov / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Michael Sokolov ETH Zurich, Institut.
Newton’s Method, Root Finding with MATLAB and Excel
ACSL, POSTECH1 MATLAB 입문 CHAPTER 8 Numerical Calculus and Differential Equations.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 7 - Chapter 25.
Please remember: When you me, do it to Please type “numerical-15” at the beginning of the subject line Do not reply to my gmail,
ME451 Kinematics and Dynamics of Machine Systems Numerical Integration. Stiffness: Implicit Methods. October 30, 2013 Radu Serban University of Wisconsin-Madison.
Part 3 Chapter 12 Iterative Methods
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Three Statics of Structures Reactions.
Part 3 Chapter 9 Gauss Elimination PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill Companies,
ACSL, POSTECH1 MATLAB 입문 CHAPTER 8 Numerical Calculus and Differential Equations.
Sec 232: The coefficient tableau 2ed order RK method Expand all f around (x,y) using Taylor expansion in 2d and then choose constants such that the equation.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7.
Chapter 13 Transportation Demand Analysis. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display
Part 3 Chapter 9 Gauss Elimination
Part 3 Chapter 12 Iterative Methods
Linear Algebraic Equations and Matrices
Matrix Inverse and Condition
Linear Algebraic Equations and Matrices
Boundary-Value Problems
Part 2 Chapter 6 Roots: Open Methods
General Linear Least-Squares and Nonlinear Regression
Part 3 Chapter 10 LU Factorization
Roots: Bracketing Methods
Numerical Integration of Functions
Adaptive Methods and Stiff Systems
Roots: Bracketing Methods
Part 2 Chapter 7 Optimization
Part 2 Chapter 6 Roots: Open Methods
Presentation transcript:

Part 6 Chapter 21 Adaptive Methods and Stiff Systems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Chapter Objectives Understanding how the Runge-Kutta Fehlberg methods use RK methods of different orders to provide error estimates that are used to adjust step size. Familiarizing yourself with the built-in MATLAB function for solving ODEs. Learning how to adjust options for MATLAB’s ODE solvers. Learning how to pass parameters to MATLAB’s ODE solvers. Understanding what is meant by stiffness and its implications for solving ODEs.

Adaptive Runge-Kutta Methods The solutions to some ODE problems exhibit multiple time scales - for some parts of the solution the variable changes slowly, while for others there are abrupt changes. Constant step-size algorithms would have to apply a small step- size to the entire computation, wasting many more calculations on regions of gradual change. Adaptive algorithms, on the other hand, can change step-size depending on the region.

Approaches to Adaptive Methods There are two primary approaches to incorporate adaptive step-size control: –Step halving - perform the one-step algorithm two different ways, once with a full step and once with two half-steps, and compare the results. –Embedded RK methods - perform two RK iterations of different orders and compare the results. This is the preferred method.

MATLAB Functions MATLAB’s ode23 function uses second- and third- order RK functions to solve the ODE and adjust step sizes. MATLAB’s ode45 function uses fourth- and fifth- order RK functions to solve the ODE and adjust step sizes. This is recommended as the first function to use to solve a problem. MATLAB’s ode113 function is a multistep solver useful for computationally intensive ODE functions.

Using ode Functions The functions are generally called in the same way; ode45 is used as an example: [t, y] = ode45(odefun, tspan, y0) –y: solution array, where each column represents one of the variables and each row corresponds to a time in the t vector –odefun: function returning a column vector of the right- hand-sides of the ODEs –tspan: time over which to solve the system If tspan has two entries, the results are reported for those times as well as several intermediate times based on the steps taken by the algorithm If tspan has more than two entries, the results are reported only for those specific times –y0: vector of initial values

Example - Predator-Prey Solve: with y 1 (0)=2 and y 2 (0)=1 for 20 seconds predprey.m M-file: function yp = predprey(t, y) yp = [1.2*y(1)-0.6*y(1)*y(2);… -0.8*y(2)+0.3*y(1)*y(2)]; tspan = [0 20]; y0 = [2, 1]; [t, y] = tspan, y0); figure(1); plot(t,y); figure(2); plot(y(:,1),y(:,2));

ODE Solver Options Options to ODE solvers may be passed as an optional fourth argument, and are generally created using the odeset function: options=odeset(‘par 1 ’, ‘val 1 ’, ‘par 2 ’, ‘val 2 ’,…) Commonly used parameters are: –‘RelTol’: adjusts relative tolerance –‘AbsTol’: adjusts absolute tolerance –‘InitialStep’: sets initial step size –‘MaxStep’: sets maximum step size (default: one tenth of tspan interval)

Multistep Methods Multistep methods are based on the insight that, once the computation has begun, valuable information from the previous points exists. One example is the non-self- starting Heun’s Method, which has the following predictor and corrector equations:

Stiffness A stiff system is one involving rapidly changing components together with slowly changing ones. An example of a single stiff ODE is: whose solution if y(0)=0 is:

MATLAB Functions for Stiff Systems MATLAB has a number of built-in functions for solving stiff systems of ODEs, including ode15s, ode23, ode23t, and ode23tb. The arguments for the stiff solvers are the same as those for previous solvers.