Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

(Not recommended) Assemble finite element matrices and solve elliptic PDE

`assempde`

is not recommended. Use `solvepde`

instead.

`u = assempde(model,c,a,f)`

`u = assempde(b,p,e,t,c,a,f)`

```
[Kc,Fc,B,ud]
= assempde(___)
```

```
[Ks,Fs]
= assempde(___)
```

```
[K,M,F,Q,G,H,R]
= assempde(___)
```

```
[K,M,F,Q,G,H,R]
= assempde(___,[],sdl)
```

`u = assempde(K,M,F,Q,G,H,R)`

```
[Ks,Fs]
= assempde(K,M,F,Q,G,H,R)
```

```
[Kc,Fc,B,ud]
= assempde(K,M,F,Q,G,H,R)
```

solves
the PDE`u`

= assempde(`model`

,`c`

,`a`

,`f`

)

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

with geometry, boundary conditions, and finite element mesh
in `model`

, and coefficients `c`

, `a`

,
and `f`

. If the PDE is a system of equations (`model.PDESystemSize`

> 1), then `assempde`

solves
the system of equations

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

`[`

, for any of the previous input
syntaxes, assembles finite element matrices using the `Kc`

,`Fc`

,`B`

,`ud`

]
= assempde(___)*reduced
linear system* form, which eliminates any Dirichlet boundary
conditions from the system of linear equations. You can calculate
the solution `u`

at node points by the command `u = B*(Kc\Fc) + ud`

.
See Reduced Linear System.

`[`

assembles finite element matrices
that represent any Dirichlet boundary conditions using a `Ks`

,`Fs`

]
= assempde(___)*stiff-spring* approximation.
You can calculate the solution `u`

at node points
by the command `u = Ks\Fs`

.
See Stiff-Spring Approximation.

`assempde`

performs the following steps to
obtain a solution `u`

to an elliptic PDE:

Generate the finite element matrices [

`K`

,`M`

,`F`

,`Q`

,`G`

,`H`

,`R`

]. This step is equivalent to calling`assema`

to generate the matrices`K`

,`M`

, and`F`

, and also calling`assemb`

to generate the matrices`Q`

,`G`

,`H`

, and`R`

.Generate the combined finite element matrices [

`Kc`

,`Fc`

,`B`

,`ud`

]. The combined stiffness matrix is for the reduced linear system,`Kc = K + M + Q`

. The corresponding combined load vector is`Fc = F + G`

. The`B`

matrix spans the null space of the columns of`H`

(the Dirichlet condition matrix representing*hu*=*r*). The`R`

vector represents the Dirichlet conditions in`Hu = R`

. The`ud`

vector represents boundary condition solutions for the Dirichlet conditions.Calculate the solution

`u`

via`u = B*(Kc\Fc) + ud`

.

`assempde`

uses one of two algorithms for
assembling a problem into combined finite element matrix form. A *reduced
linear system* form leads to immediate solution via linear
algebra. You choose the algorithm by the number of outputs. For the
reduced linear system form, request four outputs:

`[Kc,Fc,B,ud] = assempde(_)`

For the *stiff-spring approximation*, request
two outputs:

`[Ks,Fs] = assempde(_)`

For details, see Reduced Linear System and Stiff-Spring Approximation.

As explained in Elliptic Equations, the full finite element matrices and vectors are the following.

`K`

is the stiffness matrix, the integral of the`c`

coefficient against the basis functions.`M`

is the mass matrix, the integral of the`a`

coefficient against the basis functions.`F`

is the integral of the`f`

coefficient against the basis functions.`Q`

is the integral of the`q`

boundary condition against the basis functions.`G`

is the integral of the`g`

boundary condition against the basis functions.The

`H`

and`R`

matrices come directly from the Dirichlet conditions and the mesh. See Systems of PDEs.

Was this topic helpful?