MATLAB Function Reference Previous page   Next Page
odextend

Extend the solution of an initial value problem for an ordinary differential equation (ODE)

Syntax

Description

solext = odextend(sol, odefun, tfinal) extends the solution stored in sol to an interval with upper bound tfinal for the independent variable. odefun is a function handle. See Function Handles in the MATLAB Programming documentation for more information. sol is an ODE solution structure created using an ODE solver. The lower bound for the independent variable in solext is the same as in sol. If you created sol with an ODE solver other than ode15i, the function odefun computes the right-hand side of the ODE equation, which is of the form . If you created sol using ode15i, the function odefun computes the left-hand side of the ODE equation, which is of the form .

Parameterizing Functions Called by Function Functions, in the MATLAB mathematics documentation, explains how to provide additional parameters to the function odefun, if necessary.

odextend extends the solution by integrating odefun from the upper bound for the independent variable in sol to tfinal, using the same ODE solver that created sol. By default, odextend uses

solext = odextend(sol, [], tfinal) uses the same ODE function that the ODE solver uses to compute sol to extend the solution. It is not necessary to pass in odefun explicitly unless it differs from the original ODE function.

solext = odextend(sol, odefun, tfinal, yinit) uses the column vector yinit as new initial conditions for the subsequent integration, instead of the vector sol.y(end).

solext = odextend(sol, odefun, tfinal, yinit, options) uses the integration properties specified in options instead of the options the ODE solver originally used to compute sol. The new options are then stored within the structure solext. See odeset for details on setting options properties. Set yinit = [] as a placeholder to specify the default initial conditions.

Example

The following command

uses ode45 to solve the system y' = vdp1(t,y), where vdp1 is an example of an ODE function provided with MATLAB, on the interval [0 10]. Then, the commands

extend the solution to the interval [0 20] and plot the first component of the solution on [0 20].

See Also

deval, ode23, ode45, ode113, ode15s, ode23s, ode23t, ode23tb, ode15i, odeset, odeget, deval, function_handle (@)


Previous page  odeset ones Next page

© 1994-2005 The MathWorks, Inc.