Change command as the model runs: command =
tmax=10; dt=.05; InitGraph(); ScaleWindow(0,0,tmax,40); DrawAxes(); Label('First order water-tank example',1,35); k = .5; x=0; //Initial level 0 to 40 Colour(Black); t=0; LineStart(t,x); StepModel();
//executed in StepModel() u=command; x = x + (-k*x + u) * dt; t = t + dt; LineTo(t, x); if (t