Change target as the model runs: target =
0
0)|(vfn>0)|(xfn>xtarget); //negative offside? } while(offp&&offn); //loop while both are offside if(offp){u=1;}else if(offn){u=-1;} else {u=0;} //if one of them is still offside, that is the value for u dt=tf/ratio +.004; //plant step increases with time to decision Colour("black"); MoveTo(t, x); a = a + u * dt; v = v + a * dt; x = x + v * dt; t = t + dt; LineTo(t, x); Colour("blue"); Spot(t, 10*a); if (t