I am trying to solve numerically a system of 3 partial differential equations and I am facing a problem.
My functions are f[x,t], g[x,t] and h[x,t] and are defined for x values between S and R (for some values of R and S).
The differential equations with the boundary conditions are the following:

eqnsNC= { D[f[x, t],t]== DM * D[f[x, t], x,x]-kf * f[x, t] * h[x, t]+kdis * g[x, t], D[h[x, t], t]==DL * D[h[x, t], x,x]-kf * f[x, t] *h[x, t]+kdis * g[x, t],D[g[x, t], t]==DML * D[g[x, t], x,x]+kf * f[x, t] * h[x, t]-kdis *g[x, t]}; bc={f^(1,0)[R,t]==g^(1,0)[R,t]==h^(1,0)[R,t]==0, f[x,0]==g[x,0]==h[x,0]==0, f[S,t]==MS * (1-Exp[-1000 t]), g[S,t]==(kf * LS* MS * (1-Exp[-1000 t]))/kdis, h[S,t]==LS * (1-Exp[-1000 t])};

With a bunch of constants

DM = 5*10^-6;   DL = 5*10^-6; DML = 5*10^-6; kf = 10^3; kdis = 63.8; MS = 0.25; LS = 0.2; 
R = 0.12; NN = 0.1; S = 0.05; tf = 10000;

Until there everything works and I can solve the system using the command

{fsol2, gsol2, hsol2} =  NDSolveValue[{eqnsNC, bc}, {f, g, h}, {x, S, R}, {t, 0, tf}]     

However, for the real problem I need to add an additional constraint that states that the function f[x,t] is actually 0 on the region NN<x<R, for a value of NN such that S<NN<R and for all t. The boundary condition df/fx =0 in R is therefore redundant but I cannot implement the above constraint. I tried to change the boundary conditions by adding f[NN, t] == 0 but I am running into errors when trying to get the numerical solutions such as

NDSolveValue::bcedge: Boundary condition f[8,t]==0 is not specified on a single edge of the boundary of the computational domain. >>

How can I tell Mathematica to solve for f on the region S<x<R only and for h and g on the region R<x<S? Or is it possible to define a given set of equations on a particular domain (for example in my case for S<x<NN ) and another one for another region (NN<x<R)?

I would be very grateful for any advices you could think of !


  • 2
    $\begingroup$ please post the equations using correct mathematica syntax. $\endgroup$ – george2079 Mar 10 '15 at 19:42
  • $\begingroup$ To follow up on the comment by @george2079, edit your code so that it is in InputForm. For instance, \[PartialD]f(x,t)/\[PartialD]t should be D[f[x, t], t]. It also could be displayed as Derivative[0, 1][f][x, t]. $\endgroup$ – bbgodfrey Mar 11 '15 at 0:41
  • $\begingroup$ And please also post the rest of the code. I.e There is an NDSolve message but no NDSolve command in your question. $\endgroup$ – user21 Mar 11 '15 at 8:04
  • $\begingroup$ Hello, I am sorry for the wring syntax and I hope it is clearer now. Looking forward for your answers! $\endgroup$ – Maud Mar 16 '15 at 8:52

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.