Boundary condition for PDE model

A `BoundaryCondition`

object specifies the
type of PDE boundary condition on a set of geometry boundaries. A `PDEModel`

object contains a vector of `BoundaryCondition`

objects in its `BoundaryConditions`

property.

Specify boundary conditions for your model using the `applyBoundaryCondition`

function.

`BCType`

— Type of boundary condition`'dirichlet'`

| `'neumann'`

| `'mixed'`

Boundary type, returned as `'dirichlet'`

,
`'neumann'`

, or `'mixed'`

.

**Example: **`applyBoundaryCondition(model,'dirichlet','Face',3,'u',0)`

**Data Types: **`char`

`RegionType`

— Geometric region type`'Face'`

for 3-D geometry | `'Edge'`

for 2-D geometryGeometric region type, returned as `'Face'`

for 3-D
geometry or `'Edge'`

for 2-D geometry.

**Example: **`applyBoundaryCondition(model,'dirichlet','Face',3,'u',0)`

**Data Types: **`char`

| `string`

`RegionID`

— Geometric region IDvector of positive integers

Geometric region ID, returned as a vector of positive integers. Find the
region IDs by using `pdegplot`

with the
`'FaceLabels'`

(3-D) or `'EdgeLabels'`

(2-D) value set to `'on'`

.

**Example: **`applyBoundaryCondition(model,'dirichlet','Face',3:6,'u',0)`

**Data Types: **`double`

`r`

— Dirichlet condition `h*u = r`

`zeros(N,1)`

(default) | vector with Dirichlet condition `h*u = r`

, returned as a vector with
*N* elements or a function handle. *N*
is the number of PDEs in the system. For the syntax of the function handle
form of `r`

, see Nonconstant Boundary Conditions.

**Example: **`'r',[0;4;-1]`

**Data Types: **`double`

| `function_handle`

**Complex Number Support: **Yes

`h`

— Dirichlet condition `h*u = r`

`eye(`

`)`

(default) | Dirichlet condition `h*u = r`

, returned as an
*N*-by-*N* matrix, a vector with
*N*^2 elements, or a function handle.
*N* is the number of PDEs in the system. For the syntax
of the function handle form of `h`

, see Nonconstant Boundary Conditions.

**Example: **`'h',[2,1;1,2]`

**Data Types: **`double`

| `function_handle`

**Complex Number Support: **Yes

`g`

— Generalized Neumann condition `n·(c×`

∇`u) + qu = g`

`zeros(`

`,1)`

(default) | vector with Generalized Neumann condition `n·(c×`

∇```
u) + qu =
g
```

, returned as a vector with *N* elements or
a function handle. *N* is the number of PDEs in the system.
For scalar PDEs, the generalized Neumann condition is `n·(c`

∇```
u) + qu =
g
```

. For the syntax of the function handle form of
`g`

, see Nonconstant Boundary Conditions.

**Example: **`'g',[3;2;-1]`

**Data Types: **`double`

| `function_handle`

**Complex Number Support: **Yes

`q`

— Generalized Neumann condition `n·(c×`

∇`u) + qu = g`

`zeros(`

`)`

(default) | `^2`

elements | function handleGeneralized Neumann condition `n·(c×`

∇```
u) + qu =
g
```

, returned as an *N*-by-*N*
matrix, a vector with *N*`^2`

elements, or
a function handle. *N* is the number of PDEs in the system.
For the syntax of the function handle form of `q`

, see
Nonconstant Boundary Conditions.

**Example: **`'q',eye(3)`

**Data Types: **`double`

| `function_handle`

**Complex Number Support: **Yes

`u`

— Dirichlet conditions`zeros(`

`,1)`

(default) | vector of up to Dirichlet conditions, returned as a vector of up to *N*
elements or as a function handle. If `u`

has less than
*N* elements, then you must also use
`EquationIndex`

. The `u`

and
`EquationIndex`

arguments must have the same length. If
`u`

has *N* elements, then specifying
`EquationIndex`

is optional.

For the syntax of the function handle form of `u`

, see
Nonconstant Boundary Conditions.

**Example: **`applyBoundaryCondition(model,'dirichlet','Face',[2,4,11],'u',0)`

**Data Types: **`double`

**Complex Number Support: **Yes

`EquationIndex`

— Index of the known `u`

components`1:`

`1`

to
Index of the known `u`

components, returned as a vector
of integers with entries from `1`

to *N*.
`EquationIndex`

and `u`

must have the
same length.

**Example: **`applyBoundaryCondition(model,'mixed','Face',[2,4,11],'u',[3,-1],'EquationIndex',[2,3])`

**Data Types: **`double`

`Vectorized`

— Vectorized function evaluation`'off'`

(default) | `'on'`

Vectorized function evaluation, returned as `'on'`

or
`'off'`

. This evaluation applies when you pass a
function handle as an argument. To save time in function handle evaluation,
specify `'on'`

, assuming that your function handle computes
in a vectorized fashion. See Vectorization (MATLAB). For details of
this evaluation, see Nonconstant Boundary Conditions.

**Example: **`applyBoundaryCondition(model,'dirichlet','Face',[2,4,11],'u',@ucalculator,'Vectorized','on')`

**Data Types: **`char`

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web siteYou can also select a web site from the following list:

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

- América Latina (Español)
- Canada (English)
- United States (English)

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)