Chapter 4: State Variables and State-Space Models
Lesson 3: State Dimension and Minimal Internal Description
This lesson formalizes what the “dimension of the state” really means and why different state choices can describe the same physical input-output behavior. We develop the notion of an internal description, define when two state-space models are input-output equivalent, and prove how redundant state coordinates can be removed to obtain a smaller (minimal) internal description. The emphasis is on rigorous linear-algebraic arguments using concepts already developed (subspaces, rank, invariance, and matrix exponentials).
1. Conceptual Overview: What Does “State Dimension” Measure?
In Lesson 1, we defined a state as a collection of variables that summarize the system’s internal memory. In Lesson 2, we wrote continuous-time LTI state-space models:
\[ \dot{\mathbf{x}}(t)=\mathbf{A}\mathbf{x}(t)+\mathbf{B}\mathbf{u}(t),\qquad \mathbf{y}(t)=\mathbf{C}\mathbf{x}(t)+\mathbf{D}\mathbf{u}(t), \]
The state dimension is the integer \( n \): the length of \( \mathbf{x}(t)\in\mathbb{R}^n \). Importantly, the same physical input-output behavior can be represented with many different state vectors: some are merely different coordinate systems, while others introduce redundant internal variables that do not change what the input-output map does.
This lesson answers two core questions:
- Coordinate non-uniqueness: How can different matrices \( (\mathbf{A},\mathbf{B},\mathbf{C},\mathbf{D}) \) describe the same system when we simply change state coordinates?
- Minimality: When does a model contain redundant internal variables, and how can we remove them to obtain a smaller, minimal internal description?
2. State Dimension vs. “Number of Variables You Wrote Down”
A common beginner mistake is to treat any chosen list of internal variables as “the state.” However, to be a proper state vector, those variables must be:
- internally sufficient to propagate forward in time using \( \dot{\mathbf{x}}=\mathbf{A}\mathbf{x}+\mathbf{B}\mathbf{u} \),
- free of algebraic redundancy (e.g., one coordinate being a linear combination of others),
- minimal in the sense that no smaller dimension can reproduce the same input-output behavior (formalized below).
Example (redundant coordinate by linear dependence). Suppose the true internal coordinates are \( \mathbf{z}\in\mathbb{R}^2 \), but we define \( \mathbf{x}\in\mathbb{R}^3 \) by \( \mathbf{x}=\begin{bmatrix} z_1 & z_2 & z_1+z_2 \end{bmatrix}^\top \). Then the third coordinate is redundant. Algebraically, the state constraint is:
\[ x_3 - x_1 - x_2 = 0. \]
A state vector with such a constraint is not a minimal internal description. A central goal is to identify and remove such redundancies systematically.
3. Similarity Transformations: Different Coordinates, Same Dimension
The most important “non-uniqueness” comes from invertible coordinate changes. Let \( \mathbf{T}\in\mathbb{R}^{n\times n} \) be invertible and define a new state \( \mathbf{z}(t) \) by:
\[ \mathbf{x}(t)=\mathbf{T}\mathbf{z}(t). \]
Substitute into the state equation:
\[ \dot{\mathbf{x}}=\mathbf{T}\dot{\mathbf{z}} =\mathbf{A}\mathbf{T}\mathbf{z}+\mathbf{B}\mathbf{u} \quad\Longrightarrow\quad \dot{\mathbf{z}}=\mathbf{T}^{-1}\mathbf{A}\mathbf{T}\mathbf{z}+\mathbf{T}^{-1}\mathbf{B}\mathbf{u}. \]
The output becomes:
\[ \mathbf{y}=\mathbf{C}\mathbf{T}\mathbf{z}+\mathbf{D}\mathbf{u}. \]
Therefore, the transformed realization is:
\[ \mathbf{A}'=\mathbf{T}^{-1}\mathbf{A}\mathbf{T},\quad \mathbf{B}'=\mathbf{T}^{-1}\mathbf{B},\quad \mathbf{C}'=\mathbf{C}\mathbf{T},\quad \mathbf{D}'=\mathbf{D}. \]
Theorem 1 (Coordinate-equivalent realizations). If \( \mathbf{T} \) is invertible, then \( (\mathbf{A},\mathbf{B},\mathbf{C},\mathbf{D}) \) and \( (\mathbf{A}',\mathbf{B}',\mathbf{C}',\mathbf{D}') \) generate the same input-output trajectories for corresponding initial conditions \( \mathbf{x}(0)=\mathbf{T}\mathbf{z}(0) \).
Proof (direct substitution). The transformed equations were derived by substitution and left-multiplication by \( \mathbf{T}^{-1} \). Since \( \mathbf{x}(t)=\mathbf{T}\mathbf{z}(t) \) is a bijection, every trajectory in one coordinate system corresponds to exactly one in the other, with identical outputs \( \mathbf{y}(t) \). ∎
Key implication: coordinate changes do not change state dimension. If two models are related by an invertible \( \mathbf{T} \), then both have the same \( n \). Minimality is about something different: removing states that are not needed at all.
4. Internal Description and Input-Output Equivalence
An internal description is any quadruple \( (\mathbf{A},\mathbf{B},\mathbf{C},\mathbf{D}) \) together with a state dimension \( n \) that produces outputs from inputs and initial conditions. Using matrix-exponential concepts from Chapter 3, the solution of the state equation can be expressed as:
\[ \mathbf{x}(t)=e^{\mathbf{A}t}\mathbf{x}(0)+\int_{0}^{t} e^{\mathbf{A}(t-s)}\mathbf{B}\mathbf{u}(s)\,ds. \]
Substituting into \( \mathbf{y}(t)=\mathbf{C}\mathbf{x}(t)+\mathbf{D}\mathbf{u}(t) \) gives:
\[ \mathbf{y}(t)=\mathbf{C}e^{\mathbf{A}t}\mathbf{x}(0) +\int_{0}^{t}\mathbf{C}e^{\mathbf{A}(t-s)}\mathbf{B}\mathbf{u}(s)\,ds +\mathbf{D}\mathbf{u}(t). \]
This expression shows precisely how internal state enters the output: through the term \( \mathbf{C}e^{\mathbf{A}t}\mathbf{x}(0) \) (effect of initial condition) and through \( \mathbf{C}e^{\mathbf{A}(t-s)}\mathbf{B} \) (effect of input).
Definition (Input-output equivalence). Two state-space models (possibly with different state dimensions) are input-output equivalent if for every admissible input \( \mathbf{u}(\cdot) \) and appropriate matching of initial conditions, they produce the same output trajectory \( \mathbf{y}(\cdot) \). A model is minimal if no equivalent model exists with strictly smaller state dimension.
5. Redundancy Type I: Output-Invisible State Directions and Order Reduction
Some state directions may never affect the output, even though they may evolve internally. To formalize this, consider the autonomous output contribution (set \( \mathbf{u}=0 \)):
\[ \mathbf{y}(t)=\mathbf{C}e^{\mathbf{A}t}\mathbf{x}(0). \]
A nonzero initial state \( \mathbf{x}(0)\neq \mathbf{0} \) is completely invisible to the output if:
\[ \mathbf{C}e^{\mathbf{A}t}\mathbf{x}(0)=\mathbf{0}\quad \text{for all } t \ge 0. \]
Using the power-series definition of the matrix exponential (Chapter 3),
\[ e^{\mathbf{A}t}=\sum_{k=0}^{\infty}\frac{\mathbf{A}^k t^k}{k!}, \quad\Longrightarrow\quad \mathbf{C}e^{\mathbf{A}t}\mathbf{x}(0)=\sum_{k=0}^{\infty}\frac{\mathbf{C}\mathbf{A}^k\mathbf{x}(0)}{k!}t^k. \]
Therefore, \( \mathbf{C}e^{\mathbf{A}t}\mathbf{x}(0)=\mathbf{0} \) for all \( t \ge 0 \) holds if and only if all coefficients vanish:
\[ \mathbf{C}\mathbf{A}^k\mathbf{x}(0)=\mathbf{0}\quad \text{for all } k=0,1,2,\dots \]
Finite truncation via Cayley–Hamilton. By Cayley–Hamilton, \( \mathbf{A}^n \) is a linear combination of \( \mathbf{I},\mathbf{A},\dots,\mathbf{A}^{n-1} \), so the infinite family reduces to finitely many constraints:
\[ \mathbf{C}\mathbf{A}^k\mathbf{x}(0)=\mathbf{0}\ \ \text{for all } k\ge 0 \quad\Longleftrightarrow\quad \mathbf{C}\mathbf{A}^k\mathbf{x}(0)=\mathbf{0}\ \ \text{for } k=0,1,\dots,n-1. \]
Define the output-nulling (output-invisible) subspace:
\[ \mathcal{N}_{y}:=\bigcap_{k=0}^{n-1}\ker(\mathbf{C}\mathbf{A}^k). \]
Lemma 1 (Invariance). The subspace \( \mathcal{N}_{y} \) is \( \mathbf{A} \)-invariant, i.e., \( \mathbf{A}\mathcal{N}_{y}\subseteq \mathcal{N}_{y} \).
Proof. Take any \( \mathbf{x}\in\mathcal{N}_{y} \). Then for \( k=0,1,\dots,n-2 \):
\[ \mathbf{C}\mathbf{A}^k(\mathbf{A}\mathbf{x})=\mathbf{C}\mathbf{A}^{k+1}\mathbf{x}=\mathbf{0}. \]
For \( k=n-1 \), use Cayley–Hamilton to write \( \mathbf{A}^{n}=\sum_{i=0}^{n-1}\alpha_i\mathbf{A}^i \) for some scalars \( \alpha_i \). Then:
\[ \mathbf{C}\mathbf{A}^{n-1}(\mathbf{A}\mathbf{x}) =\mathbf{C}\mathbf{A}^{n}\mathbf{x} =\sum_{i=0}^{n-1}\alpha_i\,\mathbf{C}\mathbf{A}^i\mathbf{x} =\mathbf{0}. \]
Hence \( \mathbf{A}\mathbf{x}\in\mathcal{N}_{y} \). ∎
Theorem 2 (Removing output-invisible states). If \( \dim(\mathcal{N}_{y})=r>0 \), then there exists an invertible coordinate transform \( \mathbf{x}=\mathbf{T}\mathbf{z} \) such that, in the new coordinates \( \mathbf{z}=\begin{bmatrix}\mathbf{z}_1^\top & \mathbf{z}_2^\top\end{bmatrix}^\top \) with \( \mathbf{z}_2\in\mathbb{R}^r \) spanning \( \mathcal{N}_{y} \), the matrices take the block form:
\[ \mathbf{A}'= \begin{bmatrix} \mathbf{A}_{11} & \mathbf{0}\\ \mathbf{A}_{21} & \mathbf{A}_{22} \end{bmatrix},\quad \mathbf{B}'= \begin{bmatrix} \mathbf{B}_{1}\\ \mathbf{B}_{2} \end{bmatrix},\quad \mathbf{C}'= \begin{bmatrix} \mathbf{C}_{1} & \mathbf{0} \end{bmatrix},\quad \mathbf{D}'=\mathbf{D}. \]
Moreover, the reduced model \( (\mathbf{A}_{11},\mathbf{B}_{1},\mathbf{C}_{1},\mathbf{D}) \) produces the same output for every input as the original model.
Proof (structure and elimination).
- Because \( \mathcal{N}_{y} \) is an invariant subspace (Lemma 1), choose a basis of \( \mathbb{R}^n \) whose last \( r \) basis vectors span \( \mathcal{N}_{y} \). Let \( \mathbf{T}=[\mathbf{T}_1\ \mathbf{T}_2] \) with columns of \( \mathbf{T}_2 \) spanning \( \mathcal{N}_{y} \).
- Invariance implies \( \mathbf{A}\mathbf{T}_2=\mathbf{T}_2\mathbf{A}_{22} \) for some \( \mathbf{A}_{22} \), which forces the top-right block to be zero in \( \mathbf{A}'=\mathbf{T}^{-1}\mathbf{A}\mathbf{T} \).
- Also, \( \mathbf{C}\mathbf{T}_2=\mathbf{0} \) by definition of \( \mathcal{N}_{y} \), so \( \mathbf{C}'=[\mathbf{C}_1\ \mathbf{0}] \).
- With this structure, the subsystem for \( \mathbf{z}_1 \) is closed: \( \dot{\mathbf{z}}_1=\mathbf{A}_{11}\mathbf{z}_1+\mathbf{B}_1\mathbf{u} \), and the output is \( \mathbf{y}=\mathbf{C}_1\mathbf{z}_1+\mathbf{D}\mathbf{u} \), independent of \( \mathbf{z}_2 \). Therefore eliminating \( \mathbf{z}_2 \) does not change \( \mathbf{y}(t) \). ∎
Interpretation: \( \mathbf{z}_2 \) contains “internal motion that never shows up at the output” and cannot feed back into the part that does show up. Hence it is removable without changing input-output behavior.
6. Redundancy Type II: State Directions Unaffected by Inputs (Input-Decoupled)
A second kind of redundancy occurs when part of the state can never be influenced by the input. Even if such states might influence the output, they cannot represent “input-driven” dynamics and often indicate that the model includes autonomous components unrelated to the intended input-output behavior. A foundational object is the span:
\[ \mathcal{R}_{u}:=\operatorname{span}\{\mathbf{B},\mathbf{A}\mathbf{B},\mathbf{A}^2\mathbf{B},\dots,\mathbf{A}^{n-1}\mathbf{B}\}\subseteq \mathbb{R}^n. \]
This subspace consists of state directions that can be “reached” (in an algebraic sense) by repeated action of \( \mathbf{A} \) on input directions. It is straightforward to verify that \( \mathcal{R}_{u} \) is \( \mathbf{A} \)-invariant:
\[ \mathbf{A}\mathcal{R}_{u}\subseteq \mathcal{R}_{u}, \]
because multiplying any generator \( \mathbf{A}^k\mathbf{B} \) by \( \mathbf{A} \) gives \( \mathbf{A}^{k+1}\mathbf{B} \), which remains in the span (and Cayley–Hamilton truncates at \( n-1 \)).
If \( \dim(\mathcal{R}_{u}) < n \), then the state contains directions that are not influenced by inputs. Using the same invariant-subspace basis idea as in Section 5, one can transform the model so that the input-driven part and the input-decoupled part appear in block form, and the input-decoupled part can be removed when defining a minimal internal description for the input-output map. The systematic rank-based criteria will be developed in full detail later in the course; here we emphasize the geometric idea: minimality requires removing both output-invisible and input-decoupled state directions.
7. Practical Procedure: From a Candidate Model to a Smaller Internal Description
The reduction logic is conceptually simple: identify state directions that (i) never affect the output, and (ii) are never influenced by the input, then remove them via an appropriate coordinate basis that respects invariance.
flowchart TD
S["Start with (A,B,C,D) and state dimension n"] --> C1["Check output-invisible directions"]
C1 --> C2["Compute Ny = intersection ker(C*A^k), \nk=0..n-1"]
C2 -->|"dim(Ny) > 0"| R1["Choose basis that isolates Ny; \ntransform x = T z"]
R1 --> R2["Drop z2 block (does not affect y); \nkeep reduced (A11,B1,C1,D)"]
C2 -->|"dim(Ny) = 0"| C3["Check input-decoupled directions"]
C3 --> C4["Compute Ru = span{B, A*B, ..., A^(n-1)*B}"]
C4 -->|"dim(Ru) < n"| R3["Choose basis that isolates \ninput-driven part; transform"]
R3 --> R4["Drop input-decoupled block when \nforming minimal internal description"]
C4 -->|"dim(Ru) = n"| END["Result: no obvious redundancy; \ncandidate is minimal"]
In the next sections we implement the “output-invisible” detection (Section 5) concretely in multiple languages on a small numerical example.
8. Implementations (Python, C++, Java, MATLAB/Simulink, Wolfram Mathematica)
Consider the LTI model with a deliberately redundant third state:
\[ \mathbf{A}= \begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 0\\ 0 & 0 & -1 \end{bmatrix},\quad \mathbf{B}= \begin{bmatrix} 0\\ 1\\ 0 \end{bmatrix},\quad \mathbf{C}= \begin{bmatrix} 1 & 0 & 0 \end{bmatrix},\quad \mathbf{D}= \begin{bmatrix} 0 \end{bmatrix}. \]
Here the third state evolves as \( \dot{x}_3=-x_3 \) but has no path to the output and no coupling into \( x_1,x_2 \). Hence it should be removable when forming a minimal internal description.
Define the finite “output-visibility” stack:
\[ \mathbf{O}:= \begin{bmatrix} \mathbf{C}\\ \mathbf{C}\mathbf{A}\\ \vdots\\ \mathbf{C}\mathbf{A}^{n-1} \end{bmatrix}, \qquad \mathcal{N}_{y}=\ker(\mathbf{O}). \]
For this example, \( \mathcal{N}_{y} \) is expected to contain the third basis vector direction. Below, we compute \( \mathbf{O} \), its rank, and a basis for \( \ker(\mathbf{O}) \).
8.1 Python (NumPy/SciPy + optional python-control)
import numpy as np
from numpy.linalg import matrix_rank
from scipy.linalg import null_space
A = np.array([[0., 1., 0.],
[0., 0., 0.],
[0., 0., -1.]])
B = np.array([[0.],
[1.],
[0.]])
C = np.array([[1., 0., 0.]])
D = np.array([[0.]])
n = A.shape[0]
# Build O = [C; C A; ...; C A^(n-1)]
O_blocks = []
Ak = np.eye(n)
for k in range(n):
O_blocks.append(C @ Ak)
Ak = Ak @ A
O = np.vstack(O_blocks)
print("O =\n", O)
print("rank(O) =", matrix_rank(O))
Ny_basis = null_space(O) # columns span ker(O)
print("Basis for Ny = ker(O) (columns):\n", Ny_basis)
# Interpretation: any x0 in span(Ny_basis) satisfies C e^{A t} x0 = 0 for all t >= 0.
# Optional: verify numerically at sample times
ts = np.linspace(0, 5, 6)
x0 = Ny_basis[:, [0]] # pick one basis direction
for t in ts:
# crude expm via scipy if desired
from scipy.linalg import expm
y = C @ expm(A*t) @ x0
print(f"t={t: .2f}, y(t)={float(y): .3e}")
Libraries commonly used in modern control workflows in Python include:
scipy.linalg (linear algebra),
scipy.signal (state-space objects), and
control (python-control) for higher-level analysis (e.g.,
model reduction functions).
8.2 C++ (Eigen for Linear Algebra)
#include <iostream>
#include <Eigen/Dense>
using Eigen::MatrixXd;
using Eigen::VectorXd;
int main() {
MatrixXd A(3,3), B(3,1), C(1,3), D(1,1);
A << 0, 1, 0,
0, 0, 0,
0, 0, -1;
B << 0, 1, 0;
C << 1, 0, 0;
D << 0;
int n = (int)A.rows();
// Build O = [C; C A; ...; C A^(n-1)]
MatrixXd O(n * C.rows(), n);
MatrixXd Ak = MatrixXd::Identity(n,n);
for (int k = 0; k < n; ++k) {
O.block(k*C.rows(), 0, C.rows(), n) = C * Ak;
Ak = Ak * A;
}
// Rank via SVD
Eigen::JacobiSVD<MatrixXd> svd(O, Eigen::ComputeFullU | Eigen::ComputeFullV);
VectorXd s = svd.singularValues();
double tol = 1e-10;
int rank = 0;
for (int i = 0; i < s.size(); ++i) if (s(i) > tol) rank++;
std::cout << "O =\n" << O << "\n";
std::cout << "rank(O) = " << rank << "\n";
// Nullspace basis: columns of V corresponding to (near) zero singular values
MatrixXd V = svd.matrixV();
int null_dim = n - rank;
MatrixXd Ny_basis = V.block(0, rank, n, null_dim);
std::cout << "Ny basis (columns span ker(O)):\n" << Ny_basis << "\n";
return 0;
}
In C++, modern control implementations typically combine: Eigen (matrix computations) with either custom ODE solvers or libraries (e.g., Boost.ODEInt) for simulation. The reduction logic here is purely linear-algebraic and does not require a dedicated control toolbox.
8.3 Java (EJML for Linear Algebra)
import org.ejml.simple.SimpleMatrix;
import org.ejml.simple.SimpleSVD;
public class OutputInvisibleSubspaceDemo {
public static void main(String[] args) {
SimpleMatrix A = new SimpleMatrix(new double[][]{
{0, 1, 0},
{0, 0, 0},
{0, 0, -1}
});
SimpleMatrix B = new SimpleMatrix(new double[][]{
{0}, {1}, {0}
});
SimpleMatrix C = new SimpleMatrix(new double[][]{
{1, 0, 0}
});
int n = A.numRows();
// Build O = [C; C A; ...; C A^(n-1)]
SimpleMatrix O = new SimpleMatrix(n * C.numRows(), n);
SimpleMatrix Ak = SimpleMatrix.identity(n);
for (int k = 0; k < n; k++) {
SimpleMatrix rowBlock = C.mult(Ak);
for (int j = 0; j < n; j++) {
O.set(k, j, rowBlock.get(0, j));
}
Ak = Ak.mult(A);
}
// SVD for rank and nullspace
SimpleSVD<SimpleMatrix> svd = O.svd();
double[] s = svd.getSingularValues();
double tol = 1e-10;
int rank = 0;
for (double value : s) if (value > tol) rank++;
System.out.println("O =\n" + O);
System.out.println("rank(O) = " + rank);
// Nullspace basis from V columns corresponding to small singular values
SimpleMatrix V = svd.getV();
int nullDim = n - rank;
SimpleMatrix NyBasis = V.extractMatrix(0, n, rank, rank + nullDim);
System.out.println("Ny basis (columns span ker(O)):\n" + NyBasis);
}
}
In Java, EJML provides efficient numerical linear algebra. For control simulation, students often implement numerical integration manually (e.g., Runge–Kutta) or use scientific libraries, but the minimality detection shown here is purely based on SVD.
8.4 MATLAB and Simulink (Control System Toolbox)
% Example matrices
A = [0 1 0;
0 0 0;
0 0 -1];
B = [0; 1; 0];
C = [1 0 0];
D = 0;
n = size(A,1);
% Build O = [C; C A; ...; C A^(n-1)]
O = [];
Ak = eye(n);
for k = 1:n
O = [O; C*Ak];
Ak = Ak*A;
end
rankO = rank(O);
Ny = null(O,'r'); % rational basis if possible; otherwise numeric
disp('O ='); disp(O);
disp(['rank(O) = ', num2str(rankO)]);
disp('Basis for Ny = ker(O) (columns):'); disp(Ny);
% Create state-space model (requires Control System Toolbox)
sys = ss(A,B,C,D);
% Minimal realization (will remove redundant states if detectable numerically)
sys_min = minreal(sys);
disp('Original order:'); disp(order(sys));
disp('Minimal order (minreal):'); disp(order(sys_min));
Simulink workflow (scripted). You can place a “State-Space” block using these matrices and compare it against a reduced model:
% Programmatically build a small Simulink model
modelName = 'lesson4_ch4_l3_minimal_demo';
new_system(modelName); open_system(modelName);
add_block('simulink/Continuous/State-Space', [modelName '/FullModel']);
set_param([modelName '/FullModel'], 'A', mat2str(A), 'B', mat2str(B), 'C', mat2str(C), 'D', mat2str(D));
% Reduced model from minreal
[Ar,Br,Cr,Dr] = ssdata(sys_min);
add_block('simulink/Continuous/State-Space', [modelName '/ReducedModel']);
set_param([modelName '/ReducedModel'], 'A', mat2str(Ar), 'B', mat2str(Br), 'C', mat2str(Cr), 'D', mat2str(Dr));
% Add sources/sinks (Step input and Scope)
add_block('simulink/Sources/Step', [modelName '/Step']);
add_block('simulink/Sinks/Scope', [modelName '/ScopeFull']);
add_block('simulink/Sinks/Scope', [modelName '/ScopeReduced']);
% Wire: Step -> both models -> scopes
add_line(modelName, 'Step/1', 'FullModel/1');
add_line(modelName, 'Step/1', 'ReducedModel/1');
add_line(modelName, 'FullModel/1', 'ScopeFull/1');
add_line(modelName, 'ReducedModel/1', 'ScopeReduced/1');
set_param(modelName, 'StopTime', '10');
save_system(modelName);
The Simulink comparison helps students visually confirm that removing the redundant state does not change the output response for the same input.
8.5 Wolfram Mathematica
(* Define matrices *)
A = { {0, 1, 0},
{0, 0, 0},
{0, 0, -1} };
B = { {0}, {1}, {0} };
C = { {1, 0, 0} };
D = { {0} };
n = Length[A];
(* Build O = [C; C.A; ...; C.A^(n-1)] *)
O = ArrayFlatten@Table[C.MatrixPower[A, k], {k, 0, n - 1}];
rankO = MatrixRank[O];
NyBasis = NullSpace[O]; (* list of basis vectors *)
Print["O = ", O];
Print["rank(O) = ", rankO];
Print["Ny basis vectors = ", NyBasis];
(* State-space model and minimal reduction (ControlSystems` package) *)
Needs["ControlSystems`"];
sys = StateSpaceModel[{A, B, C, D}];
(* MinimalStateSpaceModel attempts to remove redundant states *)
sysMin = MinimalStateSpaceModel[sys];
Print["Original order = ", Length[sys["State"]]];
Print["Reduced order = ", Length[sysMin["State"]]];
9. Problems and Solutions
Problem 1 (Similarity invariance of input-output behavior): Let \( \mathbf{T} \) be invertible and define \( \mathbf{x}=\mathbf{T}\mathbf{z} \). Show that the transformed matrices \( \mathbf{A}'=\mathbf{T}^{-1}\mathbf{A}\mathbf{T} \), \( \mathbf{B}'=\mathbf{T}^{-1}\mathbf{B} \), \( \mathbf{C}'=\mathbf{C}\mathbf{T} \), \( \mathbf{D}'=\mathbf{D} \) generate identical outputs for matching initial conditions.
Solution: Starting from \( \mathbf{x}=\mathbf{T}\mathbf{z} \), we have \( \dot{\mathbf{x}}=\mathbf{T}\dot{\mathbf{z}} \). Substituting into \( \dot{\mathbf{x}}=\mathbf{A}\mathbf{x}+\mathbf{B}\mathbf{u} \) yields \( \mathbf{T}\dot{\mathbf{z}}=\mathbf{A}\mathbf{T}\mathbf{z}+\mathbf{B}\mathbf{u} \). Left-multiply by \( \mathbf{T}^{-1} \) to obtain \( \dot{\mathbf{z}}=\mathbf{A}'\mathbf{z}+\mathbf{B}'\mathbf{u} \). The output is \( \mathbf{y}=\mathbf{C}\mathbf{x}+\mathbf{D}\mathbf{u}=\mathbf{C}\mathbf{T}\mathbf{z}+\mathbf{D}\mathbf{u}=\mathbf{C}'\mathbf{z}+\mathbf{D}'\mathbf{u} \). Thus outputs coincide for \( \mathbf{x}(0)=\mathbf{T}\mathbf{z}(0) \). ∎
Problem 2 (Power-series criterion for output invisibility): Prove that \( \mathbf{C}e^{\mathbf{A}t}\mathbf{x}_0=\mathbf{0} \) for all \( t\ge 0 \) if and only if \( \mathbf{C}\mathbf{A}^k\mathbf{x}_0=\mathbf{0} \) for all \( k\ge 0 \).
Solution: Using \( e^{\mathbf{A}t}=\sum_{k=0}^{\infty}\mathbf{A}^k t^k/k! \) gives
\[ \mathbf{C}e^{\mathbf{A}t}\mathbf{x}_0 =\sum_{k=0}^{\infty}\frac{\mathbf{C}\mathbf{A}^k\mathbf{x}_0}{k!}t^k. \]
If all \( \mathbf{C}\mathbf{A}^k\mathbf{x}_0=\mathbf{0} \), the series is identically zero. Conversely, if the series equals zero for all \( t\ge 0 \), then all Taylor coefficients must be zero, implying \( \mathbf{C}\mathbf{A}^k\mathbf{x}_0=\mathbf{0} \) for every \( k \). ∎
Problem 3 (Cayley–Hamilton truncation): Show that if \( \mathbf{C}\mathbf{A}^k\mathbf{x}_0=\mathbf{0} \) for \( k=0,1,\dots,n-1 \), then \( \mathbf{C}\mathbf{A}^k\mathbf{x}_0=\mathbf{0} \) for all \( k\ge 0 \).
Solution: By Cayley–Hamilton, there exist scalars \( \alpha_0,\dots,\alpha_{n-1} \) such that
\[ \mathbf{A}^n=\sum_{i=0}^{n-1}\alpha_i\mathbf{A}^i. \]
Multiply by \( \mathbf{A}^{m} \) for any \( m\ge 0 \) to get \( \mathbf{A}^{n+m}=\sum_{i=0}^{n-1}\alpha_i\mathbf{A}^{i+m} \). Left-multiply by \( \mathbf{C} \) and apply to \( \mathbf{x}_0 \):
\[ \mathbf{C}\mathbf{A}^{n+m}\mathbf{x}_0=\sum_{i=0}^{n-1}\alpha_i\,\mathbf{C}\mathbf{A}^{i+m}\mathbf{x}_0. \]
Induct on \( m \): assuming all terms up to \( n+m-1 \) vanish, the recursion forces \( \mathbf{C}\mathbf{A}^{n+m}\mathbf{x}_0=\mathbf{0} \). Since the base case \( k=0,\dots,n-1 \) is given, all higher powers follow. ∎
Problem 4 (Explicit reduction for the numerical example): For the matrices in Section 8, compute \( \mathbf{O} \) and show that \( \dim(\ker(\mathbf{O}))=1 \). Identify a basis vector for \( \mathcal{N}_y \).
Solution: Here \( n=3 \). Compute:
\[ \mathbf{C}=\begin{bmatrix}1&0&0\end{bmatrix},\quad \mathbf{C}\mathbf{A}=\begin{bmatrix}0&1&0\end{bmatrix},\quad \mathbf{C}\mathbf{A}^2=\mathbf{C}\mathbf{A}\mathbf{A}=\begin{bmatrix}0&0&0\end{bmatrix}. \]
Thus
\[ \mathbf{O}= \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&0 \end{bmatrix}, \quad \ker(\mathbf{O})=\operatorname{span}\left\{ \begin{bmatrix}0\\0\\1\end{bmatrix} \right\}. \]
Therefore \( \dim(\mathcal{N}_y)=1 \), and the third state direction is output-invisible and removable. ∎
Problem 5 (Why invariance matters): Explain why the condition “output-invisible subspace is \( \mathbf{A} \)-invariant” is essential for removing it without altering the observable part’s dynamics.
Solution: If the output-invisible subspace were not invariant, then an initially invisible state direction could be mapped by the dynamics into a visible direction over time, meaning it would eventually affect the output. In coordinates, non-invariance would allow a nonzero top-right block coupling from invisible states into visible states, so eliminating invisible states would change the evolution of the visible part and hence the output. Invariance is precisely what enables the block structure with a zero coupling that makes elimination valid. ∎
10. Summary
We distinguished two sources of non-uniqueness in state-space models: (i) invertible coordinate changes (similarity transforms) that preserve state dimension and input-output behavior, and (ii) genuine redundancy where some internal directions are unnecessary for reproducing the system’s input-output map. We defined the output-invisible subspace \( \mathcal{N}_y=\cap_{k=0}^{n-1}\ker(\mathbf{C}\mathbf{A}^k) \), proved its \( \mathbf{A} \)-invariance, and showed how invariance yields a block form enabling rigorous order reduction. Multi-language implementations demonstrated how to detect removable directions numerically via rank and nullspace computations.
11. References
- Kalman, R.E. (1960). Contributions to the theory of optimal control. Boletín de la Sociedad Matemática Mexicana, 5, 102–119. :contentReference[oaicite:0]{index=0}
- Silverman, L.M. (1968). Controllability, observability, and stability of linear systems. SIAM Journal on Control, 6(1), 121–130. :contentReference[oaicite:1]{index=1}
- Davison, E.J. (1966). A method for simplifying linear dynamic systems. IEEE Transactions on Automatic Control, 11(1), 93–101. :contentReference[oaicite:2]{index=2}
- Ho, B.L., & Kalman, R.E. (1965). Effective construction of linear state-variable models from input/output data. Proceedings of the 3rd Allerton Conference on Circuit and System Theory, 449–459. :contentReference[oaicite:3]{index=3}
- Ho, B.L., & Kalman, R.E. (1966). Effective construction of linear state-variable models from input-output functions. Regelungstechnik, 14(12), 545–548. :contentReference[oaicite:4]{index=4}
- De Schutter, B. (2000). Minimal state-space realization in linear system theory: An overview. Journal of Computational and Applied Mathematics, 121(1–2), 331–354. :contentReference[oaicite:5]{index=5}
- Silverman, L.M. (1971). Realization of linear dynamical systems. IEEE Transactions on Automatic Control. :contentReference[oaicite:6]{index=6}