# Errors in solving coupled pdes

I am trying to solve following coupled PDEs: I am not sure about suitable BCs.

 ClearAll[V, Rho, T]
gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
System = {D[V[x, t],t] == -1/gamma/exp[-x/H]*{D[Rho[x, t], x] + D[T[x,
t],x]} + Rho[x, t]/exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
D[Rho[x, t], t] == - D[{exp[-x/H]*V[x, t]}, x],
D[T[x, t], t] == D[{exp[-x/H]*V[x, t]}, x] - V[x, t]*Rho[x, t]*gpara -
gamma*exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
V[x, t] == 0 /. x -> 0,
V[x, t] == 0 /. x -> 1,
Rho[x, t] == 0 /. x -> 0,
Rho[x, t] == 0 /. x -> 1,
T[x, t]   == 0 /. x -> 0,
T[x, t]   == 0 /. x -> 1,
D[T[x, t], x] == 0 /. x -> 1,
V[x, 0] == Sin[Pi*x/L],
Rho[x, 0] == 0,
T[x, 0] == 0};
{V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]
Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


General::ivar: 3 is not a valid variable. ........ Also, how i can import variable gpara in .txt format to this code?

Here is a version that fixes the syntax errors but there is a warning message indicating instability you should look into:

ClearAll[V, Rho, T]
gamma = 5/3; ep = 0.05; d = 0.01; L = 1; H = 1.1; gpara = 0.38;
System = {
D[V[x, t],
t] == -1/gamma/Exp[-x/H]*(D[Rho[x, t], x] + D[T[x, t], x]) +
Rho[x, t]/Exp[-x/H]*gpara + 1.3*ep*D[V[x, t], {x, 2}],
D[Rho[x, t], t] == -D[Exp[-x/H]*V[x, t], x],
D[T[x, t], t] ==
D[Exp[-x/H]*V[x, t], x] - V[x, t]*Rho[x, t]*gpara -
gamma*Exp[-x/H]*D[V[x, t], x] + gamma*d*D[T[x, t], {x, 2}],
V[0, t] == 0, V[1, t] == 0, V[x, 0] == Sin[Pi*x/L],
Rho[0, t] == 0, Rho[1, t] == 0, Rho[x, 0] == 0,
T[0, t] == 0, T[1, t] == 0, Derivative[1, 0][T][1, t] == 0,
T[x, 0] == 0};
{V, Rho, T} = NDSolveValue[System, {V, Rho, T}, {x, 0, 1}, {t, 0, 5}]


Plot3D[{V[x, t], Rho[x, t], T[x, t]}, {x, 0, 1}, {t, 0, 5}]


• Thank you very much. I am using mathematica 11.3, when i use this code in my .nb, its showing errors: General::ivar: 3 is not a valid variable. I need to install different version of mathematica to avoid errors? Apr 24, 2019 at 6:44
• @Danial, works for me in V11.3. Try quiting your kernel, perhaps? Apr 24, 2019 at 6:45
• Thanks @user21, its works after quiting kernel. Apr 25, 2019 at 6:32
• Can you please suggest me how to get eigen values of this system of equations if i change d/dt =i lambda ? Apr 25, 2019 at 6:35
• @Danial, I am not sure I understand your question, do you mean via NDEigensystem? If so, that is a different question and you should ask a new one. Apr 25, 2019 at 7:05