stejok
(Stephan Jokiel)
November 11, 2014, 9:15pm
1
Hello there,
This is my first experience with mathematica and
I would like to give my plot the
“perfect” touch with telling my plot that it isnt allowed to pick any “r” bigger
than “a” so that r < a is true.
This is the code i entered:
r = 1; w = 2 \[Pi]; a = 2; v = 0.1;
Manipulate[
ParametricPlot[{v*t (1 + 1/(1 - r/a*Cos[w*t])), (r*Sin[w*t])/(
1 - r/a*Cos[w*t])}, {t, 0, 10},
PlotRange -> {{-.5, 200}, {-100, 100}}], {r, 0.000000001, 100,
Appearance -> "Labeled"}, {a, 0.000000001, 100,
Appearance -> "Labeled"}, {v, 0.000000001, 20,
Appearance -> "Labeled"}, {w, 0.000000001, 20,
Appearance -> "Labeled"}]
This is the Output:
I would really appreciate it if someone got an answer to this
Best regards, Stephan
iamorozov1
(Ivan Morozov)
November 11, 2014, 9:40pm
2
Hi,
You can use If[] :
Manipulate[
If[
r < a,
ParametricPlot[
{v*t (1 + 1/(1 - r/a*Cos[w*t])), (r*Sin[w*t])/(1 - r/a*Cos[w*t])},
{t, 0, 10},
PlotRange -> {{-.5, 200}, {-100, 100}}
],
Graphics[Text["error :: r > a"]]
],
{r, 0.000000001, 100, Appearance -> "Labeled"},
{a, 0.000000001, 100, Appearance -> "Labeled"},
{v, 0.000000001, 20, Appearance -> "Labeled"},
{w, 0.000000001, 20, Appearance -> "Labeled"}
]
I.M.
stejok
(Stephan Jokiel)
November 11, 2014, 9:49pm
3
Wow, this is genius, thanks alot ;D
Hi Stephan,
you simply can let ‘r’ run from 0.00.. to ‘a’:
Manipulate[
ParametricPlot[{v*
t (1 + 1/(1 - r/a*Cos[w*t])), (r*Sin[w*t])/(1 -
r/a*Cos[w*t])}, {t, 0, 10},
PlotRange -> {{-.5, 200}, {-100, 100}}], {{r, 1}, 0.000000001, a,
Appearance -> "Labeled"}, {{a, 2}, 0.000000001, 100,
Appearance -> "Labeled"}, {{v, 0.1}, 0.000000001, 20,
Appearance -> "Labeled"}, {{w, 2 Pi}, 0.000000001, 20,
Appearance -> "Labeled"}]
Also please note the way of initialization of the parameters which was probably inteded by you originally.
Yours Henrik
stejok
(Stephan Jokiel)
November 14, 2014, 9:38am
5
Wolfram posted the code automatically in the here but thanks I I’ll definitely give it a try if it works how I think it works it might even be better than the “If []”