## Documentation |

This toolbox applies to the following PDE type:

$$-\nabla \cdot \left(c\nabla u\right)+au=f,$$

expressed in Ω, which we shall refer to as the *elliptic
equation*, regardless of whether its coefficients and boundary
conditions make the PDE problem elliptic in the mathematical sense.
Analogously, we shall use the terms *parabolic equation* and *hyperbolic
equation* for equations with spatial operators like the
previous one, and first and second order time derivatives, respectively.
Ω is a bounded domain in the plane. *c*, *a*, *f*,
and the unknown *u* are scalar, complex valued functions
defined on Ω. *c* can be a 2-by-2 matrix function
on Ω. The software can also handle the parabolic PDE

$$d\frac{\partial u}{\partial t}-\nabla \cdot \left(c\nabla u\right)+au=f,$$

the hyperbolic PDE

$$d\frac{{\partial}^{2}u}{\partial {t}^{2}}-\nabla \cdot \left(c\nabla u\right)+au=f,$$

and the eigenvalue problem

$$-\nabla \cdot \left(c\nabla u\right)+au=\lambda du,$$

where *d* is a complex valued function on Ω,
and *λ* is an unknown eigenvalue. For the parabolic
and hyperbolic PDE the coefficients *c*, *a*, *f*,
and *d* can depend on time, on the solution *u*,
and on its gradient ∇*u*. A nonlinear solver
(`pdenonlin`) is available for the
nonlinear elliptic PDE

$$-\nabla \cdot \left(c(u)\nabla u\right)+a(u)u=f(u),$$

where *c*, *a*, and *f* are
functions of the unknown solution *u* and on its
gradient ∇*u*. The parabolic and hyperbolic
equation solvers also solve nonlinear and time-dependent problems.

All solvers can handle the system case of *N* coupled
equations. You can solve *N* = 1 or 2 equations using
the PDE app, and any number of equations using command-line functions.
For example, *N* = 2 elliptic equations:

$$\begin{array}{c}-\nabla \xb7\left({c}_{11}\nabla {u}_{1}\right)-\nabla \xb7\left({c}_{12}\nabla {u}_{2}\right)+{a}_{11}{u}_{1}+{a}_{12}{u}_{2}={f}_{1}\\ -\nabla \xb7\left({c}_{21}\nabla {u}_{1}\right)-\nabla \xb7\left({c}_{22}\nabla {u}_{2}\right)+{a}_{21}{u}_{1}+{a}_{22}{u}_{2}={f}_{2}.\end{array}$$

For a description of *N* > 1 PDE systems
and their coefficients, see Coefficients for Systems of PDEs.

For the elliptic problem, an adaptive mesh refinement algorithm is implemented. It can also be used in conjunction with the nonlinear solver. In addition, a fast solver for Poisson's equation on a rectangular grid is available.

The following boundary conditions are defined for scalar *u*:

*Dirichlet*:*hu*=*r*on the boundary ∂Ω.*Generalized Neumann*: $$\overrightarrow{n}\text{\hspace{0.17em}}\xb7\text{\hspace{0.17em}}\left(c\nabla u\right)+qu=g$$ on ∂Ω.

$$\overrightarrow{n}$$ is the outward unit normal. *g*, *q*, *h*,
and *r* are complex-valued functions defined on ∂Ω.
(The eigenvalue problem is a homogeneous problem, i.e., *g* =
0, *r* = 0.) In the nonlinear case, the coefficients *g*, *q*, *h*,
and *r* can depend on *u*, and for
the hyperbolic and parabolic PDE, the coefficients can depend on time.
For the two-dimensional system case, Dirichlet boundary condition
is

$$\begin{array}{c}{h}_{11}{u}_{1}+{h}_{12}{u}_{2}={r}_{1}\\ {h}_{21}{u}_{1}+{h}_{22}{u}_{2}={r}_{2},\end{array}$$

the generalized Neumann boundary condition is

$$\begin{array}{c}\overrightarrow{n}\text{\hspace{0.17em}}\xb7\text{\hspace{0.17em}}\left({c}_{11}\nabla {u}_{1}\right)+\overrightarrow{n}\text{\hspace{0.17em}}\xb7\text{\hspace{0.17em}}\left({c}_{12}\nabla {u}_{2}\right)+{q}_{11}{u}_{1}+{q}_{12}{u}_{2}={g}_{1}\\ \overrightarrow{n}\text{\hspace{0.17em}}\xb7\text{\hspace{0.17em}}\left({c}_{21}\nabla {u}_{1}\right)+\overrightarrow{n}\text{\hspace{0.17em}}\xb7\text{\hspace{0.17em}}\left({c}_{22}\nabla {u}_{2}\right)+{q}_{21}{u}_{1}+{q}_{22}{u}_{2}={g}_{2}.\end{array}$$

and the *mixed* boundary condition is

$$\begin{array}{c}{h}_{11}{u}_{1}+{h}_{12}{u}_{2}={r}_{1}\\ \overrightarrow{n}\text{\hspace{0.17em}}\xb7\text{\hspace{0.17em}}\left({c}_{11}\nabla {u}_{1}\right)+\overrightarrow{n}\text{\hspace{0.17em}}\xb7\text{\hspace{0.17em}}\left({c}_{12}\nabla {u}_{2}\right)+{q}_{11}{u}_{1}+{q}_{12}{u}_{2}={g}_{1}+{h}_{11}\mu \\ \overrightarrow{n}\text{\hspace{0.17em}}\xb7\text{\hspace{0.17em}}\left({c}_{21}\nabla {u}_{1}\right)+\overrightarrow{n}\text{\hspace{0.17em}}\xb7\text{\hspace{0.17em}}\left({c}_{22}\nabla {u}_{2}\right)+{q}_{21}{u}_{1}+{q}_{22}{u}_{2}={g}_{2}+{h}_{12}\mu ,\end{array}$$

where *µ* is computed such that the Dirichlet
boundary condition is satisfied. Dirichlet boundary conditions are
also called *essential* boundary conditions, and
Neumann boundary conditions are also called *natural* boundary
conditions.

For advanced, nonstandard applications you can transfer the
description of domains, boundary conditions etc. to your MATLAB^{®} workspace.
From there you use Partial Differential Equation Toolbox™ functions
for managing data on unstructured meshes. You have full access to
the mesh generators, FEM discretizations of the PDE and boundary conditions,
interpolation functions, etc. You can design your own solvers or use
FEM to solve subproblems of more complex algorithms. See also Solve PDEs Programmatically.

Was this topic helpful?