S = getSensitivity(T,location,opening) specifies
additional loop openings for the sensitivity function calculation.
Use an opening, for example, to calculate the 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 measuring the signal
at the point.

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
sensitivity (plant input in this example).

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

T 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 sensitivity, S, at X.

S = getSensitivity(T,'X');
tf(S)

ans =
From input "X" to output "X":
s + 5
-----
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 T.
Use getPoints(T) to get the list of such locations.

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

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

Additional loop opening used to calculate the 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 T. Analysis points are marked using loopswitch blocks.
Use getPoints(T) to get the list of available analysis
points in T.

Use an opening, for example, to calculate the 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 measuring the signal
at the point.

The sensitivity function,
also referred to simply as sensitivity, measures
how sensitive a signal is to an added disturbance. Feedback reduces
the sensitivity in the frequency band where the open-loop gain is
greater than 1.

Consider the following model:

The sensitivity, S_{u},
at u is defined as the transfer function from du to u:

Here, I is an identity matrix of the same
size as KG.

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