Elliptic1D Periodic Dirichlet Boundary Conditions#
Solves the 1D Poisson equation with periodic boundary conditions.
with \(x\in[0,1]\). The boundary conditions here are a special case, and periodicity is all that is required. Mathematically,
and
This corresponds to the call to addScalarBC1D of addScalarBC1D(A,b,k,m,dx,dc,nc,v)
, where dc
, nc
, and vc
are vectors which hold the coefficients for \(a\), \(b\), and \(g\) in the above system of equations. To request periodicity, the values must be all zeros. \(a=[0,0]\), \(b=[0,0]\) and \(g=[0,0]\).
This tells the MOLE library to build a 1D periodic boundary operator. This same logic is extended to 2 and 3 dimensions. A periodic boundary operator is returned if ALL of the values for the appropriate boundary vector values a,b,g
are zero.
The true solution ( where \(C\) is a constant ) is
This example is implemented in:
Additional MATLAB/ OCTAVE variants of this example with different boundary conditions: