represents a periodic boundary condition for all xtarget on the boundary of the region given to NDSolve where pred is True.

PeriodicBoundaryCondition[a+b u[x1,],pred,f]

represents a generalized periodic boundary condition .


  • PeriodicBoundaryCondition is used together with differential equations to describe boundary conditions in functions such as NDSolve.
  • In NDSolve[eqns,{u1,u2,},{x1,x2,}Ω], xi are the independent variables, uj are the dependent variables, and Ω is the region with boundary Ω.
  • Locations where periodic boundary conditions might be specified are shown in blue. They appear on the boundary Ω of the region Ω and specify the relation of the solution at those locations to the locations shown in green. The function f maps from the blue locations to the green locations.
  • In the special case of rectangular region Ω, a boundary equation u[,xi,min,]u[,xi,max,] is taken to be equivalent to PeriodicBoundaryCondition[u[,xi,],xixi,max,f] with f=TranslationTransform[{,0,xi,min-xi,max,0,}]. »
  • Any logical combination of equalities and inequalities in the independent variables x1, may be used for the predicate pred.
  • In PeriodicBoundaryCondition[a+b u[x1,],pred,f], for any point xtarget in the part of Ω where pred is True, then xsource=f[xtarget] should be a point in Ω where pred is not True.
  • With PeriodicBoundaryCondition[a+b u[x1,],pred,f], in NDSolve the system matrices are modified so that the solution values u[xtarget] approximately satisfy u[xtarget]==a+b u[xsource] for all xtarget on the boundary of Ω where pred is True.
  • In PeriodicBoundaryCondition[a+b u[x1,],pred,f], both a and b are scalar values that may depend on any of the independent variables xi, including time.
  • Antiperiodic boundaries may be specified using PeriodicBoundaryCondition[-u[x1,],pred,f].


open allclose all

Basic Examples  (2)

Find 5 eigenvalues and eigenvectors of a Laplacian with periodic boundary conditions:

Click for copyable input

Compare the eigenvalues with the expected analytical eigenvalues:

Click for copyable input

Visualize the eigenfunctions:

Click for copyable input

Inspect to see that the bounds are periodic:

Click for copyable input

Solve a Poisson equation with periodic boundary conditions on curved boundaries:

Click for copyable input
Click for copyable input

Visualize the solution:

Click for copyable input

Visualize the periodic solution:

Click for copyable input

Scope  (15)

Applications  (1)

Possible Issues  (5)

Neat Examples  (1)

See Also

NDSolve  NDEigensystem  DirichletCondition  NeumannValue  TransformationFunction  FindGeometricTransform  TranslationTransform

Introduced in 2016