% SISO system example ch17ex1_script % gpnum=[-54.68 4.05]; gpden=[ 675 63.5 1 ]; sys=tf(gpnum,gpden); model1=ss(sys); Ts=5; %Sampling time Tstop=60; %Simulation time % prediction model model=c2d(model1,Ts); p=30; moves=3; umin=-Inf; umax=Inf; dumin=-Inf; dumax=Inf; ymin=-Inf; ymax=Inf; limits={umin,umax,dumin,dumax,ymin,ymax}; weights={[0.001],[1],[1]}; clear MPCadd MPCadd.mvindex=[1]; open_system('ch17ex1.mdl') sim('ch17ex1',Tstop)