316 Chapter 6. Function Reference
Uses additional subroutines ophiter,ophred,ophmult and stable.
This function is cross-licensed from the Model Reduction Module.
Example
# Create a five state system for reduction.
a = daug(-0.891334,[-1.20857,0.799042;-0.799042,-1.20857],...
-4.74685,-21.3013)
b = [0.0262569;-0.189601;-0.113729;0.211465;-0.538239]
c = [0.120725,-0.336942,0.397198,-0.700524,-1.02235]
d=0
sys1 = system(a,b,c,d)
fHz = logspace(0.01,100,100)
sys1g = freq(sys1,fHz)
# Reduce to 3 states by Hankel norm approximation
[sysout1,hsv] = ophank(sys1,{nsr=3})
sysout1g = freq(sysout1,fHz)
balerr = sys1g - sysout1g
# Reduce to a 3 state system by residualization
# for comparison purposes.
sysout2 = sresidualize(sys1,3)
sysout2g = freq(sysout2,fHz)
residerror = sys1g - sysout2g
gph1 = ctrlplot([sys1g,sysout1g,sysout2g,...
balerr,residerror],{logmagplot});
gph1 = plot(gph1,{!grid,legend=["original system";...
"reduced: ophank";"reduced: sresidualize";...
"ophank error";"sresidualize error"]})?