Function File: [] = **ode45** (`@fun, slot, init, `[`opt`]`, `[`par1, par2, ...`])

Command: [`sol`] = **ode45** (`@fun, slot, init, `[`opt`]`, `[`par1, par2, ...`])

Command: [`t`, `y`, [`xe`, `ye`, `ie`]] = **ode45** (`@fun, slot, init, `[`opt`]`, `[`par1, par2, ...`])

This function file can be used to solve a set of non–stiff ordinary differential equations (non–stiff ODEs) or non–stiff differential algebraic equations (non–stiff DAEs) with the well known explicit Runge–Kutta method of order (4,5).

If this function is called with no return argument then plot the solution over time in a figure window while solving the set of ODEs that are defined in a function and specified by the function handle

@fun. The second input argumentslotis a double vector that defines the time slot,initis a double vector that defines the initial values of the states,optcan optionally be a structure array that keeps the options created with the commandodesetandpar1,par2, ... can optionally be other input arguments of any type that have to be passed to the function defined by@fun.If this function is called with one return argument then return the solution

solof type structure array after solving the set of ODEs. The solutionsolhas the fieldsxof type double column vector for the steps chosen by the solver,yof type double column vector for the solutions at each time step ofx,solverof type string for the solver name and optionally the extended time stamp informationxe, the extended solution informationyeand the extended index informationieall of type double column vector that keep the informations of the event function if an event function handle is set in the option argumentopt.If this function is called with more than one return argument then return the time stamps

t, the solution valuesyand optionally the extended time stamp informationxe, the extended solution informationyeand the extended index informationieall of type double column vector.For example, solve an anonymous implementation of the Van der Pol equation

fvdb = @(vt,vy) [vy(2); (1 - vy(1)^2) * vy(2) - vy(1)]; vopt = odeset ("RelTol", 1e-3, "AbsTol", 1e-3, \ "NormControl", "on", "OutputFcn", @odeplot); ode45 (fvdb, [0 20], [2 0], vopt);

Package: odepkg