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.

Boundary Value Problems for ODEs<br />

sol.yp Approximation to y′ ( x)<br />

at the mesh points <strong>of</strong> sol.x<br />

sol.solver<br />

'bvp4c'<br />

The structure sol returned by bvp4c contains an additional field if the problem<br />

involves unknown parameters:<br />

sol.parameters<br />

Value <strong>of</strong> unknown parameters, if present, found by the<br />

solver.<br />

The function deval uses the output structure sol to evaluate the numerical<br />

solution at any point from [a,b]. For information about using deval, see<br />

“Evaluating the Solution at Specific Points” on page 5-56.<br />

BVP Solver Options<br />

For more advanced applications, you can specify solver options by passing an<br />

input argument options.<br />

options<br />

Structure <strong>of</strong> optional parameters that change the default<br />

integration properties. This is the fourth input argument.<br />

sol = bvp4c(odefun,bcfun,solinit,options)<br />

You can create the structure options using the function bvpset.<br />

The bvpset reference page describes the properties you can<br />

specify.<br />

Changing BVP Integration Properties<br />

The default integration properties in the BVP solver bvp4c are selected to<br />

handle common problems. In some cases, you can improve solver performance<br />

by overriding these defaults. You do this by supplying bvp4c with an options<br />

structure that specifies one or more property values.<br />

For example, to change the value <strong>of</strong> the relative error tolerance <strong>of</strong> bvp4c from<br />

the default value <strong>of</strong> 1e-3 to 1e-4,<br />

1 Create an options structure using the function bvpset by entering<br />

options = bvpset('RelTol', 1e-4);<br />

5-67

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

Saved successfully!

Ooh no, something went wrong!