Question: plot for different values (frame)

Hello,

I am trying to plot the solution for eq1 and eq2 for different values of mu.  When I plot  this:

 f := proc (x) options operator, arrow; mu*abs(F[N]-g)*signum(x(t)) end proc;

it works.

When I do the same for the solution it won’t work.

Please any help or advise.

 

This is the code:

> restart;

> with(plots);

> with(DEtools);

> k := 100; L := .25; M := .5; g := 4; mu := 0.2e-1;

> F[N] := k*L*(1-L/sqrt(x(t)^2+M^2));

> eq1 := diff(x(t), t) = v(t);

> eq2 := diff(v(t), t) = k*x(t)*(1-L/sqrt(x(t)^2+M^2))+mu*abs(F[N]-g)*signum(x(t));

> sol := dsolve({eq1, eq2, v(0) = 1, x(0) = .1098}, {v(t), x(t)}, numeric);

> newplots := [odeplot(sol, [t, x(t)], t = 0 .. 2, colour = red), odeplot(sol, [x(t), v(t)], t = 0 .. 2, colour = blue)];

> display(array(newplots));

 

This do not work:

> for i to 17 do

mu := (i-9)*(1/2);

sss := cat("The value of μ is ", convert(mu, string), ".");

P[i] := odeplot(sol, [t, x(t)], t = 0 .. 2, colour = red, title = sss)

end do;

display(seq(P[k], k = 1 .. 17), insequence = true);

 

This works:

> f := proc (x) options operator, arrow; mu*abs(F[N]-g)*signum(x(t)) end proc;

> for i to 17 do

mu := (i-9)*(1/2);

 sss := cat("The value of μ is ", convert(mu, string), ".");

P[i] := plot(f(x), x = -2 .. 2, title = sss)

end do;

display(seq(P[k], k = 1 .. 17), insequence = true);

 

Thank you

Please Wait...