Errors in solving coupled pdes
$begingroup$
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?
differential-equations
New contributor
$endgroup$
add a comment |
$begingroup$
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?
differential-equations
New contributor
$endgroup$
add a comment |
$begingroup$
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?
differential-equations
New contributor
$endgroup$
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?
differential-equations
differential-equations
New contributor
New contributor
edited 2 hours ago
Danial
New contributor
asked 2 hours ago
Danial Danial
62
62
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
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}]
$endgroup$
$begingroup$
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?
$endgroup$
– Danial
12 mins ago
$begingroup$
@Danial, works for me in V11.3. Try quiting your kernel, perhaps?
$endgroup$
– user21
10 mins ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Danial is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f196892%2ferrors-in-solving-coupled-pdes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
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}]
$endgroup$
$begingroup$
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?
$endgroup$
– Danial
12 mins ago
$begingroup$
@Danial, works for me in V11.3. Try quiting your kernel, perhaps?
$endgroup$
– user21
10 mins ago
add a comment |
$begingroup$
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}]
$endgroup$
$begingroup$
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?
$endgroup$
– Danial
12 mins ago
$begingroup$
@Danial, works for me in V11.3. Try quiting your kernel, perhaps?
$endgroup$
– user21
10 mins ago
add a comment |
$begingroup$
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}]
$endgroup$
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}]
answered 1 hour ago
user21user21
21k55998
21k55998
$begingroup$
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?
$endgroup$
– Danial
12 mins ago
$begingroup$
@Danial, works for me in V11.3. Try quiting your kernel, perhaps?
$endgroup$
– user21
10 mins ago
add a comment |
$begingroup$
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?
$endgroup$
– Danial
12 mins ago
$begingroup$
@Danial, works for me in V11.3. Try quiting your kernel, perhaps?
$endgroup$
– user21
10 mins ago
$begingroup$
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?
$endgroup$
– Danial
12 mins ago
$begingroup$
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?
$endgroup$
– Danial
12 mins ago
$begingroup$
@Danial, works for me in V11.3. Try quiting your kernel, perhaps?
$endgroup$
– user21
10 mins ago
$begingroup$
@Danial, works for me in V11.3. Try quiting your kernel, perhaps?
$endgroup$
– user21
10 mins ago
add a comment |
Danial is a new contributor. Be nice, and check out our Code of Conduct.
Danial is a new contributor. Be nice, and check out our Code of Conduct.
Danial is a new contributor. Be nice, and check out our Code of Conduct.
Danial is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f196892%2ferrors-in-solving-coupled-pdes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown