This preview shows pages 1–7. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full 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 firstorder 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 highorder ODE can be converted to a firstorder 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 storder 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 2vector tspan : interval of integration [ t , t final ] I nvector y0 : initial condition I positive integer N : number of timesteps Output: t , y I Nvector 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 fortyfive”, etc.) Two numbers refer to order of accuracy of embedded pair Adaptive timestepping : error estimated by embedded pair Not mandatory to specify N (number of timesteps) Most IVP solvers based on RungeKutta methods [some use multistep methods, predictorcorrector 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 2vector tspan : interval of integration I nvector y0 : initial condition Output: t , y I Kvector 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.
 Winter '10
 aruliahdhavidhe
 Math

Click to edit the document details