# Documentation

### This is machine translation

Translated by
Mouse over text to see original. Click the button below to return to the English verison of the page.

## Equations You Can Solve Using Legacy Functions

 Note:   THIS PAGE DESCRIBES THE LEGACY WORKFLOW. New features might not be compatible with the legacy workflow. For the corresponding step in the recommended workflow, see Equations You Can Solve Using Recommended Functions.

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 or is a bounded 3-D region. c, a, f, and the unknown u are scalar, complex valued functions defined on Ω. c can be a matrix function on Ω (see c Coefficient for Systems). 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\left(u\right)\nabla u\right)+a\left(u\right)u=f\left(u\right)$`

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

 Note:   Before solving a nonlinear elliptic PDE, from the Solve menu in the PDE app, select Parameters. Then, select the Use nonlinear solver check box and click OK.

For eigenvalue problems, the coefficients cannot depend on the solution `u` or its gradient.

A system of PDEs with N components is N coupled PDEs with coupled boundary conditions. Scalar PDEs are those with N = 1, meaning just one PDE. Systems of PDEs generally means N > 1. The documentation sometimes refers to systems as multidimensional PDEs or as PDEs with a vector solution u. In all cases, PDE systems have a single geometry and mesh. It is only N, the number of equations, that can vary.

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 ·\left({c}_{11}\nabla {u}_{1}\right)-\nabla ·\left({c}_{12}\nabla {u}_{2}\right)+{a}_{11}{u}_{1}+{a}_{12}{u}_{2}={f}_{1}\\ -\nabla ·\left({c}_{21}\nabla {u}_{1}\right)-\nabla ·\left({c}_{22}\nabla {u}_{2}\right)+{a}_{21}{u}_{1}+{a}_{22}{u}_{2}={f}_{2}\end{array}$`

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: $\stackrel{\to }{n}\text{\hspace{0.17em}}·\text{\hspace{0.17em}}\left(c\nabla u\right)+qu=g$ on ∂Ω.

$\stackrel{\to }{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}\stackrel{\to }{n}\text{\hspace{0.17em}}·\text{\hspace{0.17em}}\left({c}_{11}\nabla {u}_{1}\right)+\stackrel{\to }{n}\text{\hspace{0.17em}}·\text{\hspace{0.17em}}\left({c}_{12}\nabla {u}_{2}\right)+{q}_{11}{u}_{1}+{q}_{12}{u}_{2}={g}_{1}\\ \stackrel{\to }{n}\text{\hspace{0.17em}}·\text{\hspace{0.17em}}\left({c}_{21}\nabla {u}_{1}\right)+\stackrel{\to }{n}\text{\hspace{0.17em}}·\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}\\ \stackrel{\to }{n}\text{\hspace{0.17em}}·\text{\hspace{0.17em}}\left({c}_{11}\nabla {u}_{1}\right)+\stackrel{\to }{n}\text{\hspace{0.17em}}·\text{\hspace{0.17em}}\left({c}_{12}\nabla {u}_{2}\right)+{q}_{11}{u}_{1}+{q}_{12}{u}_{2}={g}_{1}+{h}_{11}\mu \\ \stackrel{\to }{n}\text{\hspace{0.17em}}·\text{\hspace{0.17em}}\left({c}_{21}\nabla {u}_{1}\right)+\stackrel{\to }{n}\text{\hspace{0.17em}}·\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.