Pdesolve(u, x, xrange, t, trange, [xpts], [tpts]) Returns a
function or vector of functions u(x,t) that solve a 1-dimensional
nonlinear PDE or
system of PDEs, with n independent equality constraints for
an nth order differential equation. Values are interpolated
from a matrix of solution points calculated using the numerical method of lines.
u is the scalar function name, or vector of function
names (with no variable names included) as they appear within the solve block.
For example, if you are solving for the functions f(x,t)
and g(x,t), u would be
Neither literal or array
subscripts may be used when naming functions, to accommodate the subscript
partial differential notation.
x is the spatial variable name.
xrange is a 2-element column vector containing the
real boundary values for x.
t is the time variable name.
trange is a 2-element column vector containing the
real boundary values for t.
xpts (optional) is the integer number of spatial
discretization points.
tpts (optional) is the integer number of temporal
discretization points.
Notes:
The universal notes on constructing Solve Blocks
apply. Within the body of the block:
Unknown functions: Functions must be defined explicitly in terms
of their variables, for example, use u(x,t), not just
u. Subscript notation is used to indicate partial
derivatives within the solve block, for example, uxx(x,t)is the second partial derivative of u with
respect to x.
PDE Equations: Equations must be defined using Boolean
equals. Second partial derivatives are not allowed on the left-hand-side
of equations, you must convert your equation to a system of equations
in first derivatives only (see the QuickSheet example).
Boundary conditions: There must be an initial condition u(x,0)
, and n boundary conditions, where n
is the order of the PDE, for each unknown function. Boundary conditions
can be of type Dirichlet (u(x0,t) = f(t)) or
Neumann (ux(x0,t)=g(t)), and can
be specified at either endpoint of the spatial integration range. The
endpoints used in boundary conditions must match the endpoints specified
in the ode/pdesolve command. Mathcad checks for the correct type
and number of constraints and give an error if there is a mistake.
Constraints: Algebraic constraints of the form u(x,t)
+ v(x,t) + w(x,t) = 0 are allowed. This adds an extra unknown function,
w, to the system, which must be specified as
one of the output functions in the ode/pdesolve call. Inequality constraints
are not allowed.
Assign the output of the pdesolve function to a function name, or vector
of function names.
If you wish to change the approximation method used for the partial derivatives,
right-click on the Pdesolve function and choose another method. This
may affect calculation time.
The numerical method of lines is only appropriate for solving hyperbolic
and parabolic PDEs, and partial algebraic equations. If you need to solve
an equation in a program loop, use numol.
If you need to solve an elliptic PDE, such as Poisson's equation, use relax
or multigrid.