Initial values of position (x) and speed (v) of a particle visualizing using Mathematica
Clash Royale CLAN TAG#URR8PPP
$begingroup$
$$vecF(vecr)=-momega^2beginpmatrixx\4yendpmatrix$$
I have the force $F$ shown above. How could I specify the initial values of position ($x$) and speed ($v$) in Mathematica using the Manipulate
command to try finding the initial values so the particle could move on a parabolic trajectory ($alpha$) and a eight-shaped trajectory ($beta$) ?
The initial values are not exact, just one solution each is enough.
Unfortunately I have no idea how to realize this problem, would be thankful for help!
differential-equations manipulate physics simulation
$endgroup$
add a comment |
$begingroup$
$$vecF(vecr)=-momega^2beginpmatrixx\4yendpmatrix$$
I have the force $F$ shown above. How could I specify the initial values of position ($x$) and speed ($v$) in Mathematica using the Manipulate
command to try finding the initial values so the particle could move on a parabolic trajectory ($alpha$) and a eight-shaped trajectory ($beta$) ?
The initial values are not exact, just one solution each is enough.
Unfortunately I have no idea how to realize this problem, would be thankful for help!
differential-equations manipulate physics simulation
$endgroup$
add a comment |
$begingroup$
$$vecF(vecr)=-momega^2beginpmatrixx\4yendpmatrix$$
I have the force $F$ shown above. How could I specify the initial values of position ($x$) and speed ($v$) in Mathematica using the Manipulate
command to try finding the initial values so the particle could move on a parabolic trajectory ($alpha$) and a eight-shaped trajectory ($beta$) ?
The initial values are not exact, just one solution each is enough.
Unfortunately I have no idea how to realize this problem, would be thankful for help!
differential-equations manipulate physics simulation
$endgroup$
$$vecF(vecr)=-momega^2beginpmatrixx\4yendpmatrix$$
I have the force $F$ shown above. How could I specify the initial values of position ($x$) and speed ($v$) in Mathematica using the Manipulate
command to try finding the initial values so the particle could move on a parabolic trajectory ($alpha$) and a eight-shaped trajectory ($beta$) ?
The initial values are not exact, just one solution each is enough.
Unfortunately I have no idea how to realize this problem, would be thankful for help!
differential-equations manipulate physics simulation
differential-equations manipulate physics simulation
edited Jan 6 at 16:58
J. M. is computer-less♦
96.3k10301461
96.3k10301461
asked Jan 6 at 16:17
TomTom
805
805
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Here is an interactive Manipulate
using ParametricNDSolveValue
to solve the differential equation; you can interact with it by dragging the locators to the desired sites and by adjusting the time horizon T
by dragg the control bar at the top:
F[x_, y_] := x, 4 y;
traj = ParametricNDSolveValue[
Y''[t] == -F[Y[t]],
Y[0] == x0, y0,
Y'[0] == v0, w0
,
Y,
t, 0, T,
x0, y0, v0, w0, T
];
Manipulate[
Show[
Graphics[Arrow[X[[1]], X[[2]]]],
ParametricPlot[
traj[X[[1, 1]], X[[1, 2]], X[[2, 1]] - X[[1, 1]], X[[2, 2]] - X[[1, 2]], T][t],
t, 0, T
],
PlotRange -> -1, 1, -1, 1 2
],
X, 1, 0, 1, 1, Locator,
T, 5, 0, 10
]
$endgroup$
$begingroup$
looks amazing! thank you very much!
$endgroup$
– Tom
Jan 6 at 16:50
$begingroup$
You're welcome. Have fun!
$endgroup$
– Henrik Schumacher
Jan 6 at 16:51
$begingroup$
@Tom Btw.: Don't forget to upvote answers that you found helpful... That's what drives the community.
$endgroup$
– Henrik Schumacher
Jan 6 at 16:54
1
$begingroup$
@Tom Just in case that you wonder: You can accept only one answer per question. ;) And I can live with it if you choose David's one...
$endgroup$
– Henrik Schumacher
Jan 6 at 16:58
1
$begingroup$
@Tom: you can upvote both answers, but you can only accept one.
$endgroup$
– J. M. is computer-less♦
Jan 6 at 16:59
|
show 1 more comment
$begingroup$
Solve
x[t] /. DSolve[ x''[t] == - w^2 x[t], x[t], t]
y[t] /. DSolve[ y''[t] == - w^2 4 y[t], y[t], t]
to find $x(t) = cos (omega t) + sin (omega t)$ and $y(t) = cos (2 omega t) + sin (2 omega t)$, with arbitrary constants that depend upon the initial conditions. Then plot:
w = 1;
ParametricPlot[Cos[w t] + Sin[w t], Cos[ 2 w t] + Sin[2 w t], t, 0,
5]
$endgroup$
$begingroup$
thank you very much David!
$endgroup$
– Tom
Jan 6 at 16:51
$begingroup$
Note that you can also includex[0] == x0, y[0] == y0
etc. in the list of equations sent toDSolve
. This will yield a functional form for the solution that explicitly contains the initial conditions.
$endgroup$
– Michael Seifert
Jan 6 at 22:31
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
);
);
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%2f188940%2finitial-values-of-position-x-and-speed-v-of-a-particle-visualizing-using-mat%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$
Here is an interactive Manipulate
using ParametricNDSolveValue
to solve the differential equation; you can interact with it by dragging the locators to the desired sites and by adjusting the time horizon T
by dragg the control bar at the top:
F[x_, y_] := x, 4 y;
traj = ParametricNDSolveValue[
Y''[t] == -F[Y[t]],
Y[0] == x0, y0,
Y'[0] == v0, w0
,
Y,
t, 0, T,
x0, y0, v0, w0, T
];
Manipulate[
Show[
Graphics[Arrow[X[[1]], X[[2]]]],
ParametricPlot[
traj[X[[1, 1]], X[[1, 2]], X[[2, 1]] - X[[1, 1]], X[[2, 2]] - X[[1, 2]], T][t],
t, 0, T
],
PlotRange -> -1, 1, -1, 1 2
],
X, 1, 0, 1, 1, Locator,
T, 5, 0, 10
]
$endgroup$
$begingroup$
looks amazing! thank you very much!
$endgroup$
– Tom
Jan 6 at 16:50
$begingroup$
You're welcome. Have fun!
$endgroup$
– Henrik Schumacher
Jan 6 at 16:51
$begingroup$
@Tom Btw.: Don't forget to upvote answers that you found helpful... That's what drives the community.
$endgroup$
– Henrik Schumacher
Jan 6 at 16:54
1
$begingroup$
@Tom Just in case that you wonder: You can accept only one answer per question. ;) And I can live with it if you choose David's one...
$endgroup$
– Henrik Schumacher
Jan 6 at 16:58
1
$begingroup$
@Tom: you can upvote both answers, but you can only accept one.
$endgroup$
– J. M. is computer-less♦
Jan 6 at 16:59
|
show 1 more comment
$begingroup$
Here is an interactive Manipulate
using ParametricNDSolveValue
to solve the differential equation; you can interact with it by dragging the locators to the desired sites and by adjusting the time horizon T
by dragg the control bar at the top:
F[x_, y_] := x, 4 y;
traj = ParametricNDSolveValue[
Y''[t] == -F[Y[t]],
Y[0] == x0, y0,
Y'[0] == v0, w0
,
Y,
t, 0, T,
x0, y0, v0, w0, T
];
Manipulate[
Show[
Graphics[Arrow[X[[1]], X[[2]]]],
ParametricPlot[
traj[X[[1, 1]], X[[1, 2]], X[[2, 1]] - X[[1, 1]], X[[2, 2]] - X[[1, 2]], T][t],
t, 0, T
],
PlotRange -> -1, 1, -1, 1 2
],
X, 1, 0, 1, 1, Locator,
T, 5, 0, 10
]
$endgroup$
$begingroup$
looks amazing! thank you very much!
$endgroup$
– Tom
Jan 6 at 16:50
$begingroup$
You're welcome. Have fun!
$endgroup$
– Henrik Schumacher
Jan 6 at 16:51
$begingroup$
@Tom Btw.: Don't forget to upvote answers that you found helpful... That's what drives the community.
$endgroup$
– Henrik Schumacher
Jan 6 at 16:54
1
$begingroup$
@Tom Just in case that you wonder: You can accept only one answer per question. ;) And I can live with it if you choose David's one...
$endgroup$
– Henrik Schumacher
Jan 6 at 16:58
1
$begingroup$
@Tom: you can upvote both answers, but you can only accept one.
$endgroup$
– J. M. is computer-less♦
Jan 6 at 16:59
|
show 1 more comment
$begingroup$
Here is an interactive Manipulate
using ParametricNDSolveValue
to solve the differential equation; you can interact with it by dragging the locators to the desired sites and by adjusting the time horizon T
by dragg the control bar at the top:
F[x_, y_] := x, 4 y;
traj = ParametricNDSolveValue[
Y''[t] == -F[Y[t]],
Y[0] == x0, y0,
Y'[0] == v0, w0
,
Y,
t, 0, T,
x0, y0, v0, w0, T
];
Manipulate[
Show[
Graphics[Arrow[X[[1]], X[[2]]]],
ParametricPlot[
traj[X[[1, 1]], X[[1, 2]], X[[2, 1]] - X[[1, 1]], X[[2, 2]] - X[[1, 2]], T][t],
t, 0, T
],
PlotRange -> -1, 1, -1, 1 2
],
X, 1, 0, 1, 1, Locator,
T, 5, 0, 10
]
$endgroup$
Here is an interactive Manipulate
using ParametricNDSolveValue
to solve the differential equation; you can interact with it by dragging the locators to the desired sites and by adjusting the time horizon T
by dragg the control bar at the top:
F[x_, y_] := x, 4 y;
traj = ParametricNDSolveValue[
Y''[t] == -F[Y[t]],
Y[0] == x0, y0,
Y'[0] == v0, w0
,
Y,
t, 0, T,
x0, y0, v0, w0, T
];
Manipulate[
Show[
Graphics[Arrow[X[[1]], X[[2]]]],
ParametricPlot[
traj[X[[1, 1]], X[[1, 2]], X[[2, 1]] - X[[1, 1]], X[[2, 2]] - X[[1, 2]], T][t],
t, 0, T
],
PlotRange -> -1, 1, -1, 1 2
],
X, 1, 0, 1, 1, Locator,
T, 5, 0, 10
]
answered Jan 6 at 16:45
Henrik SchumacherHenrik Schumacher
50.9k469145
50.9k469145
$begingroup$
looks amazing! thank you very much!
$endgroup$
– Tom
Jan 6 at 16:50
$begingroup$
You're welcome. Have fun!
$endgroup$
– Henrik Schumacher
Jan 6 at 16:51
$begingroup$
@Tom Btw.: Don't forget to upvote answers that you found helpful... That's what drives the community.
$endgroup$
– Henrik Schumacher
Jan 6 at 16:54
1
$begingroup$
@Tom Just in case that you wonder: You can accept only one answer per question. ;) And I can live with it if you choose David's one...
$endgroup$
– Henrik Schumacher
Jan 6 at 16:58
1
$begingroup$
@Tom: you can upvote both answers, but you can only accept one.
$endgroup$
– J. M. is computer-less♦
Jan 6 at 16:59
|
show 1 more comment
$begingroup$
looks amazing! thank you very much!
$endgroup$
– Tom
Jan 6 at 16:50
$begingroup$
You're welcome. Have fun!
$endgroup$
– Henrik Schumacher
Jan 6 at 16:51
$begingroup$
@Tom Btw.: Don't forget to upvote answers that you found helpful... That's what drives the community.
$endgroup$
– Henrik Schumacher
Jan 6 at 16:54
1
$begingroup$
@Tom Just in case that you wonder: You can accept only one answer per question. ;) And I can live with it if you choose David's one...
$endgroup$
– Henrik Schumacher
Jan 6 at 16:58
1
$begingroup$
@Tom: you can upvote both answers, but you can only accept one.
$endgroup$
– J. M. is computer-less♦
Jan 6 at 16:59
$begingroup$
looks amazing! thank you very much!
$endgroup$
– Tom
Jan 6 at 16:50
$begingroup$
looks amazing! thank you very much!
$endgroup$
– Tom
Jan 6 at 16:50
$begingroup$
You're welcome. Have fun!
$endgroup$
– Henrik Schumacher
Jan 6 at 16:51
$begingroup$
You're welcome. Have fun!
$endgroup$
– Henrik Schumacher
Jan 6 at 16:51
$begingroup$
@Tom Btw.: Don't forget to upvote answers that you found helpful... That's what drives the community.
$endgroup$
– Henrik Schumacher
Jan 6 at 16:54
$begingroup$
@Tom Btw.: Don't forget to upvote answers that you found helpful... That's what drives the community.
$endgroup$
– Henrik Schumacher
Jan 6 at 16:54
1
1
$begingroup$
@Tom Just in case that you wonder: You can accept only one answer per question. ;) And I can live with it if you choose David's one...
$endgroup$
– Henrik Schumacher
Jan 6 at 16:58
$begingroup$
@Tom Just in case that you wonder: You can accept only one answer per question. ;) And I can live with it if you choose David's one...
$endgroup$
– Henrik Schumacher
Jan 6 at 16:58
1
1
$begingroup$
@Tom: you can upvote both answers, but you can only accept one.
$endgroup$
– J. M. is computer-less♦
Jan 6 at 16:59
$begingroup$
@Tom: you can upvote both answers, but you can only accept one.
$endgroup$
– J. M. is computer-less♦
Jan 6 at 16:59
|
show 1 more comment
$begingroup$
Solve
x[t] /. DSolve[ x''[t] == - w^2 x[t], x[t], t]
y[t] /. DSolve[ y''[t] == - w^2 4 y[t], y[t], t]
to find $x(t) = cos (omega t) + sin (omega t)$ and $y(t) = cos (2 omega t) + sin (2 omega t)$, with arbitrary constants that depend upon the initial conditions. Then plot:
w = 1;
ParametricPlot[Cos[w t] + Sin[w t], Cos[ 2 w t] + Sin[2 w t], t, 0,
5]
$endgroup$
$begingroup$
thank you very much David!
$endgroup$
– Tom
Jan 6 at 16:51
$begingroup$
Note that you can also includex[0] == x0, y[0] == y0
etc. in the list of equations sent toDSolve
. This will yield a functional form for the solution that explicitly contains the initial conditions.
$endgroup$
– Michael Seifert
Jan 6 at 22:31
add a comment |
$begingroup$
Solve
x[t] /. DSolve[ x''[t] == - w^2 x[t], x[t], t]
y[t] /. DSolve[ y''[t] == - w^2 4 y[t], y[t], t]
to find $x(t) = cos (omega t) + sin (omega t)$ and $y(t) = cos (2 omega t) + sin (2 omega t)$, with arbitrary constants that depend upon the initial conditions. Then plot:
w = 1;
ParametricPlot[Cos[w t] + Sin[w t], Cos[ 2 w t] + Sin[2 w t], t, 0,
5]
$endgroup$
$begingroup$
thank you very much David!
$endgroup$
– Tom
Jan 6 at 16:51
$begingroup$
Note that you can also includex[0] == x0, y[0] == y0
etc. in the list of equations sent toDSolve
. This will yield a functional form for the solution that explicitly contains the initial conditions.
$endgroup$
– Michael Seifert
Jan 6 at 22:31
add a comment |
$begingroup$
Solve
x[t] /. DSolve[ x''[t] == - w^2 x[t], x[t], t]
y[t] /. DSolve[ y''[t] == - w^2 4 y[t], y[t], t]
to find $x(t) = cos (omega t) + sin (omega t)$ and $y(t) = cos (2 omega t) + sin (2 omega t)$, with arbitrary constants that depend upon the initial conditions. Then plot:
w = 1;
ParametricPlot[Cos[w t] + Sin[w t], Cos[ 2 w t] + Sin[2 w t], t, 0,
5]
$endgroup$
Solve
x[t] /. DSolve[ x''[t] == - w^2 x[t], x[t], t]
y[t] /. DSolve[ y''[t] == - w^2 4 y[t], y[t], t]
to find $x(t) = cos (omega t) + sin (omega t)$ and $y(t) = cos (2 omega t) + sin (2 omega t)$, with arbitrary constants that depend upon the initial conditions. Then plot:
w = 1;
ParametricPlot[Cos[w t] + Sin[w t], Cos[ 2 w t] + Sin[2 w t], t, 0,
5]
answered Jan 6 at 16:41
David G. StorkDavid G. Stork
24k22153
24k22153
$begingroup$
thank you very much David!
$endgroup$
– Tom
Jan 6 at 16:51
$begingroup$
Note that you can also includex[0] == x0, y[0] == y0
etc. in the list of equations sent toDSolve
. This will yield a functional form for the solution that explicitly contains the initial conditions.
$endgroup$
– Michael Seifert
Jan 6 at 22:31
add a comment |
$begingroup$
thank you very much David!
$endgroup$
– Tom
Jan 6 at 16:51
$begingroup$
Note that you can also includex[0] == x0, y[0] == y0
etc. in the list of equations sent toDSolve
. This will yield a functional form for the solution that explicitly contains the initial conditions.
$endgroup$
– Michael Seifert
Jan 6 at 22:31
$begingroup$
thank you very much David!
$endgroup$
– Tom
Jan 6 at 16:51
$begingroup$
thank you very much David!
$endgroup$
– Tom
Jan 6 at 16:51
$begingroup$
Note that you can also include
x[0] == x0, y[0] == y0
etc. in the list of equations sent to DSolve
. This will yield a functional form for the solution that explicitly contains the initial conditions.$endgroup$
– Michael Seifert
Jan 6 at 22:31
$begingroup$
Note that you can also include
x[0] == x0, y[0] == y0
etc. in the list of equations sent to DSolve
. This will yield a functional form for the solution that explicitly contains the initial conditions.$endgroup$
– Michael Seifert
Jan 6 at 22:31
add a comment |
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%2f188940%2finitial-values-of-position-x-and-speed-v-of-a-particle-visualizing-using-mat%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