22 - MATLAB solvers Adaptivity Stiffness Adaptive Methods and Stiff Systems Dhavide Aruliah UOIT MATH 2070U c D Aruliah(UOIT Adaptive Methods and

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: MATLAB solvers Adaptivity Stiffness Adaptive Methods and Stiff Systems Dhavide Aruliah UOIT MATH 2070U c D. Aruliah (UOIT) Adaptive Methods and Stiff Systems MATH 2070U 1 / 26 MATLAB solvers Adaptivity Stiffness Adaptive Methods and Stiff Systems 1 MATLAB IVP solvers 2 Adaptive IVP solvers 3 Stiffness c D. Aruliah (UOIT) Adaptive Methods and Stiff Systems MATH 2070U 2 / 26 MATLAB solvers Adaptivity Stiffness Reminder: IVP systems Generic first-order IVP: ( y = f ( t , y ) y ( t ) = y I t ∈ R : independent variable (time) I y = y ( t ) ∈ R m × 1 : vector of m dependent variables I f ( t , y ) : vector field dependent on values of t and y E.g., t : = 0, f ( t , y ) : = ( y 2 , sin ( 3 t )- 4 y 1 ) T , & y : = ( 1.5, 0 ) T yields ( y 1 = y 2 , y 1 ( ) = 1.5, y 2 = sin ( 3 t )- 4 y 1 , y 2 ( ) = Any high-order ODE can be converted to a first-order system c D. Aruliah (UOIT) Adaptive Methods and Stiff Systems MATH 2070U 4 / 26 MATLAB solvers Adaptivity Stiffness Reminder: Naive solvers for IVPs Traditional DE course focuses on analytic methods , but we need to solve most problems using numerical methods (approximations) We developed euler.m , rk2.m , rk4.m to solve 1 st-order IVPs To encode problem to solve in MATLAB using, e.g., RK4: [t,y] = rk4(f,tspan,y0,N) Input: f , tspan , y0 I function handle f : implementation of function f I 2-vector tspan : interval of integration [ t , t final ] I n-vector y0 : initial condition I positive integer N : number of time-steps Output: t , y I N-vector t : mesh of time values I N × m matrix y : components of numerical solution along columns c D. Aruliah (UOIT) Adaptive Methods and Stiff Systems MATH 2070U 5 / 26 MATLAB solvers Adaptivity Stiffness M ATLAB ’s ODE suite MATLAB IVP solvers: ode23 , ode45 , ode15s , ode23s , etc. (we say “ODE four five” rather than “ODE forty-five”, etc.) Two numbers refer to order of accuracy of embedded pair Adaptive time-stepping : error estimated by embedded pair Not mandatory to specify N (number of time-steps) Most IVP solvers based on Runge-Kutta methods [some use multistep methods, predictor-corrector methods, etc.] c D. Aruliah (UOIT) Adaptive Methods and Stiff Systems MATH 2070U 6 / 26 MATLAB solvers Adaptivity Stiffness M ATLAB IVP solvers Numerical solution of IVP system ( y = f ( t , y ) , y ( t ) = y with MATLAB: Call ode23 (or ode45 , etc.) [t,y] = ode23( f, tspan, y0 ); Input: f , tspan , y0 I function handle f : implementation of function f I 2-vector tspan : interval of integration I n-vector y0 : initial condition Output: t , y I K-vector t : mesh of time values...
View Full Document

This note was uploaded on 06/20/2011 for the course MATH 2070 taught by Professor Aruliahdhavidhe during the Winter '10 term at UOIT.

Page1 / 24

22 - MATLAB solvers Adaptivity Stiffness Adaptive Methods and Stiff Systems Dhavide Aruliah UOIT MATH 2070U c D Aruliah(UOIT Adaptive Methods and

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online