Solving PDE Problems
This section describes:
Example: A Single PDE
This example illustrates the straightforward formulation, solution, and plotting of the solution of a single PDE
This equation holds on an interval for times . At , the solution satisfies the initial condition
At and , the solution satisfies the boundary conditions
The demo |
pdepe. See Introduction to PDE Problems for more information. For this example, the resulting equation is
pdepecan use. The function must be of the form
scorrespond to the , , and terms. The code below computes
sfor the example problem.
In the function
ql correspond to the left boundary conditions (), and
qr correspond to the right boundary condition ().
pdepeto evaluate the solution. Specify the points as vectors
xplay different roles in the solver (see MATLAB Partial Differential Equation Solver). In particular, the cost and the accuracy of the solution depend strongly on the length of the vector
x. However, the computation is much less sensitive to the values in the vector
This example requests the solution on the mesh produced by 20 equally spaced points from the spatial interval [0,1] and five values of
t from the time interval [0,2].
m = 0, the functions pdex1pde, pdex1ic, and pdex1bc, and the mesh defined by x and t at which
pdepeis to evaluate the solution. The
pdepefunction returns the numerical solution in a three-dimensional array
kth component of the solution, , evaluated at
pdex1bcas function handles to
See the |
2. See Evaluating the Solution at Specific Points for more information.
|MATLAB Partial Differential Equation Solver||Evaluating the Solution at Specific Points|
© 1994-2005 The MathWorks, Inc.