loopsens
Sensitivity functions of plantcontroller feedback loop
Syntax
Description
computes the multivariable sensitivity, complementary
sensitivity, and openloop transfer functions of the closedloop system consisting
of the controller loops
= loopsens(P
,C
)C
in negative feedback with the plant
P
. To compute the sensitivity functions for the system with positive
feedback, use loopsens(P,C)
.
Examples
Single Input, Single Output (SISO) Loop Sensitivities
Consider PI controller for a dominantly firstorder plant, with the closedloop bandwidth of 2.5 rads/sec. Since the problem is SISO, all gains are the same at input and output.
gamma = 2; tau = 1.5; taufast = 0.1; P = tf(gamma,[tau 1])*tf(1,[taufast 1]); tauclp = 0.4; xiclp = 0.8; wnclp = 1/(tauclp*xiclp); KP = (2*xiclp*wnclp*tau  1)/gamma; KI = wnclp^2*tau/gamma; C = tf([KP KI],[1 0]);
Form the closedloop (and openloop) systems with loopsens
, and plot Bode plots of the sensitivity functions at the plant input.
loops = loopsens(P,C); bode(loops.Si,'r',loops.Ti,'b',loops.Li,'g') legend('Sensitivity','Complementary Sensitivity','Loop Transfer')
Finally, compare the openloop plant gain to the closedloop value of PSi
.
bodemag(P,'r',loops.PSi,'b') legend('Plant','Sensitivity*Plant')
Multi Input, Multi Output (MIMO) Loop Sensitivities
Consider an integral controller for a constantgain, 2input, 2output plant. For purposes of illustration, the controller is designed via inversion, with different bandwidths in each rotated channel.
P = ss([2 3;1 1]); BW = diag([2 5]); [U,S,V] = svd(P.d); % get SVD of Plant Gain Csvd = V*inv(S)*BW*tf(1,[1 0])*U'; % inversion based on SVD loops = loopsens(P,Csvd); bode(loops.So,'g',loops.To,'r',logspace(1,3,120)) title('Output Sensitivity (green), Output Complementary Sensitivity (red)');
Input Arguments
P
— Plant
dynamic system model  control design block  matrix
Plant, specified as a dynamic system model, control design block, or static gain
matrix. P
can be SISO or MIMO, as long as P*C
has the same number of inputs and outputs.
P
can be continuous time or discrete time. If
P
is a generalized model (such as genss
or
uss
) then loopsens
uses the current or
nominal value of all control design blocks in P
.
C
— Controller
dynamic system model  control design block  constant matrix
Controller, specified as a dynamic system model, control design block, or static
gain matrix. The controller can be any of the model types that P
can be, as long as P*C
has the same number of inputs and outputs.
loopsens
computes the sensitivity
functions assuming a negativefeedback closedloop system. To compute the
sensitivity functions for the system with positive feedback, use
loopsens(P,C)
.
The loopsens
command assumes onedegreeoffreedom control
architecture. If you have a twodegreeoffreedom architecture, then construct
C
to include only the compensator in the feedback path, not any
reference channels.
Output Arguments
loops
— Sensitivity functions
structure
Sensitivity functions of the feedback loop
feedback(P,C)
, returned in a structure having the fields shown in
the table below. The sensitivity functions are returned as statespace
(ss
) models of the same I/O dimensions as C*P
. If
P
or C
is a frequencyresponsedata model,
then the sensitivity functions are frd
models.
Field  Description 

Si  Inputtoplant sensitivity function. 
Ti  Inputtoplant complementary sensitivity function. 
Li  Inputtoplant loop transfer function. 
So  Outputtoplant sensitivity function. 
To  Outputtoplant complementary sensitivity function. 
Lo  Outputtoplant loop transfer function. 
PSi  Plant times inputtoplant sensitivity function. 
CSo  Compensator times outputtoplant sensitivity function. 
Poles  Poles of the closed loop 
Stable  1 if nominal closed loop is stable, 0 otherwise. If either

More About
Sensitivity functions
The closedloop interconnection structure shown below defines the
input/output sensitivity, complementary sensitivity, and loop transfer functions. The
structure includes multivariable systems in which P
and
C
are MIMO systems.
The following table gives the values of the input and output sensitivity functions for this control structure.
Description  Equation 

Input sensitivity S_{i} (closedloop transfer function from d_{1} to e_{1})  S_{i} = (I + CP)^{–1} 
Input complementary sensitivity T_{i} (closedloop transfer function from d_{1} to e_{2})  T_{i} = CP(I + CP)^{–1} 
Output sensitivity S_{o} (closedloop transfer function from d_{2} to e_{2})  S_{o} = (I + PC)^{–1} 
Output complementary sensitivity T_{o} (closedloop transfer function from d_{2} to e_{4})  T_{o} = PC(I + PC)^{–1} 
Input loop transfer function L_{i}  L_{i} = CP 
Output loop transfer function L_{o}  L_{o} = PC 
Version History
Introduced before R2006a
See Also
diskmargin
 robstab
 wcgain
 wcdiskmargin
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
 América Latina (Español)
 Canada (English)
 United States (English)
Europe
 Belgium (English)
 Denmark (English)
 Deutschland (Deutsch)
 España (Español)
 Finland (English)
 France (Français)
 Ireland (English)
 Italia (Italiano)
 Luxembourg (English)
 Netherlands (English)
 Norway (English)
 Österreich (Deutsch)
 Portugal (English)
 Sweden (English)
 Switzerland
 United Kingdom (English)