Change u as the model runs: u =
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();
//function StepModel() x = x + (-k*x + u) * dt; t = t + dt; LineTo(t, x); if (t