Help_ode45ver_5and6

# Help_ode45ver_5and6 - To get started type one of these...

This preview shows pages 1–2. Sign up to view the full content.

1 To get started, type one of these: helpwin, helpdesk, or demo. For product information, type tour or visit www.mathworks.com. » help ode45 version 5 wording ODE45 Solve non-stiff differential equations, medium order method. [T,Y] = ODE45('F',TSPAN,Y0) with TSPAN = [T0 TFINAL] integrates the system of differential equations y' = F(t,y) from time T0 to TFINAL with initial conditions Y0. 'F' is a string containing the name of an ODE file. Function F(T,Y) must return a column vector. Each row in solution array Y corresponds to a time returned in column vector T. To obtain solutions at specific times T0, T1, . .., TFINAL (all increasing or all decreasing), use TSPAN = [T0 T1 . .. TFINAL]. [T,Y] = ODE45('F',TSPAN,Y0,OPTIONS) solves as above with default integration parameters replaced by values in OPTIONS, an argument created with the ODESET function. See ODESET for details. Commonly used options are scalar relative error tolerance 'RelTol' (1e-3 by default) and vector of absolute error tolerances 'AbsTol' (all components 1e-6 by default). [T,Y] = ODE45('F',TSPAN,Y0,OPTIONS,P1,P2,. ..) passes the additional parameters P1,P2,. .. to the ODE file as F(T,Y,FLAG,P1,P2,. ..) (see ODEFILE). Use OPTIONS = [] as a place holder if no options are set. It is possible to specify TSPAN, Y0 and OPTIONS in the ODE file (see ODEFILE). If TSPAN or Y0 is empty, then ODE45 calls the ODE file [TSPAN,Y0,OPTIONS] = F([],[],'init') to obtain any values not supplied in the ODE45 argument list. Empty arguments at the end of the call list may be omitted, e.g. ODE45('F'). As an example, the commands options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]); ode45('rigidode',[0 12],[0 1 1],options); solve the system y' = rigidode(t,y) with relative error tolerance 1e-4 and absolute tolerances of 1e-4 for the first two components and 1e-5 for the third. When called with no output arguments, as in this example, ODE45 calls the default output function ODEPLOT to plot the solution as it is computed. ODE45 can solve problems M(t,y)*y' = F(t,y) with a mass matrix M that is nonsingular. Use ODESET to set Mass to 'M', 'M(t)', or 'M(t,y)' if the ODE file is coded so that F(T,Y,'mass') returns a constant, time-dependent, or time- and state-dependent mass matrix, respectively.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

Help_ode45ver_5and6 - To get started type one of these...

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

View Full Document
Ask a homework question - tutors are online