Change demand as the model runs: demand =
tmax = 10; t=0; InitGraph(); ScaleWindow(0,-1.5,tmax,1.5); DrawAxes(); Label('Dead beat position control',3,1); dt=0.01; x=1; w=0.0; u=0.0; Colour(Black); LineStart(t, x); StepModel();
//executed in StepModel() t=t+dt; if(t>tnext){ y=x-demand; u=(3*w - 5*y)/(2*tstep*tstep); w=y - u*tstep*tstep/2; tnext=tnext+tstep; } v=v+u*dt; x=x+v*dt; LineTo(t, x); if (t