122 CHAPTER 3. FUNCTIONAL DESCRIPTION OF Xµ
A greater range of model reduction functions is available in the Model Reduction
Module. Some of the functions described here are cross-licensed with that module.
Section 2.6 describes the theory behind these functions.
3.8.1 Truncation and ResidualizationTruncation is providedby the truncate function (cross-licensed with the Model
Reduction Module). Residualization is performed with the Xµfunction: sresidualize.
The user must specify the original system and the number of states to be retained. In
both cases the states in the upper left corner of the Amatr ix are retained.
The following example illustrates the use of these functions and gives anidea of their
error properties.
# 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)
# Reduce to a 3 state system by residualization
# and truncation.
sysout1 = sresidualize(sys1,3)
sysout2 = truncate(sys1,3)
fHz = logspace(0.01,100,100)
sys1g = freq(sys1,fHz)
sysout1g = freq(sysout1,fHz)
sysout2g = freq(sysout2,fHz)
residerror = sys1g - sysout1g
truncerror = sys1g - sysout2g
g1 = ctrlplot(sys1g,{logmagplot});
g1 = ctrlplot(sysout1g,g1,{logmagplot,linestyle=2});