I’m pretty new to Mathematica so I’m very sorry if the question is too simple.
I want to “animate” how would the distance travelled S1i change with time if the speed is constant, so here’s a piece of code:
S1i[t_, V1i_] = t*V1i;
Manipulate[Plot[S1i[t, V1i], {t, 0, 10}], {t, 0, 10}]
and i just get graph with a straight line. I still can manipulate ‘t’, but nothing changes.
So I tried manipulating ‘V1i’ instead of t, and I get the same problem:
S1i[t_, V1i_] = t*V1i;
Manipulate[Plot[S1i[t, V1i], {t, 0, 10}], {V1i, 0, 10}]
Thank you in advance.
iwilliams
(Ian Williams)
February 10, 2020, 6:32am
2
Does the following help?
Your first case
S1i[t_, V1i_] = t*V1i;
Manipulate[
Plot[S1i[t, V1i], {t, 0, time}, PlotRange -> {{0, 10}, {0, 100}}]
, {time, 1, 10}
, Initialization :> {V1i = 10}
]
Your second case
S1i[t_, V1i_] := t*V1i;
Manipulate[
Plot[S1i[t, V1i], {t, 0, 10}, PlotRange -> {{0, 10}, {0, 100}}]
, {V1i, 0, 10}
]
iwilliams
(Ian Williams)
February 10, 2020, 6:32am
3
Does the following help?
Your first case
S1i[t_, V1i_] = t*V1i;
Manipulate[
Plot[S1i[t, V1i], {t, 0, time}, PlotRange -> {{0, 10}, {0, 100}}]
, {time, 1, 10}
, Initialization :> {V1i = 10}
]
Your second case
S1i[t_, V1i_] := t*V1i;
Manipulate[
Plot[S1i[t, V1i], {t, 0, 10}, PlotRange -> {{0, 10}, {0, 100}}]
, {V1i, 0, 10}
]