148 CHAPTER 4. DEMONSTRATION EXAMPLES
comment gsim
mu nom "nominal closed loop sys: mu ctrl"
comment gsim
hinf nom "nominal closed loop sys: hinf ctrl"
comment gsim
lp nom "nominal closed loop sys: klp ctrl"
A step disturbance is introduced into the first channel.
time = 0:2:0.01
u = gstep(time) # a unit step is the default
u = [u;0*u] # put zero into the other channel
comment u "simulation input"
y
mu nom = gsim mu nom*u
y
hinf nom = gsim hinf nom*u
y
lp nom = gsim lp nom*u
comment y
mu nom "nominal response: mu ctrl"
comment y
hinf nom "nominal response: hinf ctrl"
comment y
lp nom "nominal response: klp ctrl"
All controllers perform well on the nominal system. This can be seen by plotting the
time histories of each.
gph7 = plot(y
mu nom,{rows=3,row=1,grid,...
title="Kmu step dist. response (nominal)",...
x
lab="time",y max=1.5,y min=-1 });
gph7 = plot(y
hinf nom,gph7, {row=2,grid,...
title="Kinf step dist. response (nominal)",...
x
lab="time",y max=1.5,y min=-1 });
gph7 = plot(y
lp nom,gph7,{row=3,grid,...
title="Klp step dist. response: (nominal)",...
x
lab="time",y max=1.5,y min=-1 })?