1
$\begingroup$
Clear[t]
(*define some constants*)
Pr = 0.71;
R = 0.5;
Sc = 0.6;
nn = 0.2;
pde = {[D[u[x, t], {t, 1}] == 
D[u[x, t], {x, 2}] + v[x, t] + nn*w[x, t],
3*R*Pr*D[v[x, t], {t, 1}] == (3*R + 4)*D[v[x, t], {x, 2}],
Sc*D[w[x, t], {t, 1}] == D[w[x, t], {x, 2}]]};
ICs = {u[0, t] == 0, v[0, t] == 0, w[0, t] == 0};
BCs = {u[0, t] == 0, u[1, t] == 0, v[0, t] == 0, v[1, t] == 0, 
w[0, t] == 0, w[1, t] == 0};
sol = NDSolve[{pde, ICs, BCs}, u[x, t], {t = 0.2}, {x, 0, 1}];
Plot[Evaluate [u[x, t] /. sol], {x, 0, 1}]

I am unable to plot and getting this error, kindly help me any one,

Syntax::sntxf: "{" cannot be followed by "[D[u[x,t],{t,1}]==D[u[x,t],{x,2}]+v[x,t]+nn*w[x,t],3*RPrD[v[x,t],{t,1}]==(3*R+4)D[v[x,t],{x,2}],ScD[w[x,t],{t,1}]==D[w[x,t],{x,2}]]}"

$\endgroup$
1
$\begingroup$

Something like this:

Clear[t]
(*define some constants*)
Pr = 0.71;
R = 0.5;
Sc = 0.6;
nn = 0.2;
pde = {D[u[x, t], {t, 1}] == 
    D[u[x, t], {x, 2}] + v[x, t] + nn*w[x, t], 
   3*R*Pr*D[v[x, t], {t, 1}] == (3*R + 4)*D[v[x, t], {x, 2}], 
   Sc*D[w[x, t], {t, 1}] == D[w[x, t], {x, 2}]};
ICs = {u[x, 0] == x, v[x, 0] == 1 - x, w[x, 0] == 0};
BCs = {u[0, t] == 0, u[1, t] == 1, v[0, t] == 1, v[1, t] == 0, 
   w[0, t] == 0, w[1, t] == 0};
sol = NDSolveValue[{pde, ICs, BCs}, u, {t, 0, 0.2}, {x, 0, 1}];
Plot[sol[x, 0.2], {x, 0, 1}]

I changed the initial and boundary conditions a bit to make it more interesting.

$\endgroup$
  • $\begingroup$ (D[u[x, t], {t, 1}]) this is written in the answer above what is this command meaning ? $\endgroup$ – Andreas Hadjigeorgiou May 25 '17 at 12:49

Your Answer

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

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