Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

im trying to solve a PDE-System, with the "periodic boundary condition"


But mathenmatica says:

NDSolve::bcedge: "Boundary condition c[t,0]==4\ c[t,2\ [Pi]] is not specified on a single edge of the boundary of the computational domain."

If i replace the 4 by 1 everything is fine. Anyone can explain this to me? And/or can tell me how/if mathematica can solve this?

Thanks for reading!

share|improve this question
It would help to have the rest of your equation as well. – b.gatessucks Mar 19 '14 at 16:37

The condition c[t, 0] == 4 * c[t, 2 Pi] does not define a periodic boundary condition. The function value must be the same for it to be periodic. That is also why it works if you replace 4 by 1. You might be able to replace c[t, x] by m[x] u[t, x] where u is periodic and m[x] grows exponentially by a factor of 4 over each period.

Here is an adaptation of the sine-Gordon equation in the NDSolve documentation illustrating this idea.

L = 4;
m[x_] := Exp[Log[4] x/(2 L)];
sol = NDSolve[{D[m[x] u[t, x], t, t] == 
     D[m[x] u[t, x], x, x]  + Sin[m[x] u[t, x]], u[t, -L] == u[t, L],
    m[x] u[0, x] == Exp[-x^2],
    Derivative[1, 0][u][0, x] == 0},
   u, {t, 0, L}, {x, -L, L}];

Plot3D[Evaluate[m[x] u[t, x] /. First[sol]], {x, -L, 5 L}, {t, 0, L}]

Mathematica graphics

A check of the constant ratio over the "period" 2 L:

Ratios /@ Table[m[x] u[t, x] /. First[sol],
  {t, RandomReal[{0, L}, 5]}, {x, -L, 7 L, 2 L}]
  {{4., 4., 4., 4.}, {4., 4., 4., 4.}, {4., 4., 4., 4.},
   {4., 4., 4., 4.}, {4., 4., 4., 4.}}
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.