Phase space trajectories



Hi,
I don't know that function "with_slider" that you are using. Where is it
defined?
Why don't you use something like this?:

(%i4) plot: []$

(%i5) for i:1 thru 3 do (sol:rk([-x,v],[v,x],[0,i],[t,0,10,.5]),
plot:endcons([discrete,makelist([sol[j][2],sol[j][3]],j,1,length(sol))],plot))$

(%i6) plot2d(plot,[legend,false],[xlabel,"v"],[ylabel,"x"]);

One of the future improvements I have already planned for Plotdf.tcl is
to allow multiple points in the trajectory_at field:
  plotdf([-x,v],[v,x],[trajectory_at,[0,1],[0,2],[0,3]);

but that will have to wait until I do some more urgent changes to
Plot3d.tcl and Plot2d.tcl.

Regards,
Jaime

On Thu, 2009-11-26 at 00:52 +0100, julien cubizolles wrote:
> So I turned to "manually" do it. I'm using a list of rk to numerically
> solve the ODE system and with_slider to draw the trajectories. The
> code
> is like :
> 
> load(dynamics);
> sol : makelist(rk([-x,v],[v,x],[0,i],[t,0,10,.5]),i,1,3)$
> sol_points:makelist(makelist(rest(sol[i][j]),j,1,length(sol[i])),i,1,length(sol));
> with_slider(n,makelist(i,i,1,2),[discrete,sol_points[i]]);
> 
> but I'm running into the error :
> 
>