Partial Differential Equation Toolbox    
assemb

Assemble boundary condition contributions

Syntax

Description

[Q,G,H,R]=assemb(b,p,e) assembles the matrices Q and H, and the vectors G and R. Q should be added to the system matrix and contains contributions from mixed boundary conditions. G should be added to the right-hand side and contains contributions from generalized Neumann and mixed boundary conditions. The equation H*u=R represents the Dirichlet type boundary conditions.

The input parameters p, e, u0, time, and sdl have the same meaning as in assempde.

b describes the boundary conditions of the PDE problem. b can be either a Boundary Condition matrix or the name of a Boundary M-file. The format of the Boundary Condition matrix is described below. For a description of the format of the Boundary M-file, see pdebound.

The toolbox treats the following boundary condition types:

The toolbox can also handle systems of partial differential equations over the domain . Let the number of variables in the system be N. Our general boundary condition is hu = r

where is the angle of the normal vector of the boundary, pointing in the direction out from , the domain.

The Boundary Condition matrix is created internally in pdetool (actually a function called by pdetool) and then used from the function assemb for assembling the contributions from the boundary to the matrices Q, G, H, and R. The Boundary Condition matrix can also be saved onto a file as a boundary M-file for later use with the wbound function.

For each column in the Decomposed Geometry matrix there must be a corresponding column in the Boundary Condition matrix. The format of each column is according to the list below:

The following rows contain text expressions representing the actual boundary condition functions. The text strings have the lengths according to above. The MATLAB text expressions are stored in columnwise order with respect to matrices h and . There are no separation characters between the strings. You can insert MATLAB expressions containing the following variables:

It is not possible to explicitly refer to the time derivative of the solution in the boundary conditions.

Examples

The following examples describe the format of the boundary condition matrix. For a boundary in a scalar PDE (N = 1) with Neumann boundary condition (M = 0)

the boundary condition would be represented by the column vector

Note that no lengths are stored for h or r.

Also for a scalar PDE, the Dirichlet boundary condition

is stored in the column vector

For a system (N = 2) with mixed boundary conditions (M = 1)

the column looks like

Where lq11, lq21, . . . denote lengths of the MATLAB text expressions, and q11, q21, . . . denote the actual expressions.

You can easily create your own examples by trying out pdetool. Enter boundary conditions by double-clicking on boundaries in boundary mode, and then export the Boundary Condition matrix to the MATLAB main workspace by selecting the Export Decomposed Geometry, Boundary Cond's . . . option from the Boundary menu.

See Also

assempde, pdebound


  assema assempde