Question: How to use animate (or explore) function to plot the solution of an ODE that depends on parameters?

Hello

Here is the ODE

sys := {diff(w(t), t) = y(t)*z(t), diff(x(t), t) = a*w(t), diff(y(t), t) = x(t)*z(t) + w(t), diff(z(t), t) = -x(t)*y(t), w(0) = w0, x(0) = x0, y(0) = y0, z(0) = z0}

with initial parameters a=2, w0 = -0.727367040, x0 = -0.728244724, y0 = -0.237753623 and z0 = 0.014225402.

With these parameters I have no problem to plot the solution.

nsys := subs({a=2,w0 = -0.727367040, x0 = -0.728244724, y0 = -0.237753623, z0 = 0.014225402},sys);

numsol := dsolve(nsys, numeric, method = rkf45);

vars:=[x,y,z,w];

with(plots):

col := [red, magenta, cyan, blue]:
display(
  seq(
    plots:-odeplot(numsol, [t, vars[i](t)], t=0..3, color=col[i], legend=vars[i](t))
    , i=1..numelems(vars)
  )
)

How to use animate (or explore?)  with a slider for each parameter (a,x0,y0,z0,w0)? And if I want to add a tfinal as well for the simulation (in place of 3)? ( I am newbie as far as using plot and related functions in Maple).  

Many thanks. 

Please Wait...