Change input percent as the model runs:
tmax = 200; demand=50; a=0.1; b=10; dt = .1; InitGraph(); ScaleWindow(0,-1,tmax,100); DrawAxes(); Label('Water heater',150,75); tnk = 0; Colour(Black); t = 0; i=0; LineStart(t,tnk); StepModel();
//executed in StepModel() u=demand/100; tnk=tnk+(-a*tnk+b*u)*dt; tout=pipe[i]; pipe[i]=tnk; i=i+1; if(i>99){i=0;} t = t + dt; Colour(Red); Spot(t, demand); Colour(Black); Spot(t, tout); if (t