Change target as the model runs: target =
0
0)|(jfn>0)|(afn>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); k = k + u * dt; j = j + k * dt; a = a + j * dt; v = v + a * dt; x = x + v * dt; t = t + dt; LineTo(t, x); Colour("blue"); Spot(t, 10*k); if (t