Chapter 28: Performance Measures and Quadratic Forms

Lesson 1: Quadratic Forms in State and Input Variables

This lesson introduces quadratic forms as the mathematical language used to describe state deviation, control effort, and mixed state-input penalties in modern control. We develop the algebraic, geometric, and energy-like interpretations of expressions such as \( x^\top Qx \), \( u^\top Ru \), and \( x^\top Qx+2x^\top Nu+u^\top Ru \). These ideas will support later lessons on weighting matrices, performance indices, and optimal state-feedback design.

1. Why Quadratic Forms Appear in Control Performance

In earlier chapters, we studied state-space models, stability, controllability, observability, state feedback, integral action, and reference tracking. These ideas answer questions such as whether a system can be stabilized or whether a state can be reached. Performance analysis asks a different question:

How large are the state deviations and control actions during the motion?

For a continuous-time LTI system \( \dot{x}=Ax+Bu \), where \( x(t)\in\mathbb{R}^n \) and \( u(t)\in\mathbb{R}^m \), a common instantaneous performance density is

\[ \ell(x,u)=x^\top Qx+u^\top Ru. \]

Here \( Q\in\mathbb{R}^{n\times n} \) weights the states, and \( R\in\mathbb{R}^{m\times m} \) weights the inputs. A finite-horizon accumulated performance measure is

\[ J_T=\int_0^T \left(x(t)^\top Qx(t)+u(t)^\top Ru(t)\right)\,dt. \]

This lesson does not yet design an optimal controller. Instead, it develops the mathematical objects used to describe performance. The key idea is that quadratic forms give scalar measures of vector size, direction, anisotropy, and energy-like behavior.

flowchart TD
  A["State trajectory x(t)"] --> B["State quadratic form xT Q x"]
  C["Input signal u(t)"] --> D["Input quadratic form uT R u"]
  B --> E["Instantaneous performance density"]
  D --> E
  E --> F["Integrate over time"]
  F --> G["Performance index J"]
  G --> H["Later: compare controllers or design feedback"]
        

2. Definition of a Quadratic Form

Let \( z\in\mathbb{R}^p \) and \( M\in\mathbb{R}^{p\times p} \). A quadratic form is the scalar function

\[ q(z)=z^\top Mz. \]

Written componentwise,

\[ z^\top Mz=\sum_{i=1}^{p}\sum_{j=1}^{p}m_{ij}z_i z_j. \]

Although \( M \) may be nonsymmetric, only its symmetric part affects the quadratic form. Define

\[ M_s=\frac{1}{2}(M+M^\top),\qquad M_a=\frac{1}{2}(M-M^\top). \]

Then \( M_s^\top=M_s \) and \( M_a^\top=-M_a \). Since \( z^\top M_a z \) is a scalar,

\[ z^\top M_a z=(z^\top M_a z)^\top=z^\top M_a^\top z =-z^\top M_a z. \]

Therefore,

\[ z^\top M_a z=0,\qquad z^\top Mz=z^\top M_s z. \]

Thus, in performance measures, we can assume the weighting matrices are symmetric without loss of generality.

3. Positive Definiteness and Positive Semidefiniteness

A symmetric matrix \( M=M^\top \) is called positive definite if

\[ z^\top Mz > 0,\qquad \forall z\neq 0. \]

It is called positive semidefinite if

\[ z^\top Mz\geq 0,\qquad \forall z. \]

We use the notation \( M\succ 0 \) for positive definite and \( M\succeq 0 \) for positive semidefinite. In control performance problems, the usual assumptions are

\[ Q\succeq 0,\qquad R\succ 0. \]

The condition \( Q\succeq 0 \) means the state penalty never rewards state deviation. The condition \( R\succ 0 \) means every nonzero control input has strictly positive cost.

Eigenvalue characterization. If \( M=M^\top \), then there exists an orthogonal matrix \( U \) and a real diagonal matrix \( \Lambda \) such that \( M=U\Lambda U^\top \). Let \( y=U^\top z \). Then

\[ z^\top Mz=z^\top U\Lambda U^\top z =y^\top\Lambda y=\sum_{i=1}^{p}\lambda_i y_i^2. \]

Hence \( M\succ 0 \) exactly when all eigenvalues satisfy \( \lambda_i>0 \), and \( M\succeq 0 \) exactly when all eigenvalues satisfy \( \lambda_i\geq 0 \).

4. State and Input Quadratic Forms

Consider a state vector \( x=[x_1,\dots,x_n]^\top \) and an input vector \( u=[u_1,\dots,u_m]^\top \). The state quadratic form is

\[ q_x(x)=x^\top Qx. \]

If \( Q \) is diagonal,

\[ Q=\operatorname{diag}(q_1,\dots,q_n), \qquad x^\top Qx=\sum_{i=1}^{n}q_i x_i^2. \]

A larger \( q_i \) means that the corresponding state component is penalized more strongly. For example, if \( x_1 \) is position error and \( x_2 \) is velocity error, then \( Q=\operatorname{diag}(100,1) \) penalizes position error much more severely than velocity error.

The input quadratic form is

\[ q_u(u)=u^\top Ru. \]

If \( R=\operatorname{diag}(r_1,\dots,r_m) \), then

\[ u^\top Ru=\sum_{j=1}^{m}r_j u_j^2. \]

Large entries of \( R \) discourage large actuator commands. This is important because real actuators have saturation, thermal, bandwidth, and power limits.

5. Geometric Interpretation: Ellipsoids and Weighted Norms

If \( Q\succ 0 \), then the set

\[ \mathcal{E}_c=\{x\in\mathbb{R}^n:x^\top Qx\leq c\} \]

is an ellipsoid centered at the origin. When \( Q=I \), the set is a sphere:

\[ x^\top Ix=x^\top x=\|x\|_2^2. \]

If \( Q=U\Lambda U^\top \), then

\[ x^\top Qx=(U^\top x)^\top\Lambda(U^\top x) =\sum_{i=1}^{n}\lambda_i y_i^2,\qquad y=U^\top x. \]

The eigenvectors of \( Q \) give the principal directions of the ellipsoid, and the eigenvalues determine how strongly motion along each direction is penalized.

flowchart TD
  A["Choose Q"] --> B["Find eigenvectors"]
  A --> C["Find eigenvalues"]
  B --> D["Principal directions of ellipsoid"]
  C --> E["Penalty strength along each direction"]
  D --> F["Weighted state geometry"]
  E --> F
        

Therefore, a quadratic form is more than a scalar number: it defines a geometry on the state space. This geometry tells us which directions are cheap and which directions are expensive.

6. Quadratic Forms as Weighted Norms

If \( Q\succ 0 \), then

\[ \|x\|_Q=\sqrt{x^\top Qx} \]

defines a norm. We verify the key properties:

Nonnegativity and definiteness.

\[ \|x\|_Q\geq 0,\qquad \|x\|_Q=0 \Longleftrightarrow x^\top Qx=0 \Longleftrightarrow x=0. \]

Homogeneity.

\[ \|\alpha x\|_Q=\sqrt{(\alpha x)^\top Q(\alpha x)} =|\alpha|\sqrt{x^\top Qx} =|\alpha|\|x\|_Q. \]

Triangle inequality. Since \( Q\succ 0 \), there exists a nonsingular matrix \( L \) such that \( Q=L^\top L \). Then

\[ \|x+y\|_Q=\|L(x+y)\|_2 \leq \|Lx\|_2+\|Ly\|_2 =\|x\|_Q+\|y\|_Q. \]

Therefore, a positive definite quadratic form defines a legitimate weighted norm.

7. Combined State-Input Quadratic Forms

A more general performance density may include a cross term between state and input:

\[ \ell(x,u)=x^\top Qx+2x^\top Nu+u^\top Ru. \]

This expression can be written as one block quadratic form:

\[ \ell(x,u)= \begin{bmatrix}x\\u\end{bmatrix}^{\top} \begin{bmatrix}Q&N\\N^\top&R\end{bmatrix} \begin{bmatrix}x\\u\end{bmatrix}. \]

Define the block weighting matrix

\[ W=\begin{bmatrix}Q&N\\N^\top&R\end{bmatrix}. \]

For the instantaneous cost to be nonnegative for all \( x \) and \( u \), we require

\[ W\succeq 0. \]

If \( R\succ 0 \), then the Schur complement gives the equivalent condition

\[ W\succeq 0 \Longleftrightarrow R\succ 0 \quad\text{and}\quad Q-NR^{-1}N^\top\succeq 0. \]

8. Completing the Square

Assume \( R\succ 0 \). The mixed quadratic form

\[ x^\top Qx+2x^\top Nu+u^\top Ru \]

can be rewritten by completing the square:

\[ x^\top Qx+2x^\top Nu+u^\top Ru = \left(u+R^{-1}N^\top x\right)^\top R \left(u+R^{-1}N^\top x\right) +x^\top\left(Q-NR^{-1}N^\top\right)x. \]

Proof. Expand the first term:

\[ \begin{aligned} &\left(u+R^{-1}N^\top x\right)^\top R \left(u+R^{-1}N^\top x\right)\\ &=u^\top Ru+u^\top N^\top x+x^\top Nu +x^\top NR^{-1}N^\top x\\ &=u^\top Ru+2x^\top Nu+x^\top NR^{-1}N^\top x. \end{aligned} \]

Adding the remaining term \( x^\top(Q-NR^{-1}N^\top)x \) gives the original expression. This identity is important because it separates the effect of the shifted input from the remaining state-only penalty.

9. Coordinate Transformations and Scaling

Suppose we change state coordinates by \( x=Tz \), where \( T \) is nonsingular. Then

\[ x^\top Qx=(Tz)^\top Q(Tz)=z^\top(T^\top QT)z. \]

Therefore, the same physical penalty has a different matrix representation in the new coordinates:

\[ Q_z=T^\top QT. \]

This is extremely important in modern control. A poorly scaled state vector can make a reasonable physical penalty look numerically ill conditioned. If one state is measured in meters and another in millimeters, then the raw numerical magnitudes may be very different even when the physical deviations are comparable.

A practical normalization is to divide each state by an acceptable maximum magnitude:

\[ \bar{x}_i=\frac{x_i}{x_{i,\max} }. \]

Then a simple penalty \( \bar{x}^\top\bar{x} \) corresponds to

\[ \bar{x}^\top\bar{x}=x^\top D^{-2}x, \qquad D=\operatorname{diag}(x_{1,\max},\dots,x_{n,\max}). \]

Thus, normalization naturally produces a physically meaningful weighting matrix \( Q=D^{-2} \).

10. Quadratic Performance Along a State Trajectory

Let a closed-loop system be

\[ \dot{x}=(A-BK)x,\qquad u=-Kx. \]

For a fixed feedback gain \( K \), the performance density becomes a state-only quadratic form:

\[ \ell(x,-Kx)=x^\top Qx+(-Kx)^\top R(-Kx) =x^\top(Q+K^\top RK)x. \]

Hence the accumulated cost is

\[ J_T=\int_0^T x(t)^\top(Q+K^\top RK)x(t)\,dt. \]

This formula shows the performance trade-off clearly. Moving the state rapidly toward the origin may reduce the state term \( x^\top Qx \), but it may require larger input action, increasing \( u^\top Ru \).

11. Software Libraries and Implementation Notes

Quadratic forms are easy to implement, but numerical reliability depends on using symmetric matrix operations, eigenvalue checks, and appropriate linear solvers. The following libraries are useful:

  • Python: NumPy for matrix algebra, SciPy for eigenvalue checks and integration, matplotlib for ellipsoid visualization, and python-control for later control-system design.
  • C++: Eigen for dense linear algebra, symmetric eigenvalue solvers, and Cholesky factorization.
  • Java: EJML or Apache Commons Math for larger matrix computations; small examples can be implemented directly with arrays.
  • MATLAB/Simulink: base MATLAB for quadratic forms, Control System Toolbox for state-space simulation, and Simulink for block-level implementation of quadratic performance integrals.
  • Wolfram Mathematica: symbolic matrix algebra, eigenvalue analysis, completing the square, and contour visualization.

12. Python Implementation

Chapter28_Lesson1.py


"""
Chapter28_Lesson1.py

Quadratic forms in state and input variables for modern control.
"""

import numpy as np
from scipy.integrate import solve_ivp


def symmetrize(M: np.ndarray) -> np.ndarray:
    """Return the symmetric part of M."""
    return 0.5 * (M + M.T)


def eig_definiteness(M: np.ndarray, tol: float = 1e-10) -> str:
    """Classify a real symmetric matrix using its eigenvalues."""
    S = symmetrize(M)
    eigs = np.linalg.eigvalsh(S)

    if np.all(eigs > tol):
        return "positive definite"
    if np.all(eigs >= -tol):
        return "positive semidefinite"
    if np.all(eigs < -tol):
        return "negative definite"
    if np.all(eigs <= tol):
        return "negative semidefinite"
    return "indefinite"


def quadratic_form(z: np.ndarray, M: np.ndarray) -> float:
    """Compute z^T M z."""
    z = np.asarray(z, dtype=float).reshape(-1, 1)
    return float(z.T @ M @ z)


def stage_cost(x: np.ndarray, u: np.ndarray,
               Q: np.ndarray, R: np.ndarray,
               N: np.ndarray | None = None) -> float:
    """Compute l(x,u)=x^T Q x + 2 x^T N u + u^T R u."""
    x = np.asarray(x, dtype=float).reshape(-1, 1)
    u = np.asarray(u, dtype=float).reshape(-1, 1)

    value = float(x.T @ Q @ x + u.T @ R @ u)

    if N is not None:
        value += float(2.0 * x.T @ N @ u)

    return value


def complete_square(Q: np.ndarray, R: np.ndarray,
                    N: np.ndarray) -> tuple[np.ndarray, np.ndarray]:
    """
    For R positive definite:
        x^T Q x + 2 x^T N u + u^T R u
      = (u + R^{-1}N^T x)^T R (u + R^{-1}N^T x)
        + x^T(Q - N R^{-1}N^T)x.
    """
    Rinv_NT = np.linalg.solve(R, N.T)
    Schur = Q - N @ Rinv_NT
    return Rinv_NT, Schur


def simulate_closed_loop_cost(A: np.ndarray, B: np.ndarray, K: np.ndarray,
                              Q: np.ndarray, R: np.ndarray,
                              x0: np.ndarray, tf: float = 10.0) -> float:
    """
    Simulate x_dot = (A-BK)x, u=-Kx, and integrate
    J = int_0^tf (x^T Q x + u^T R u) dt.
    """
    n = A.shape[0]

    def rhs(t, z):
        x = z[:n].reshape(n, 1)
        u = -K @ x
        dx = (A @ x + B @ u).ravel()
        dJ = stage_cost(x, u, Q, R)
        return np.r_[dx, dJ]

    z0 = np.r_[x0.ravel(), 0.0]
    sol = solve_ivp(rhs, [0.0, tf], z0, rtol=1e-9, atol=1e-11)
    return float(sol.y[-1, -1])


if __name__ == "__main__":
    A = np.array([[0.0, 1.0],
                  [-2.0, -0.4]])

    B = np.array([[0.0],
                  [1.0]])

    Q = np.diag([10.0, 1.0])
    R = np.array([[0.25]])
    N = np.array([[0.0],
                  [0.15]])

    x = np.array([0.7, -0.2])
    u = np.array([0.4])

    print("Q is", eig_definiteness(Q))
    print("R is", eig_definiteness(R))
    print("x^T Q x =", quadratic_form(x, Q))
    print("stage cost with cross term =", stage_cost(x, u, Q, R, N))

    shift, schur = complete_square(Q, R, N)
    print("R^{-1} N^T =")
    print(shift)
    print("Schur complement Q - N R^{-1} N^T =")
    print(schur)
    print("Schur complement is", eig_definiteness(schur))

    K = np.array([[3.0, 2.0]])
    x0 = np.array([1.0, 0.0])
    J = simulate_closed_loop_cost(A, B, K, Q, R, x0, tf=8.0)
    print("Finite-horizon quadratic performance J =", J)
      

13. C++ Implementation

Chapter28_Lesson1.cpp


/*
Chapter28_Lesson1.cpp

Dependency:
    Eigen 3
Compile example:
    g++ -std=c++17 Chapter28_Lesson1.cpp -I /path/to/eigen -O2 -o Chapter28_Lesson1
*/

#include <Eigen/Dense>
#include <iostream>
#include <string>

using Eigen::MatrixXd;
using Eigen::VectorXd;

MatrixXd symmetrize(const MatrixXd& M) {
    return 0.5 * (M + M.transpose());
}

std::string definiteness(const MatrixXd& M, double tol = 1e-10) {
    Eigen::SelfAdjointEigenSolver<MatrixXd> solver(symmetrize(M));
    VectorXd eigs = solver.eigenvalues();

    bool all_pos = true;
    bool all_nonneg = true;
    bool all_neg = true;
    bool all_nonpos = true;

    for (int i = 0; i < eigs.size(); ++i) {
        all_pos = all_pos && (eigs(i) > tol);
        all_nonneg = all_nonneg && (eigs(i) >= -tol);
        all_neg = all_neg && (eigs(i) < -tol);
        all_nonpos = all_nonpos && (eigs(i) <= tol);
    }

    if (all_pos) return "positive definite";
    if (all_nonneg) return "positive semidefinite";
    if (all_neg) return "negative definite";
    if (all_nonpos) return "negative semidefinite";
    return "indefinite";
}

double quadraticForm(const VectorXd& z, const MatrixXd& M) {
    return (z.transpose() * M * z)(0, 0);
}

double stageCost(const VectorXd& x, const VectorXd& u,
                 const MatrixXd& Q, const MatrixXd& R,
                 const MatrixXd& N) {
    double xQx = (x.transpose() * Q * x)(0, 0);
    double uRu = (u.transpose() * R * u)(0, 0);
    double cross = 2.0 * (x.transpose() * N * u)(0, 0);
    return xQx + cross + uRu;
}

int main() {
    MatrixXd Q(2, 2);
    Q << 10.0, 0.0,
          0.0, 1.0;

    MatrixXd R(1, 1);
    R << 0.25;

    MatrixXd N(2, 1);
    N << 0.0,
          0.15;

    VectorXd x(2);
    x << 0.7, -0.2;

    VectorXd u(1);
    u << 0.4;

    std::cout << "Q is " << definiteness(Q) << std::endl;
    std::cout << "R is " << definiteness(R) << std::endl;
    std::cout << "x^T Q x = " << quadraticForm(x, Q) << std::endl;
    std::cout << "stage cost = " << stageCost(x, u, Q, R, N) << std::endl;

    MatrixXd RinvNT = R.ldlt().solve(N.transpose());
    MatrixXd Schur = Q - N * RinvNT;

    std::cout << "R^{-1} N^T =" << std::endl << RinvNT << std::endl;
    std::cout << "Q - N R^{-1} N^T =" << std::endl << Schur << std::endl;
    std::cout << "Schur complement is " << definiteness(Schur) << std::endl;

    return 0;
}
      

14. Java Implementation

Chapter28_Lesson1.java


/*
Chapter28_Lesson1.java

Self-contained Java implementation for small quadratic-form calculations.
For larger control projects, consider EJML, Apache Commons Math, or JBLAS.
*/

import java.util.Arrays;

public class Chapter28_Lesson1 {
    static double dot(double[] a, double[] b) {
        double s = 0.0;
        for (int i = 0; i < a.length; i++) {
            s += a[i] * b[i];
        }
        return s;
    }

    static double[] matVec(double[][] A, double[] x) {
        double[] y = new double[A.length];

        for (int i = 0; i < A.length; i++) {
            for (int j = 0; j < x.length; j++) {
                y[i] += A[i][j] * x[j];
            }
        }

        return y;
    }

    static double quadraticForm(double[] z, double[][] M) {
        return dot(z, matVec(M, z));
    }

    static double stageCost(double[] x, double[] u,
                            double[][] Q, double[][] R, double[][] N) {
        double value = quadraticForm(x, Q) + quadraticForm(u, R);

        double cross = 0.0;
        for (int i = 0; i < x.length; i++) {
            for (int j = 0; j < u.length; j++) {
                cross += x[i] * N[i][j] * u[j];
            }
        }

        return value + 2.0 * cross;
    }

    static double[][] schurComplementForScalarR(double[][] Q, double r, double[][] N) {
        int n = Q.length;
        double[][] S = new double[n][n];

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                S[i][j] = Q[i][j] - N[i][0] * N[j][0] / r;
            }
        }

        return S;
    }

    static void printMatrix(String name, double[][] A) {
        System.out.println(name);
        for (double[] row : A) {
            System.out.println(Arrays.toString(row));
        }
    }

    public static void main(String[] args) {
        double[][] Q = {
            {10.0, 0.0},
            {0.0, 1.0}
        };

        double[][] R = { {0.25} };

        double[][] N = {
            {0.0},
            {0.15}
        };

        double[] x = {0.7, -0.2};
        double[] u = {0.4};

        System.out.println("x^T Q x = " + quadraticForm(x, Q));
        System.out.println("stage cost = " + stageCost(x, u, Q, R, N));

        double[][] S = schurComplementForScalarR(Q, R[0][0], N);
        printMatrix("Q - N R^{-1} N^T =", S);
    }
}
      

15. MATLAB/Simulink Implementation

Chapter28_Lesson1.m


% Chapter28_Lesson1.m
% Quadratic forms in state and input variables for Modern Control.

clear; clc;

A = [0 1; -2 -0.4];
B = [0; 1];

Q = diag([10 1]);
R = 0.25;
N = [0; 0.15];

x = [0.7; -0.2];
u = 0.4;

fprintf('x''Qx = %.6f\n', quadratic_form(x,Q));
fprintf('stage cost = %.6f\n', stage_cost(x,u,Q,R,N));

[RinvNT, Schur] = complete_square(Q,R,N);

disp('R^{-1}N^T ='); disp(RinvNT);
disp('Q - N R^{-1} N^T ='); disp(Schur);
disp('Eigenvalues of Q:'); disp(eig((Q+Q')/2));
disp('Eigenvalues of R:'); disp(eig((R+R')/2));
disp('Eigenvalues of Schur complement:'); disp(eig((Schur+Schur')/2));

K = [3 2];
x0 = [1; 0];
tf = 8;

z0 = [x0; 0];
[t,z] = ode45(@(t,z) augmented_rhs(t,z,A,B,K,Q,R), [0 tf], z0);
J = z(end,end);

fprintf('Finite-horizon quadratic performance J = %.6f\n', J);

modelName = 'Chapter28_Lesson1_Simulink_Model';

if ~bdIsLoaded(modelName)
    new_system(modelName);
    open_system(modelName);

    assignin('base','A',A);
    assignin('base','B',B);
    assignin('base','Q',Q);
    assignin('base','R',R);
    assignin('base','K',K);
end

function value = quadratic_form(z,M)
    value = z' * M * z;
end

function value = stage_cost(x,u,Q,R,N)
    value = x' * Q * x + 2*x' * N * u + u' * R * u;
end

function [RinvNT, Schur] = complete_square(Q,R,N)
    RinvNT = R \ N';
    Schur = Q - N * RinvNT;
end

function dz = augmented_rhs(~,z,A,B,K,Q,R)
    n = size(A,1);
    x = z(1:n);
    u = -K*x;
    dx = A*x + B*u;
    dJ = x'*Q*x + u'*R*u;
    dz = [dx; dJ];
end
      

In Simulink, the same idea can be implemented by forming \( x^\top Qx \) and \( u^\top Ru \) with Matrix Gain, Product, Sum, and Integrator blocks. The integrator output is the accumulated performance \( J_T \).

16. Wolfram Mathematica Implementation

Chapter28_Lesson1.nb


Q = DiagonalMatrix[{10, 1}];
R = { {0.25} };
Nmat = { {0}, {0.15} };

x = {0.7, -0.2};
u = {0.4};

quadraticForm[z_, M_] := z.M.z

stageCost[x_, u_, Q_, R_, Nmat_] :=
  x.Q.x + 2 x.Nmat.u + u.R.u

quadraticForm[x, Q]

stageCost[x, u, Q, R, Nmat]

RinvNT = LinearSolve[R, Transpose[Nmat]];
Schur = Q - Nmat.RinvNT;

{RinvNT, Schur, Eigenvalues[Schur]}

ContourPlot[
  { {x1, x2}.Q.{x1, x2} == 1},
  {x1, -1, 1},
  {x2, -1, 1},
  FrameLabel -> {"x1", "x2"}
]
      

17. Problems and Solutions

Problem 1: Let \( M=\begin{bmatrix}2&3\\1&4\end{bmatrix} \). Show that \( z^\top Mz \) depends only on the symmetric part of \( M \).

Solution: The symmetric part is

\[ M_s=\frac{1}{2}(M+M^\top) = \frac{1}{2} \begin{bmatrix}4&4\\4&8\end{bmatrix} = \begin{bmatrix}2&2\\2&4\end{bmatrix}. \]

For \( z=[z_1,z_2]^\top \),

\[ z^\top Mz=2z_1^2+4z_1z_2+4z_2^2 = z^\top M_s z. \]

Problem 2: Classify the definiteness of \( Q=\begin{bmatrix}4&1\\1&2\end{bmatrix} \).

Solution: For a symmetric \( 2\times 2 \) matrix, positive definiteness is equivalent to positive leading principal minors:

\[ q_{11}=4>0,\qquad \det(Q)=4\cdot 2-1\cdot 1=7>0. \]

Therefore, \( Q\succ 0 \). Hence \( x^\top Qx>0 \) for all \( x\neq 0 \).

Problem 3: Suppose \( Q=\operatorname{diag}(9,1) \). Describe the set \( x^\top Qx\leq 1 \).

Solution:

\[ x^\top Qx=9x_1^2+x_2^2\leq 1. \]

This is an ellipse. Along the \( x_1 \) direction, the semi-axis length is \( 1/3 \). Along the \( x_2 \) direction, the semi-axis length is \( 1 \). Thus, deviations in \( x_1 \) are penalized more strongly.

Problem 4: For \( \ell(x,u)=x^\top Qx+2x^\top Nu+u^\top Ru \), with \( R\succ 0 \), derive the Schur-complement condition for nonnegativity.

Solution: Completing the square gives

\[ \ell(x,u)= \left(u+R^{-1}N^\top x\right)^\top R \left(u+R^{-1}N^\top x\right) + x^\top(Q-NR^{-1}N^\top)x. \]

The first term is always nonnegative because \( R\succ 0 \). Therefore, \( \ell(x,u)\geq 0 \) for all \( x,u \) if and only if

\[ Q-NR^{-1}N^\top\succeq 0. \]

Problem 5: Let \( x=Tz \). If the original state penalty is \( x^\top Qx \), find the penalty matrix in the \( z \) coordinates.

Solution:

\[ x^\top Qx=(Tz)^\top Q(Tz)=z^\top T^\top QTz. \]

Therefore, the transformed penalty matrix is \( Q_z=T^\top QT \).

Problem 6: Suppose \( u=-Kx \). Show that \( x^\top Qx+u^\top Ru \) becomes a state-only quadratic form.

Solution: Substitute \( u=-Kx \):

\[ x^\top Qx+u^\top Ru = x^\top Qx+(-Kx)^\top R(-Kx) = x^\top(Q+K^\top RK)x. \]

Thus, for a fixed feedback gain, the combined state-input performance can be represented by the effective state weighting matrix \( Q+K^\top RK \).

18. Summary

Quadratic forms provide the standard mathematical representation of state deviation, input effort, and mixed state-input penalties in modern control. A symmetric positive semidefinite state matrix \( Q \) creates a nonnegative state penalty, while a positive definite input matrix \( R \) assigns a strictly positive cost to every nonzero input. Eigenvalues and eigenvectors explain the geometry of the penalty, coordinate transformations explain how weights change under state scaling, and completing the square explains the role of cross terms. These tools are the foundation for the next lessons on signal energy, weighting matrices, and optimal state-feedback.

19. References

  1. Kalman, R.E. (1960). Contributions to the theory of optimal control. Boletín de la Sociedad Matemática Mexicana, 5, 102–119.
  2. Bellman, R. (1957). Dynamic programming and a new formalism in the calculus of variations. Proceedings of the National Academy of Sciences, 40(4), 231–235.
  3. Letov, A.M. (1960). Analytical controller design I. Automation and Remote Control, 21, 303–306.
  4. Wonham, W.M. (1968). On a matrix Riccati equation of stochastic control. SIAM Journal on Control, 6(4), 681–697.
  5. Anderson, B.D.O. (1967). The inverse problem of optimal control. Stanford Electronics Laboratories Technical Report.
  6. Willems, J.C. (1971). Least squares stationary optimal control and the algebraic Riccati equation. IEEE Transactions on Automatic Control, 16(6), 621–634.
  7. Brockett, R.W. (1970). Finite Dimensional Linear Systems. Wiley.
  8. Lancaster, P., & Rodman, L. (1995). Algebraic Riccati equations. Oxford University Press.
  9. Moore, B.C. (1981). Principal component analysis in linear systems: controllability, observability, and model reduction. IEEE Transactions on Automatic Control, 26(1), 17–32.
  10. Safonov, M.G., & Athans, M. (1977). Gain and phase margin for multiloop LQG regulators. IEEE Transactions on Automatic Control, 22(2), 173–179.