1
$\begingroup$

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.

$\endgroup$
0

1 Answer 1

4
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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