We are trying to create an animation of arrows, where we calculate the vertices of the arrow in a procedure.  We are receiving the error:

Error, (in peak_slow) cannot determine if this expression is true or false: t < -.4506938557
 

where the animate command is trying to evaluate our procedure instead of calculating the value.  The procedure is

peak_slow:=proc(t0)
>   local x2,X,opts;
>   global ux,mu,k,nu,a2,s;
>   x2:=a2+t0*k[2]^2;
>   X:=(k[1]^2-k[1]*k[2]+k[2]^2)*t0;
>   if (t0<t_on) then
>     opts:=x=x2, x2-mu/k[2]..x2+mu/k[2];
>   elif (t0>t_off) then
>     opts:=x=x2-2*a2, x2-2*a2-mu/k[2]..x2-2*a2+mu/k[2];
>   else
>     opts:=x=X+s, X+s..X+s*nu;
>   end if;
>   return fsolve(eval(ux,{t=t0}),opts);
> end proc:

 

Is it possible to use a procedure like this, where there is an if statement, in an animate command?  Thanks, in advance

 

mw99aj


Please Wait...