Chapter 22: Sensitivity, Complementary Sensitivity, and Trade-Offs
Lesson 3: Relationships Between S, T, and Loop Gain
In this lesson we analyze the precise algebraic and frequency-domain relationships between the sensitivity function \( S(s) \), the complementary sensitivity function \( T(s) \), and the loop transfer function \( L(s) \) of a unity-feedback control system. These relations are the core of classical robust servo design and will be used heavily in later lessons on fundamental trade-offs and robustness.
1. Closed-Loop Architecture and Definitions
We consider a standard unity-feedback configuration with plant \( P(s) \) and controller \( C(s) \). The loop transfer function is
\[ L(s) = C(s) P(s). \]
For unity feedback (feedback path transfer equal to 1), the closed-loop transfer from reference input \( r(s) \) to output \( y(s) \) is
\[ T(s) = \frac{Y(s)}{R(s)} = \frac{L(s)}{1 + L(s)}. \]
The error signal is \( e(s) = r(s) - y(s) \), and the sensitivity function is
\[ S(s) = \frac{E(s)}{R(s)} = \frac{1}{1 + L(s)}. \]
For multi-input multi-output (MIMO) systems, the scalar quantities generalize to matrices. With loop matrix \( L(s) \in \mathbb{C}^{m\times m} \), we have
\[ S(s) = \left(I + L(s)\right)^{-1}, \quad T(s) = L(s)\left(I + L(s)\right)^{-1}. \]
These definitions assume internal stability of the closed loop (all closed-loop poles in the open left half-plane), otherwise \( S(s) \) and \( T(s) \) are not bounded and lose their robustness interpretation.
flowchart TD
R["r(s)"] --> SUM["+ node"]
SUM --> C["C(s)"]
C --> P["P(s)"]
P --> Y["y(s)"]
Y --> FB["feedback (1)"]
FB --> SUM
C -. "L(s) = C(s) P(s)" .- P
R -. "S(s) = 1/(1+L(s))" .- SUM
R -. "T(s) = L(s)/(1+L(s))" .- Y
2. Core Algebraic Identities Between \( S \), \( T \), and \( L \)
In SISO form, inserting the definitions \( S(s) = 1/(1+L(s)) \) and \( T(s) = L(s)/(1+L(s)) \) immediately yields
\[ S(s) + T(s) = \frac{1}{1 + L(s)} + \frac{L(s)}{1 + L(s)} = \frac{1 + L(s)}{1 + L(s)} = 1. \]
Thus, for any frequency \( s \) where the closed loop is well defined, we have the fundamental identity \( S(s) + T(s) = 1 \). In MIMO notation this becomes
\[ S(s) + T(s) = I, \quad S(s) = \left(I + L(s)\right)^{-1}, \quad T(s) = L(s)\left(I + L(s)\right)^{-1}. \]
Another useful identity is obtained by eliminating \( 1 + L(s) \). From \( S(s) = 1/(1+L(s)) \) we have \( 1 + L(s) = 1/S(s) \), so
\[ T(s) = \frac{L(s)}{1 + L(s)} = L(s) S(s). \]
Combining these relations we obtain several equivalent characterizations:
\[ \begin{aligned} S(s) &= 1 - T(s), \\ T(s) &= L(s) S(s), \\ L(s) &= T(s) S(s)^{-1} \quad\text{(where \( S(s) \) is invertible).} \end{aligned} \]
For MIMO systems the identity \( T = L S \) remains valid with matrix multiplication and \( S = (I+L)^{-1} \). The operations are well defined wherever \( I + L(s) \) is nonsingular.
These algebraic equalities imply that specifying any one of \( S \), \( T \), or \( L \) uniquely determines the other two (subject to stability). Hence performance constraints expressed on \( S \) or \( T \) translate directly into constraints on the loop gain \( L \).
3. Frequency-Domain Magnitudes and Phases
In frequency-domain analysis we evaluate at \( s = j\omega \). Denote \( L(j\omega) \) simply by \( L \) for brevity. Then
\[ S(j\omega) = \frac{1}{1 + L}, \quad T(j\omega) = \frac{L}{1 + L}. \]
Taking magnitudes, we obtain
\[ |S(j\omega)| = \frac{1}{|1 + L(j\omega)|}, \quad |T(j\omega)| = \frac{|L(j\omega)|}{|1 + L(j\omega)|} = |L(j\omega)|\,|S(j\omega)|. \]
Two important asymptotic regimes follow directly from these expressions:
- Low frequency, large loop gain: if \( |L(j\omega)| \gg 1 \), then \( |S(j\omega)| \approx 1/|L(j\omega)| \ll 1 \) and \( |T(j\omega)| \approx 1 \). The closed loop tracks references well (since \( T \approx 1 \)) and rejects low-frequency disturbances (since \( S \) is small).
- High frequency, small loop gain: if \( |L(j\omega)| \ll 1 \), then \( |S(j\omega)| \approx 1 \) and \( |T(j\omega)| \approx |L(j\omega)| \ll 1 \). The loop behaves almost open loop, and high-frequency sensor noise is attenuated by \( T \).
In decibels, for SISO systems,
\[ 20\log_{10}|T(j\omega)| = 20\log_{10}|L(j\omega)| - 20\log_{10}|1 + L(j\omega)|. \]
For frequencies where the phase of \( L(j\omega) \) is close to \( -180^\circ \), the term \( 1 + L(j\omega) \) can be small even if \( |L(j\omega)| \) is moderate. This leads to peaks in \( |S(j\omega)| \) and \( |T(j\omega)| \) near the closed-loop bandwidth and is closely related to stability margins studied in earlier chapters.
4. Design Viewpoint — Choosing \( L \) Implies \( S \) and \( T \)
The loop-shaping paradigm (Chapter 21) designs \( L(s) \) in the frequency domain to achieve required tracking, disturbance rejection, and noise attenuation. The identities from Section 2 clarify that any design choice for \( L(s) \) automatically fixes \( S(s) \) and \( T(s) \):
\[ S(s) = \frac{1}{1 + L(s)}, \quad T(s) = \frac{L(s)}{1 + L(s)}. \]
Conversely, if specifications are given directly in terms of \( S(j\omega) \) and \( T(j\omega) \) (for example, bounds on their magnitude at certain frequencies), then \( L(j\omega) \) must be chosen to satisfy \( S + T = 1 \) and \( T = LS \) at every frequency. This gives a powerful way to move between frequency-domain inequalities on \( L \) and inequalities on \( S \), \( T \).
Conceptually, a loop-shaping workflow can be summarized as:
flowchart TD
REQ["Specify bounds on S(jw) and T(jw)"] --> MAP["Translate to desired L(jw) shape"]
MAP --> SYN["Synthesize C(s) so that L(s) = C(s)P(s)"]
SYN --> CHECK["Check S(s)=1/(1+L(s)) and T(s)=L(s)/(1+L(s))"]
CHECK --> ITER["Iterate until S,T meet robustness and performance specs"]
Later lessons will formalize these requirements (e.g. bounds on \( |S(j\omega)| \) and \( |T(j\omega)| \)) into quantitative trade-offs. Here we emphasize that the three transfer functions are not independent; they are tightly coupled via straightforward algebraic identities.
5. Python Implementation — Computing \( S \) and \( T \) for a Robot Joint Model
Consider a simplified single-joint robot axis modeled as
\( P(s) = \dfrac{1}{Js^2 + Bs} \) with inertia
\( J \) and viscous friction \( B \).
With a PD controller \( C(s) = K_p + K_d s \), we can
compute \( L, S, T \) using the
python-control and
roboticstoolbox-python ecosystems (the latter for more
realistic robot models in later chapters).
import numpy as np
import matplotlib.pyplot as plt
# Core control library
import control as ctl
# Robot joint parameters (simplified single-axis)
J = 0.01 # kg m^2
B = 0.1 # N m s/rad
# PD gains (typical for a servo joint)
Kp = 50.0
Kd = 2.0
# Plant and controller transfer functions
s = ctl.TransferFunction.s
P = 1.0 / (J * s**2 + B * s)
C = Kp + Kd * s
L = C * P # loop transfer
S = 1 / (1 + L) # sensitivity
T = L / (1 + L) # complementary sensitivity
# Bode magnitude plots of S and T
omega = np.logspace(-1, 3, 400)
magS, phaseS, wS = ctl.bode(S, omega, Plot=False)
magT, phaseT, wT = ctl.bode(T, omega, Plot=False)
plt.figure()
plt.loglog(wS, magS)
plt.loglog(wT, magT)
plt.xlabel("Frequency [rad/s]")
plt.ylabel("Magnitude")
plt.legend(["|S(jw)|", "|T(jw)|"])
plt.grid(True, which="both")
plt.title("Sensitivity and Complementary Sensitivity for a Robot Joint")
plt.show()
In more advanced robotic applications,
roboticstoolbox-python provides full manipulator models,
and the same construction of \( L, S, T \) can be
applied to each joint or to SISO channels extracted from the MIMO model.
6. C++ Implementation — Evaluating \(|S(j\omega)|\) and \(|T(j\omega)|\)
In C++-based robotics stacks (e.g., ROS control), low-level joint
controllers are often implemented in real-time C++. Below is a simple
offline numerical evaluation of \( |S(j\omega)| \) and
\( |T(j\omega)| \) for the same second-order plant and
PD controller, using the standard library <complex>.
Such routines are useful for design and analysis tools that accompany
embedded controllers.
#include <iostream>
#include <vector>
#include <complex>
#include <cmath>
int main() {
using std::complex;
using std::vector;
const double J = 0.01;
const double B = 0.1;
const double Kp = 50.0;
const double Kd = 2.0;
// Frequency grid (rad/s)
vector<double> omega;
for (int k = 0; k <= 400; ++k) {
double logw = -1.0 + 4.0 * (static_cast<double>(k) / 400.0); // from 10^-1 to 10^3
omega.push_back(std::pow(10.0, logw));
}
for (double w : omega) {
complex<double> jw(0.0, w);
// Plant P(jw) = 1 / (J (jw)^2 + B jw)
complex<double> denomP = J * jw * jw + B * jw;
complex<double> P = 1.0 / denomP;
// PD controller C(jw) = Kp + Kd jw
complex<double> C = Kp + Kd * jw;
complex<double> L = C * P;
complex<double> S = 1.0 / (1.0 + L);
complex<double> T = L / (1.0 + L);
double magS = std::abs(S);
double magT = std::abs(T);
// Example: print a few points around 10 rad/s
if (w > 9.5 && w < 10.5) {
std::cout << "w = " << w
<< " |S(jw)| = " << magS
<< " |T(jw)| = " << magT
<< std::endl;
}
}
return 0;
}
For integration into a robotics framework, the same calculations can be wrapped into analysis utilities that operate on joint dynamics identified from experiment or derived from rigid-body models using libraries such as Eigen and ROS control.
7. Java Implementation — Simple Loop Gain Analysis
Java is used in some robotics and automation platforms (for example,
high-level control in mobile robots or industrial automation). The
following code fragment uses a simple Complex helper class
to evaluate \( S(j\omega) \) and
\( T(j\omega) \).
class Complex {
public double re;
public double im;
public Complex(double re, double im) {
this.re = re;
this.im = im;
}
public Complex add(Complex other) {
return new Complex(this.re + other.re, this.im + other.im);
}
public Complex sub(Complex other) {
return new Complex(this.re - other.re, this.im - other.im);
}
public Complex mul(Complex other) {
return new Complex(
this.re * other.re - this.im * other.im,
this.re * other.im + this.im * other.re
);
}
public Complex inv() {
double den = re * re + im * im;
return new Complex(re / den, -im / den);
}
public double abs() {
return Math.hypot(re, im);
}
}
public class LoopGainST {
public static void main(String[] args) {
double J = 0.01;
double B = 0.1;
double Kp = 50.0;
double Kd = 2.0;
double w = 10.0; // example frequency [rad/s]
Complex jw = new Complex(0.0, w);
// P(jw) = 1 / (J (jw)^2 + B jw)
Complex denomP = new Complex(
-J * w * w, // real part of J (jw)^2 + B jw
B * w // imag part
);
Complex P = denomP.inv();
// C(jw) = Kp + Kd jw
Complex C = new Complex(Kp, Kd * w);
Complex L = C.mul(P);
Complex one = new Complex(1.0, 0.0);
Complex S = one.add(L).inv();
Complex T = L.mul(S);
System.out.println("|S(jw)| = " + S.abs());
System.out.println("|T(jw)| = " + T.abs());
}
}
For larger projects, linear algebra libraries such as EJML or Apache Commons Math are typically employed to work with state-space or transfer-function models of robotic subsystems; the same principles for computing \( L, S, T \) apply.
8. MATLAB/Simulink Implementation — Using Control System Toolbox
MATLAB and Simulink are standard tools in control-oriented robotics. The
following script constructs \( L, S, T \) for a joint
model and uses loopsens to obtain all sensitivity-related
transfer functions in a unified way.
% Robot joint parameters
J = 0.01;
B = 0.1;
s = tf('s');
P = 1 / (J * s^2 + B * s);
Kp = 50;
Kd = 2;
C = Kp + Kd * s;
L = C * P;
S = 1 / (1 + L);
T = L / (1 + L);
% Bode plot of S and T
w = logspace(-1, 3, 400);
figure;
bodemag(S, T, w);
legend('|S(jw)|', '|T(jw)|');
grid on;
title('Sensitivity and Complementary Sensitivity');
% Using loopsens for full closed-loop maps
% (useful when adding disturbance and noise inputs)
CL = loopsens(P, C);
% CL.Si is S(s), CL.So is output sensitivity, CL.Ti/To are complementary sensitivities
In Simulink, the same loop can be built with transfer function blocks
for
\( P(s) \) and \( C(s) \), and the
closed-loop behavior analyzed with Bode and step-response tools.
Sensitivity functions can be exported to the workspace via linearization
(linmod or linearize) for further analysis.
9. Wolfram Mathematica Implementation
In Wolfram Mathematica, transfer functions are represented via
TransferFunctionModel. The relationships between
\( S \), \( T \), and
\( L \) can be implemented symbolically or numerically.
(* Robot joint parameters *)
J = 0.01;
B = 0.1;
s = LaplaceTransformVariable;
P = TransferFunctionModel[1/(J s^2 + B s), s];
C = TransferFunctionModel[50 + 2 s, s];
L = SeriesConnect[C, P]; (* L(s) = C(s) P(s) *)
S = FeedbackConnect[1, L]; (* 1 / (1 + L(s)) *)
T = FeedbackConnect[L, 1]; (* L(s) / (1 + L(s)) *)
(* Frequency response magnitude plots *)
BodePlot[{S, T},
{0.1, 1000},
PlotLegends -> {"|S(jw)|", "|T(jw)|"},
GridLines -> Automatic
]
Symbolic manipulation in Mathematica is convenient for verifying algebraic identities such as \( S + T = 1 \) for more complex loop structures or for parameterized controllers used in robotic manipulators.
10. Problems and Solutions
Problem 1 (Derivation of S and T for Unity Feedback): Consider the unity-feedback system with plant \( P(s) \) and controller \( C(s) \). The input is \( r(s) \), the output \( y(s) \), and the error \( e(s) = r(s) - y(s) \). Derive formulas for \( S(s) = E(s)/R(s) \) and \( T(s) = Y(s)/R(s) \) in terms of \( L(s) = C(s)P(s) \).
Solution:
From the block diagram, \( u(s) = C(s)e(s) \) and \( y(s) = P(s)u(s) = P(s)C(s)e(s) = L(s)e(s) \). The error is \( e(s) = r(s) - y(s) = r(s) - L(s)e(s) \). Hence
\[ e(s) + L(s)e(s) = r(s) \quad\Rightarrow\quad e(s)\bigl(1 + L(s)\bigr) = r(s). \]
Therefore,
\[ S(s) = \frac{E(s)}{R(s)} = \frac{1}{1 + L(s)}. \]
The output is \( y(s) = L(s)e(s) \), so \( Y(s)/R(s) = L(s)E(s)/R(s) = L(s)/(1+L(s)) \), giving
\[ T(s) = \frac{Y(s)}{R(s)} = \frac{L(s)}{1 + L(s)}. \]
Thus both sensitivity and complementary sensitivity are rational functions of the loop transfer \( L(s) \).
Problem 2 (Identity \( S + T = 1 \) and \( T = LS \)): Using the expressions from Problem 1, prove that \( S(s) + T(s) = 1 \) and \( T(s) = L(s) S(s) \). Explain the physical meaning of \( S + T = 1 \) for reference tracking.
Solution:
From \( S(s) = 1/(1+L(s)) \) and \( T(s) = L(s)/(1+L(s)) \), we compute
\[ S(s) + T(s) = \frac{1}{1+L(s)} + \frac{L(s)}{1+L(s)} = \frac{1 + L(s)}{1 + L(s)} = 1. \]
Moreover,
\[ L(s) S(s) = L(s) \frac{1}{1 + L(s)} = \frac{L(s)}{1 + L(s)} = T(s). \]
Physically, \( S(s) \) is the closed-loop transfer from reference to error (\( e = Sr \)), while \( T(s) \) is the transfer from reference to output (\( y = Tr \)). The identity \( S + T = 1 \) implies
\[ e(s) + y(s) = r(s), \]
so at each frequency the reference is partitioned into an error part and an output part. Reducing \( |S(j\omega)| \) at some frequencies necessarily pushes \( |T(j\omega)| \) closer to 1 there, and vice versa.
Problem 3 (Low- and High-Frequency Behavior): Let \( L(s) = \dfrac{K}{s(s+1)} \) with positive gain \( K \). Compute \( S(s) \) and \( T(s) \), and determine their approximate magnitudes for \( \omega \to 0 \) and \( \omega \to \infty \).
Solution:
We have
\[ L(s) = \frac{K}{s(s+1)}, \quad S(s) = \frac{1}{1 + L(s)} = \frac{s(s+1)}{s(s+1) + K}, \quad T(s) = \frac{L(s)}{1 + L(s)} = \frac{K}{s(s+1) + K}. \]
Evaluate at \( s = j\omega \). For very low frequencies \( \omega \to 0 \), we have \( s(s+1) \approx 0 \), so
\[ S(j\omega) \approx \frac{0}{K} = 0, \quad T(j\omega) \approx \frac{K}{K} = 1. \]
Thus the loop tracks constant references well and the error tends to zero. For very high frequencies \( \omega \to \infty \), we have \( |s(s+1)| \approx \omega^2 \) large compared to \( K \), so
\[ S(j\omega) \approx \frac{s(s+1)}{s(s+1)} = 1, \quad T(j\omega) \approx \frac{K}{s(s+1)} \approx 0. \]
Hence the system behaves like open loop at high frequencies, which is desirable for noise attenuation but implies poor tracking of rapidly varying references.
Problem 4 (MIMO Matrix Identities): Let \( L(s) \in \mathbb{C}^{m\times m} \) be a loop matrix for a multivariable system, and define \( S(s) = (I + L(s))^{-1} \), \( T(s) = L(s)(I + L(s))^{-1} \). Prove that \( S(s) + T(s) = I \) and \( T(s) = L(s) S(s) \). Why does this require \( I + L(s) \) to be invertible?
Solution:
By definition,
\[ S(s) + T(s) = (I + L(s))^{-1} + L(s)(I + L(s))^{-1} = \bigl(I + L(s)\bigr)(I + L(s))^{-1} = I. \]
Moreover,
\[ L(s) S(s) = L(s)(I + L(s))^{-1} = T(s). \]
Both derivations use the fact that \( I + L(s) \) is invertible so that its inverse exists and satisfies \( (I + L)(I + L)^{-1} = I \). If \( I + L(s) \) were singular for some \( s \), then \( S(s) \) and \( T(s) \) would be ill-defined or unbounded, which corresponds to loss of internal stability of the feedback system.
Problem 5 (Constraint on S and T Magnitudes): For a SISO system, suppose at some frequency \( \omega_0 \) we require simultaneously \( |S(j\omega_0)| \leq 0.1 \) and \( |T(j\omega_0)| \leq 0.5 \). Show that these two requirements are incompatible with the identity \( S + T = 1 \).
Solution:
At frequency \( \omega_0 \), we have \( S_0 = S(j\omega_0) \) and \( T_0 = T(j\omega_0) \) satisfying \( S_0 + T_0 = 1 \). Using the triangle inequality,
\[ 1 = |1| = |S_0 + T_0| \leq |S_0| + |T_0|. \]
If the requirements held, then \( |S_0| + |T_0| \leq 0.1 + 0.5 = 0.6 \), which contradicts \( |S_0| + |T_0| \geq 1 \). Hence the simultaneous bounds \( |S| \leq 0.1 \) and \( |T| \leq 0.5 \) at the same frequency are impossible for any stable unity-feedback loop and any controller \( C(s) \). This illustrates that improving disturbance rejection (\( S \) small) and noise attenuation (\( T \) small) cannot both be arbitrarily good at the same frequency.
11. Summary
In this lesson we established the foundational algebraic and frequency-domain relationships between the sensitivity function \( S \), the complementary sensitivity function \( T \), and the loop gain \( L \) for unity-feedback linear control systems. The identities \( S = 1/(1+L) \), \( T = L/(1+L) \), \( S + T = 1 \), and \( T = LS \) show that designing \( L \) automatically determines \( S \) and \( T \), and that specifications on \( S \) and \( T \) can be translated into loop-shaping constraints on \( L \).
We analyzed low- and high-frequency behavior, clarified why large low-frequency loop gain yields small sensitivity (good tracking and disturbance rejection) while small high-frequency loop gain yields small complementary sensitivity (good noise attenuation), and implemented numerical evaluations of \( S \) and \( T \) in Python, C++, Java, MATLAB/Simulink, and Mathematica with a robotics-motivated joint model. These concepts form the basis for the fundamental trade-offs and constraints on closed-loop performance that will be treated in the next lesson.
12. References
- Bode, H. W. (1945). Network Analysis and Feedback Amplifier Design. Van Nostrand.
- Horowitz, I. M. (1963). Synthesis of feedback systems by asymptotic optimization. Proceedings of the Institution of Electrical Engineers, 110(10), 1545–1552.
- Middleton, R. H., & Goodwin, G. C. (1986). Improved finite word length characteristics in digital control using delta operators. IEEE Transactions on Automatic Control, 31(11), 1015–1021.
- Åström, K. J., & Hägglund, T. (1984). Automatic tuning of simple regulators with specifications on phase and amplitude margins. Automatica, 20(5), 645–651.
- Åström, K. J., & Hägglund, T. (1987). New tuning methods for PID controllers. IFAC Proceedings Volumes, 20(7), 245–250.
- Safonov, M. G., & Athans, M. (1977). Gain and phase margin for multiloop LQG regulators. IEEE Transactions on Automatic Control, 22(2), 173–179.
- Doyle, J. C., Francis, B. A., & Tannenbaum, A. R. (1992). Feedback Control Theory. Macmillan.
- Zhou, K., Doyle, J. C., & Glover, K. (1996). Robust and Optimal Control. Prentice Hall.
- Skogestad, S., & Postlethwaite, I. (2005). Multivariable Feedback Control: Analysis and Design (2nd ed.). Wiley.