15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5 Differential Equations<br />

The output argument sol is a three-dimensional array, such that:<br />

• sol(:,:,k) approximates component k <strong>of</strong> the solution u .<br />

• sol(i,:,k) approximates component k <strong>of</strong> the solution at time tspan(i) and<br />

mesh points xmesh(:).<br />

• sol(i,j,k) approximates component k <strong>of</strong> the solution at time tspan(i) and<br />

the mesh point xmesh(j).<br />

Additional PDE Solver Arguments<br />

For more advanced applications, you can also specify as input arguments solver<br />

options and additional parameters that are passed to the PDE functions.<br />

options<br />

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

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

sol = pdepe(m,pdefun,icfun,bcfun,...<br />

xmesh,tspan,options)<br />

See “Changing PDE Integration Properties” on page 5-100 for<br />

more information.<br />

Solving PDE Problems<br />

This section describes:<br />

• The process for solving PDE problems using the <strong>MATLAB</strong> solver, pdepe<br />

• Evaluating the solution at specific points<br />

Example: A Single PDE<br />

This example illustrates the straightforward formulation, solution, and<br />

plotting <strong>of</strong> the solution <strong>of</strong> a single PDE<br />

π 2 ∂u ------<br />

∂t<br />

=<br />

∂ 2 u<br />

---------<br />

∂x 2<br />

This equation holds on an interval 0 ≤ x ≤ 1 for times t ≥ 0 . At t = 0 , the<br />

solution satisfies the initial condition<br />

ux0 ( , ) = sinπx<br />

5-94

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

Saved successfully!

Ooh no, something went wrong!