NDsolve with ODE-PDE
$begingroup$
Kindly I hope to know what is the wrong here. How to use NDsolve for a coupled ODE-PDE differential equations
NDSolve[{F''[t]+F[t]==0,
F[0]==0,F'[3*Pi]==1,D[u[t,x],t]==D[u[t,x],x,x],u[0,x]==0,u[t,0]==5*F[t],u[t,5]==0},
{F,u},{t,0,3*Pi},{x,0,5}];
I have received the following messages
Function::fpct: Too many parameters in {t,x} to be filled from
Function[{t,x},0][t].
NDSolve::ndode: The equations {(F^[Prime])[3
[Pi]]==1,F[t]+(F^[Prime][Prime])[t]==0} are not differential
equations or initial conditions in the dependent variables {u}.
differential-equations
New contributor
$endgroup$
add a comment |
$begingroup$
Kindly I hope to know what is the wrong here. How to use NDsolve for a coupled ODE-PDE differential equations
NDSolve[{F''[t]+F[t]==0,
F[0]==0,F'[3*Pi]==1,D[u[t,x],t]==D[u[t,x],x,x],u[0,x]==0,u[t,0]==5*F[t],u[t,5]==0},
{F,u},{t,0,3*Pi},{x,0,5}];
I have received the following messages
Function::fpct: Too many parameters in {t,x} to be filled from
Function[{t,x},0][t].
NDSolve::ndode: The equations {(F^[Prime])[3
[Pi]]==1,F[t]+(F^[Prime][Prime])[t]==0} are not differential
equations or initial conditions in the dependent variables {u}.
differential-equations
New contributor
$endgroup$
1
$begingroup$
Functions must be defined in the whole area{t,0,3*Pi},{x,0,5}
. It is necessary to separate the ODE from the PDE. Or calculate the functionF[t,x]
, but then the problem loses its meaning
$endgroup$
– Alex Trounev
19 hours ago
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
14 hours ago
add a comment |
$begingroup$
Kindly I hope to know what is the wrong here. How to use NDsolve for a coupled ODE-PDE differential equations
NDSolve[{F''[t]+F[t]==0,
F[0]==0,F'[3*Pi]==1,D[u[t,x],t]==D[u[t,x],x,x],u[0,x]==0,u[t,0]==5*F[t],u[t,5]==0},
{F,u},{t,0,3*Pi},{x,0,5}];
I have received the following messages
Function::fpct: Too many parameters in {t,x} to be filled from
Function[{t,x},0][t].
NDSolve::ndode: The equations {(F^[Prime])[3
[Pi]]==1,F[t]+(F^[Prime][Prime])[t]==0} are not differential
equations or initial conditions in the dependent variables {u}.
differential-equations
New contributor
$endgroup$
Kindly I hope to know what is the wrong here. How to use NDsolve for a coupled ODE-PDE differential equations
NDSolve[{F''[t]+F[t]==0,
F[0]==0,F'[3*Pi]==1,D[u[t,x],t]==D[u[t,x],x,x],u[0,x]==0,u[t,0]==5*F[t],u[t,5]==0},
{F,u},{t,0,3*Pi},{x,0,5}];
I have received the following messages
Function::fpct: Too many parameters in {t,x} to be filled from
Function[{t,x},0][t].
NDSolve::ndode: The equations {(F^[Prime])[3
[Pi]]==1,F[t]+(F^[Prime][Prime])[t]==0} are not differential
equations or initial conditions in the dependent variables {u}.
differential-equations
differential-equations
New contributor
New contributor
edited 19 hours ago
b.gatessucks
18k23269
18k23269
New contributor
asked 19 hours ago
EszaEsza
161
161
New contributor
New contributor
1
$begingroup$
Functions must be defined in the whole area{t,0,3*Pi},{x,0,5}
. It is necessary to separate the ODE from the PDE. Or calculate the functionF[t,x]
, but then the problem loses its meaning
$endgroup$
– Alex Trounev
19 hours ago
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
14 hours ago
add a comment |
1
$begingroup$
Functions must be defined in the whole area{t,0,3*Pi},{x,0,5}
. It is necessary to separate the ODE from the PDE. Or calculate the functionF[t,x]
, but then the problem loses its meaning
$endgroup$
– Alex Trounev
19 hours ago
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
14 hours ago
1
1
$begingroup$
Functions must be defined in the whole area
{t,0,3*Pi},{x,0,5}
. It is necessary to separate the ODE from the PDE. Or calculate the function F[t,x]
, but then the problem loses its meaning$endgroup$
– Alex Trounev
19 hours ago
$begingroup$
Functions must be defined in the whole area
{t,0,3*Pi},{x,0,5}
. It is necessary to separate the ODE from the PDE. Or calculate the function F[t,x]
, but then the problem loses its meaning$endgroup$
– Alex Trounev
19 hours ago
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
14 hours ago
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
14 hours ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
You can solve for F
and use that solution to solve for u
:
solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
ff = F /. solF;
Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]
solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> {"t", "x", "u[t,x]"}]
$endgroup$
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
$endgroup$
– Esza
14 hours ago
add a comment |
$begingroup$
To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr
sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x],
F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
5}];
{Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "F"],
Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "u"]}
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
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
});
}
});
Esza 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%2f189522%2fndsolve-with-ode-pde%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You can solve for F
and use that solution to solve for u
:
solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
ff = F /. solF;
Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]
solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> {"t", "x", "u[t,x]"}]
$endgroup$
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
$endgroup$
– Esza
14 hours ago
add a comment |
$begingroup$
You can solve for F
and use that solution to solve for u
:
solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
ff = F /. solF;
Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]
solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> {"t", "x", "u[t,x]"}]
$endgroup$
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
$endgroup$
– Esza
14 hours ago
add a comment |
$begingroup$
You can solve for F
and use that solution to solve for u
:
solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
ff = F /. solF;
Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]
solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> {"t", "x", "u[t,x]"}]
$endgroup$
You can solve for F
and use that solution to solve for u
:
solF = NDSolve[{F''[t] + F[t] == 0, F[0] == 0, F'[3*Pi] == 1}, {F}, {t, 0, 3*Pi}][[1]];
ff = F /. solF;
Plot[ff[t], {t, 0, 3*Pi}, AxesLabel -> {"t", "F[t]"}]
solu = NDSolve[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*ff[t], u[t, 5] == 0}, {u}, {t, 0, 3*Pi}, {x, 0, 5}][[1, 1]];
Plot3D[Evaluate[u[t, x] /. solu], {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> {"t", "x", "u[t,x]"}]
answered 19 hours ago
kglrkglr
179k9198410
179k9198410
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
$endgroup$
– Esza
14 hours ago
add a comment |
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
$endgroup$
– Esza
14 hours ago
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
$endgroup$
– Esza
14 hours ago
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that?
$endgroup$
– Esza
14 hours ago
add a comment |
$begingroup$
To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr
sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x],
F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
5}];
{Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "F"],
Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "u"]}
$endgroup$
add a comment |
$begingroup$
To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr
sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x],
F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
5}];
{Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "F"],
Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "u"]}
$endgroup$
add a comment |
$begingroup$
To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr
sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x],
F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
5}];
{Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "F"],
Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "u"]}
$endgroup$
To solve the equations jointly, we need to define the problem so that there is a Cauchy problem. I will propose the option that the solution of the system of equations coincides with that obtained by another method by @kglr
sol = NDSolve[{D[F[t, x], t, t] + F[t, x] == D[F[t, x], x, x],
F[0, x] == 0, Derivative[1, 0][F][0, x] == -1,
Derivative[0, 1][F][t, 0] == 0, Derivative[0, 1][F][t, 5] == 0,
D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == 0,
u[t, 0] == 5*F[t, 0], u[t, 5] == 0}, {F, u}, {t, 0, 3*Pi}, {x, 0,
5}];
{Plot3D[F[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "F"],
Plot3D[u[t, x] /. sol, {t, 0, 3*Pi}, {x, 0, 5},
AxesLabel -> Automatic, PlotLabel -> "u"]}
answered 12 hours ago
Alex TrounevAlex Trounev
6,4401419
6,4401419
add a comment |
add a comment |
Esza is a new contributor. Be nice, and check out our Code of Conduct.
Esza is a new contributor. Be nice, and check out our Code of Conduct.
Esza is a new contributor. Be nice, and check out our Code of Conduct.
Esza 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%2f189522%2fndsolve-with-ode-pde%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
1
$begingroup$
Functions must be defined in the whole area
{t,0,3*Pi},{x,0,5}
. It is necessary to separate the ODE from the PDE. Or calculate the functionF[t,x]
, but then the problem loses its meaning$endgroup$
– Alex Trounev
19 hours ago
$begingroup$
Many thanks for your reply. But I want to solve them simultaneously. How I can do that
$endgroup$
– Esza
14 hours ago