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.

Partial Differential Equations<br />

The solution u<br />

satisfies the initial conditions<br />

u 1 ( x,<br />

0) ≡ 1<br />

u 2 ( x,<br />

0) ≡ 0<br />

and boundary conditions<br />

∂u<br />

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

( 0,<br />

t) ≡ 0<br />

∂x<br />

u 2 ( 0,<br />

t) ≡ 0<br />

u 1 ( 1,<br />

t) ≡ 1<br />

∂u<br />

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

( 1,<br />

t) ≡ 0<br />

∂x<br />

Note The demo pdex4 contains the complete code for this example. The demo<br />

uses subfunctions to place all required functions in a single M-file. To run this<br />

example type pdex4 at the command line. See “PDE Solver Basic Syntax” on<br />

page 5-92 and “Solving PDE Problems” on page 5-94 for more information.<br />

1 Rewrite the PDE. In the form expected by pdepe, the equations are<br />

1<br />

1<br />

.∗<br />

∂<br />

---- u 1<br />

∂t u 2<br />

=<br />

∂<br />

----- 0.024( ∂u 1 ⁄ ∂x)<br />

∂x 0.170( ∂u 2 ⁄ ∂x)<br />

+<br />

– Fu ( 1 – u 2 )<br />

Fu ( 1 – u 2 )<br />

The boundary conditions on the partial derivatives <strong>of</strong> u have to be written<br />

in terms <strong>of</strong> the flux. In the form expected by pdepe, the left boundary<br />

condition is<br />

0 1<br />

+<br />

u 2 0<br />

.∗<br />

0.024( ∂u 1 ⁄ ∂x)<br />

0.170( ∂u 2 ⁄ ∂x)<br />

=<br />

0<br />

0<br />

5-101

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

Saved successfully!

Ooh no, something went wrong!