T = getCompSensitivity(CL,location) returns
the complementary
sensitivity measured at the specified location for a generalized
model of a control system.

T = getSensitivity(CL,location,opening) specifies
loop openings for the complementary sensitivity function calculation.
Use an opening, for example, to calculate the complementary sensitivity
function of an inner loop, with the outer loop open.

If opening and location list
the same point, the software opens the loop after adding the disturbance
signal at the point.

Compute the complementary sensitivity at the
plant output, X.

Create a model of the system by specifying and connecting
a numeric LTI plant model G, a tunable controller C,
and the loopswitch block X.
Use the loopswitch block to mark the location where you assess the
complementary sensitivity (plant output in this example).

G = tf([1],[1 5]);
C = ltiblock.pid('C','p');
C.Kp.Value = 3;
X = loopswitch('X');
CL = feedback(G*C,X);

CL is a genss model that
represents the closed-loop response of the control system from r to y.
The model contains the loopswitch block, X,
that identifies the potential loop-opening location.

Calculate the complementary sensitivity, T,
at X.

T = getCompSensitivity(CL,'X');
tf(T)

ans =
From input "X" to output "X":
-3
-----
s + 8
Continuous-time transfer function.

Calculate the inner-loop sensitivity at the
output of G2, with the outer loop open.

Create a model of the system by specifying and connecting
the numeric plant models, tunable controllers, and loopswitch blocks. G1 and G2 are
plant models, C1 and C2 are
tunable controllers, and X1 and X2 are loopswitch blocks
that mark potential loop-opening locations.

Model of a control system, specified as a Generalized State-Space
Model (genss).

Locations at which you can perform sensitivity analysis or open
loops are marked by loopswitch blocks in CL.
Use getPoints(CL) to get the list of such locations.

Location at which you calculate the complementary sensitivity function,
specified as a string or cell array of strings. To extract the complementary
sensitivity function at multiple locations, use a cell array of strings.

Each string in location must match an analysis
point in CL. Analysis points are marked using loopswitch blocks.
Use getPoints(CL) to get the list of available
analysis points in CL.

Additional loop opening used to calculate the complementary
sensitivity function, specified as a string or cell array of
strings. To open the loop at multiple locations, use a cell array
of strings.

Each string in opening must match an analysis
point in CL. Analysis points are marked using loopswitch blocks.
Use getPoints(CL) to get the list of available
analysis points in CL.

Use an opening, for example, to calculate the complementary
sensitivity function of an inner loop, with the outer loop open.

If opening and location list
the same point, the software opens the loop after adding the disturbance
signal at the point.

The complementary sensitivity function, T,
at a point is the closed-loop transfer function around the feedback
loop measured at the specified location. It is related to the open-loop
transfer function, L, and the sensitivity function, S,
at the same point as follows:

The complementary sensitivity, T, at y is
defined as the transfer function from dy to y.

Observe that, in contrast to the sensitivity function, the disturbance, dy,
is added after the measurement, y.

Here, I is an identity matrix of the same
size as GK.
The complementary sensitivity transfer function at y is
equal to -1 times the closed-loop transfer function
from r to y.

Complementary sensitivity at multiple locations, for example, u and y,
is defined as the MIMO transfer function from the disturbances to
measurements: