1

I have problem with coupled nonlinear reaction diffusion equations, but adding more initial and boundary conditions (as mentioned in this post: here) did not help :

B=10;
c=1;
k=10;
V=1.;
A1=2.;
A0=(B+2*A1^2)/(2*A1);
pde={
    D[uu[x,t],t]==k*D[uu[x,t],x,x]+uu[x,t]*uu[x,t]*vv[x,t]-B*uu[x,t],
    D[vv[x,t],t]==k*D[vv[x,t],x,x]-uu[x,t]*uu[x,t]*vv[x,t]+B*uu[x,t]
};

ics={ 
    uu[x,0]==A1+A1*Tanh[c*x],
    vv[x,0]==A0-A1*Tanh[c*x],
    Derivative[0,1][uu][x,0]==0,
    Derivative[0,1][vv][x,0]==0
};
bcs={
    DirichletCondition[uu[x,t]==A1*(1+Tanh[c*(x-V*t)]),x==0],
    DirichletCondition[uu[x,t]==A1*(1+Tanh[c*(x-V*t)]),x==10],
    DirichletCondition[vv[x,t]==A0-A1*Tanh[c*(x-V*t)],x==0],
    DirichletCondition[vv[x,t]==A0-A1*Tanh[c*(x-V*t)],x==10],
    (D[uu[x,t],x]/.x->0)==0,
    (D[uu[x,t],x]/.x->10)==0,
    (D[vv[x,t],x]/.x->0)==0,
    (D[vv[x,t],x]/.x->10)==0
};
NDSolveValue[{pde,ics,bcs},{uu,vv},{x,0,10},{t,0,1}];

and I got the same error:

NDSolveValue::femnonlinear: Nonlinear coefficients are not supported in this version of NDSolve.

Sektor
  • 3,320
  • 7
  • 27
  • 36
F.Daei
  • 13
  • 2

1 Answers1

4

You can use this:

B = 10;
c = 1;
k = 10;
V = 1.;
A1 = 2.;
A0 = (B + 2*A1^2)/(2*A1);
pde = {D[uu[x, t], t] == 
    k*D[uu[x, t], x, x] + uu[x, t]*uu[x, t]*vv[x, t] - B*uu[x, t], 
   D[vv[x, t], t] == 
    k*D[vv[x, t], x, x] - uu[x, t]*uu[x, t]*vv[x, t] + B*uu[x, t]};

ics = {uu[x, 0] == A1 + A1*Tanh[c*x], vv[x, 0] == A0 - A1*Tanh[c*x]};
bcs = {uu[0, t] == A1*(1 + Tanh[c*(0 - V*t)]), 
   uu[10, t] == A1*(1 + Tanh[c*(10 - V*t)]), 
   vv[0, t] == A0 - A1*Tanh[c*(0 - V*t)], 
   vv[10, t] == A0 - A1*Tanh[c*(10 - V*t)]};

{us, vs} = NDSolveValue[{pde, ics, bcs}, {uu, vv}, {x, 0, 10}, {t, 0, 1}]

And a Plot:

Plot3D[{us[x, t], vs[x, t]}, {x, 0, 10}, {t, 0, 1}]

enter image description here

user21
  • 39,710
  • 8
  • 110
  • 167