BCsubs - Substitute boundary conditions in partially integrated variational forms
Calling sequence:
BCsubs(bclist,expr):
Parameters
bclist - A list of equalities specifying boundary conditions. The left hand sides must be either variables, or derivatives of variables, appearing inside BoundaryInt() in expr.
expr - An expression containing BoundaryInt()s, typically as a result of using partInt.
Synopsis:
- In deriving a variational form of a PDE, Neumann boundary conditions are typically introduced by doing the appropriate substitutions in the boundary integrals that appear when the expression is integrated partially. BCsubs is a tool for doing this.
- BCsubs works in a way similar to subs. Occurencies of the left hand sides of the equalitites in BClist are replaced by the right hand sides.
- BCsubs will only affect arguments of BoundaryInt. All other terms are returned unchanged.
- If the left hand side of an entry in BClist is an undifferentiated variable, only undifferentiated occurencies of this variable are replaced. Similarly a first derivative will only replace first derivatives, etc. This is the main difference between BCsubs and subs.
Examples:
> femform:=0=partInt(ElementInt(test(x)*diff(v(x),x,x)),v(x));
/d \ /d \
femform := 0 = -ElementInt(|-- v(x)| |-- test(x)|)
\dx / \dx /
/d \
+ BoundaryInt(BdNx |-- v(x)| test(x))
\dx /
> BCsubs([diff(v(x),x)=q],femform);
/d \ /d \
0 = -ElementInt(|-- v(x)| |-- test(x)|) + BoundaryInt(BdNx q test(x))
\dx / \dx /