2
$\begingroup$

I'm trying to "animate" the change of distance traveled with respect to time. Here's a piece of code:

S1i[t_, V1i_] = t*V1i;
Manipulate[
  Plot[S1i[t, V1i], {t, 0, 10}],
  {t, 0, 10}]

But i just get a graph with a straight line, but when i try to manipulate t, nothing changes. After that i tried with manipulating V1i and i get the same problem.

I am new to Mathematica so I'm sorry if the question is too simple. Thank you in advance.

$\endgroup$
2
  • $\begingroup$ I had apparently forgot to put := when defining the function, so i did succeed to manipulate V1i, but i still stuck with t. $\endgroup$
    – zare023
    Commented Feb 7, 2020 at 13:35
  • $\begingroup$ Manipulate[Plot[S1i[t, V1i], {t, 0, tmax}, PlotRange -> {{0, 10}, {0, 100}}, AxesLabel -> {"time", "distance"}], {{V1i, 5}, 0, 10, 0.1, Appearance -> "Labeled"}, {{tmax, 10}, 0.1, 10, 0.1, Appearance -> "Labeled"}] $\endgroup$
    – Bob Hanlon
    Commented Mar 8, 2020 at 16:56

1 Answer 1

1
$\begingroup$
S1i[t_, V1i_] := t*V1i;
Manipulate[Plot[S1i[t, V1i], {t, 0, 10},
  PlotRange -> {{0, 10}, {0, 100}}], {V1i, 0, 10}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.