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 />

At x = 0 and x = 1 , the solution satisfies the boundary conditions<br />

u( 0,<br />

t) = 0<br />

π e – t + ∂u ------ ( 1,<br />

t)<br />

= 0<br />

∂x<br />

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

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

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

page 5-92 for more information.<br />

1 Rewrite the PDE. Write the PDE in the form<br />

c⎛x, t, u,<br />

∂u ------ ⎞ ∂u<br />

------ = x – m ------ ∂ x m f⎛x, t, u,<br />

∂u ------ ⎞<br />

⎝ ∂x⎠<br />

∂t ∂x ⎝<br />

⎛ ⎝ ∂x⎠⎠<br />

⎞ + s ⎛ x , t , u ,<br />

∂u ------ ⎞<br />

⎝ ∂x⎠<br />

This is the form shown in Equation 5-3 and expected by pdepe. See<br />

“Introduction to PDE Problems” on page 5-90 for more information. For this<br />

example, the resulting equation is<br />

π 2 ∂u ------ = x 0 ------ ∂ ⎛x 0 ∂u ------ ⎞ + 0<br />

∂t ∂x ⎝ ∂x⎠<br />

with parameter<br />

m = 0<br />

and the terms<br />

c⎛x, t, u,<br />

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

⎝ ∂x⎠<br />

f x, t, u,<br />

∂u ------<br />

⎝<br />

⎛ ∂x⎠<br />

⎞ =<br />

∂u ------<br />

∂x<br />

s⎛x, t, u,<br />

∂u ------ ⎞ = 0<br />

⎝ ∂x⎠<br />

5-95

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

Saved successfully!

Ooh no, something went wrong!