MATLAB Guide

MATLAB has a range of functions for solving initial value ordinary differential equations (ODEs). These mathematical problems have the form
where t is a real scalar, y(t) is an unknown m-vector. and the given function f of t and y is also an m-vector. To be concrete, we regard t as representing time. The function f defines the ODE and the initial condition y(t 0) = y 0 then defines an initial value problem. The simplest way to solve such a problem is to write a function that evaluates f and then call one of MATLAB's ODE solvers. The minimum information that the solver must be given is the function name, the range of t values over which the solution is required and the initial condition y 0. However, MATLAB's ODE solvers allow for extra (optional) input and output arguments that make it possible to specify more about the mathematical problem and how it is to be solved. Each of MATLAB's ODE solvers is designed to be efficient in specific circumstances, but all are essentially interchangeable. In the next subsection we develop examples that illustrate the use of ode45. This function implements an adaptive Runge-Kutta algorithm and is typically the most efficient solver for the classes of ODEs that concern MATLAB users. The full range of ODE solving functions is discussed in Section 12.2.3 and listed in Table 12.1 on...