15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5 Differential Equations<br />

This section describes:<br />

• Solvers for nonstiff ODE problems<br />

• Solvers for stiff ODE problems<br />

• Basic ODE solver syntax<br />

“Mass Matrix and DAE Properties,” in the reference page for odeset, explains<br />

how to set options to solve more general linearly implicit problems.<br />

The function ode15i, which solves implicit ODEs, is described in “Solver for<br />

Fully Implicit ODEs” on page 5-15.<br />

Solvers for Nonstiff Problems<br />

There are three solvers designed for nonstiff problems:<br />

ode45<br />

ode23<br />

ode113<br />

Based on an explicit Runge-Kutta (4,5) formula, the<br />

Dormand-Prince pair. It is a one-step solver – in computing yt ( n ), it<br />

needs only the solution at the immediately preceding time point,<br />

yt ( n – 1 ).<br />

In general, ode45 is the best function to apply as a “first<br />

try” for most problems.<br />

Based on an explicit Runge-Kutta (2,3) pair <strong>of</strong> Bogacki and<br />

Shampine. It may be more efficient than ode45 at crude tolerances<br />

and in the presence <strong>of</strong> mild stiffness. Like ode45, ode23 is a<br />

one-step solver.<br />

Variable order Adams-Bashforth-Moulton PECE solver. It may be<br />

more efficient than ode45 at stringent tolerances and when the<br />

ODE function is particularly expensive to evaluate. ode113 is a<br />

multistep solver – it normally needs the solutions at several<br />

preceding time points to compute the current solution.<br />

Solvers for Stiff Problems<br />

Not all difficult problems are stiff, but all stiff problems are difficult for solvers<br />

not specifically designed for them. Solvers for stiff problems can be used exactly<br />

like the other solvers. However, you can <strong>of</strong>ten significantly improve the<br />

efficiency <strong>of</strong> these solvers by providing them with additional information about<br />

the problem. (See “Changing ODE Integration Properties” on page 5-17.)<br />

5-6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!