It seems that Mathematica can't solve differential equation when one of the arguments requires that the value of one variable is equal to the value of the other variable, when I try this I get this error: NDSolveValue::fembdcc: Cross-coupling of dependent variables in DirichletCondition[wgplus==0.99 wgminus,x==0.] is not supported in this version. Code:

    sol = {wp[x, t], wg[x, t], wgplus[x, t], wgminus[x, t], n1[x, t]}
NDSolveValue[{D[wp[x, t], t] + 
    D[wp[x, t], x] == -1.63*(14.4 - n1[x, t])*wp[x, t], 
  D[wgplus[x, t], t] + 
    D[wgplus[x, t], x] == (2*n1[x, t] - 14.4)*wgplus[x, t] + 
    0.0000004*n1[x, t], 
  D[wgminus[x, t], t] - 
    D[wgminus[x, t], x] == (2*n1[x, t] - 14.4)*wgminus[x, t] + 
    0.0000004*n1[x, t], 
  D[n1[x, t], 
    t] == -0.00166*n1[x, t] - (2*n1[x, t] - 14.4)*
     wg[x, t] + (14.4 - n1[x, t])*wp[x, t], 
  wg[x, t] == wgplus[x, t] + wgminus[x, t], 
  wgplus[0, t] == 0.99*wgminus[0, t], 
  wgminus[1, t] == 0.9*wgplus[1, t], n1[x, 0] == 0, 
  wp[0, t] == 1.02}, {wp, wg, wgplus, wgminus, n1}, {t, 0, 5}, {x, 0, 
ParametricPlot3D[sol, {t, 0, 5}, {x, 0, 1}, PlotPoints -> 100]

I understand, that mistake lays in

wgplus[0, t] == 0.99*wgminus[0, t], 
      wgminus[1, t] == 0.9*wgplus[1, t],

but I don't know how to solve it. Is there any workaround?

  • $\begingroup$ You might try telling NDSolve explicitly to use the Method of Lines instead of the Finite Element Method. If that does not work (and it probably won't), then decomposing the PDEs in x into a set of ODEs. as described here may be necessary. I regret that I do not have time to illustrate the process. By the way, you may find that someone else has raised this question in the past in Mathematica.StackExchange. $\endgroup$ – bbgodfrey Oct 16 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.