Algorithmadvanced
Invariant subspace algorithm
Also called ISA, V-star algorithm.
Computes the largest controlled invariant subspace inside a subspace K by the descending recursion V_(k+1) = K meet A^(-1)(V_k + im B), which stops after at most dim K + 1 passes.
- Time
- O(n^3 (n + m)) worst
- Space
- O(n (n + m)) extra
- Where
- m = the number of inputs; n = the number of states
- Model
- Real RAM
- Properties
- deterministicexactofflineiterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Giuseppe Basile, Giovanni Marro, W. Murray Wonham, A. Stephen Morse, 1970
The invariant subspace algorithm (ISA) computes , the largest controlled invariant subspace of inside a given subspace . It starts from and repeats , where is the preimage, not an inverse matrix. The subspaces shrink, and once two of them have the same dimension the last one is . So the algorithm stops after at most passes, and each pass is a few rank computations. With it gives the subspace that decides the disturbance decoupling problem and that carries the zero dynamics of a linear system. The algorithm is due to Wonham and Morse (1970), after the controlled invariant subspaces of Basile and Marro (1969).
In plain words
Some states of a machine are safe: from them, a well chosen input can keep the machine safe for all future time. The safe region of interest here is a flat region through the origin, for example all states where a sensor reads zero. Not every state in that region is good, because from some of them the machine must leave the region at once, whatever input you apply. The algorithm removes those states. After the removal, other states may become bad, because their only way to stay was through a removed state. So it removes again, and again. The region gets smaller at each step, and it cannot get smaller more often than its number of dimensions. When a step removes nothing, every remaining state can stay in the region forever.
The problem
Input: , and a basis of a subspace . Output: a basis of
The largest one exists because the sum of two controlled invariant subspaces is controlled invariant (see controlled invariant subspace). The implementation also returns the list of dimensions , and a friend with on request. The usual case is for an output , and then is written without the argument.
The algorithm
ISA(A, B, K)- 1
V ← K ▷ V_0 = K - 2
repeat - 3
W ← K ∩ A⁻¹(V + im B) ▷ V_(k+1); A⁻¹ is the preimage - 4
if dim W = dim V then - 5
return W ▷ W = V = V* - 6
V ← W
Line L1 starts with the whole subspace . Line L3 is the only real work. The sum is the span of the two bases, reduced to a basis by reduced row echelon form. The preimage of a subspace with basis matrix is the part of the kernel of , because for some exactly when . The intersection of two subspaces with basis matrices and is times the part of the kernel of . Line L4 compares only dimensions. This is enough, because always holds, and a subspace of the same dimension inside another one is equal to it. Line L6 makes the new subspace the current one.
The implementation uses exact rational arithmetic (Python Fraction), so every rank decision is exact. It also builds a friend: on a basis of it solves , and it sets and on a complement.
Example
A disturbance decoupling example. Take
| pass | dimensions | ||||
|---|---|---|---|---|---|
| 1 | 2 to 1 | ||||
| 2 | 1 to 1, stop |
In pass 1, lies in exactly when . The intersection with leaves . In pass 2 the sum with is the same as before, so line L4 stops and line L5 returns . The list of dimensions is . The friend from the code is : then . The disturbance decoupling problem page uses this result.
A chain of four integrators. For , , , and , the passes give , then , then , then , and the dimensions are . Each pass removes one state, because the output must have zero derivatives up to order 3, and the input reaches only the fourth derivative. The result says that this system has no zero dynamics. This example needs the maximum number of passes: three passes that shrink and one that confirms, which is .
Correctness
The full proof is in proofs/correctness.md. It has four steps, and each is a theorem.
- The sequence decreases. . If , then , and the preimage and the intersection keep this order, so .
- It stops. Each pass either lowers the dimension or gives . The dimension starts at and cannot go below 0, so line L4 succeeds at the latest in pass .
- The result is controlled invariant and lies in . At the stop, . So , which says .
- The result contains every controlled invariant subspace in . Let with . Then , and if , then , so .
A second description of gives an independent check. By induction on , is the set of states for which some inputs keep the discrete-time sequence in for . With this is the set of for which , where stacks and is the block Toeplitz matrix of the Markov parameters . The tests compare the algorithm with this formula for on 500 random integer systems, and they check the friend, the dimension list, and a brute force search over feedback gains for the decoupling problem.
Proof: The invariant subspace algorithm stops after at most dim K + 1 steps and returns the largest (A, B)-invariant subspace in Kfull
Let , and let be a subspace. Write . A subspace is -invariant when . For a subspace , the preimage is ; it is a subspace even when is singular. The algorithm computes
and stops at the first with . It returns . All operations are exact (rational arithmetic in the implementation), so every dimension is computed without error.
Lemma 1: the sequence is nonincreasing
For every , .
Proof. By induction on . For , . Assume . Then , and the preimage keeps inclusions, so . Intersect both sides with to get .
Lemma 2: equal dimension means a fixed point
If , then for every .
Proof. By Lemma 1, . A subspace of a finite-dimensional space with the same dimension is the whole space, so . The map depends only on its argument, so it maps to , and so on.
Lemma 3: termination
The loop stops after at most evaluations of the update.
Proof. While the loop runs, each step lowers the dimension by at least 1 (Lemma 1 and the stop test). The dimension starts at and cannot go below 0. So at most steps lower it, and the next step finds an equal dimension.
Lemma 4: the result is an (A, B)-invariant subspace in K
Let be the returned subspace. Then and .
Proof. Every with is an intersection with , and , so . By Lemma 2, . So each is in , that is, .
Lemma 5: the result contains every (A, B)-invariant subspace in K
Let with . Then for every .
Proof. By induction on . For , . Assume and let . Then , so . Also . So .
Theorem
The algorithm stops after at most updates, and the returned subspace is the largest -invariant subspace contained in : it is one of them, and it contains each of them.
Proof. Lemma 3 gives termination. Lemma 4 shows that is in the family. Lemma 5, applied at the final index, shows that each member of the family is in . A member of a family that contains every member is unique, so the largest element exists and the algorithm returns it.
Lemma 6: the friend computed by the implementation
Let be -invariant with basis . Complete it to a basis of . For each choose and with , where the sum runs over . Define by for and for . Then .
Proof. The choice of and exists because . The matrix exists and is unique because is a basis: with and . For , . A linear map that sends a basis of into sends all of into .
The implementation returns None for the disturbance decoupling problem exactly when with . When , Lemma 6 gives with , so has its columns in for every , and the transfer function is zero. The converse (no works when ) is proved on the disturbance decoupling problem page: for any , the smallest -invariant subspace that contains is -invariant and lies in when the output is decoupled, so it is in by Lemma 5.
Complexity
In the real RAM, with exact arithmetic on the entries:
- Line L3 builds a matrix with rows and at most columns for the sum, one with rows and at most columns for the preimage, and one with rows and at most columns for the intersection. Each kernel or rank by Gaussian elimination costs .
- Lines L4 and L6 cost .
- Lines L2 to L6 run at most times.
So the time is and the extra space is . This is a theorem about the number of arithmetic operations. With Fraction entries the cost in bit operations is higher, because the numerators and denominators grow; for integer data of bit size the sizes stay polynomial in and if the elimination is done in a fraction-free way, but the implementation does not bound them.
Properties
- The result for one input and one output. If for and , the relative degree is . Then the rows are linearly independent, and . This is a theorem; for the chain it gives , and for the first example .
- Fixed poles are zeros. The eigenvalues of restricted to that are the same for every friend are the invariant zeros of . For a system with as many inputs as outputs and an invertible transfer function they are the transmission zeros. This is a theorem of the geometric theory; in the first example the only friend eigenvalue on is , and before cancellation, so is the invariant zero.
- Dual algorithm. The smallest conditioned invariant subspace containing a subspace comes from the increasing recursion . It is the ISA for applied to orthogonal complements, and it is used for observers with unknown inputs (see unknown input observer).
- Not continuous in the data. can jump when the matrices change by a small amount, as the second pitfall below shows. The exact algorithm computes the right answer for the given rational data, but that answer can be a poor model of a physical system whose matrices are known only approximately.
Variants and improvements
- Controllability subspace algorithm. The largest controllability subspace in comes from a second, increasing recursion inside : , . It is needed for the decoupling problems with pole placement (Wonham and Morse 1970).
- Stabilizable version. For disturbance decoupling with internal stability one needs the largest stabilizability subspace in . It is computed from , and the fixed poles: keep the part of that belongs to fixed poles in the open left half plane.
- Orthonormal bases in floating point. Numerical versions replace the echelon forms by QR decompositions with column pivoting or by the singular value decomposition, and decide each rank with a tolerance. They give a nearby subspace for a nearby system, which is what one can ask for an ill-posed problem.
- Pencil methods. can also be read from the Kronecker structure of the system pencil , which staircase algorithms compute with orthogonal transformations. This is the usual route in numerical libraries.
When to use it
Use the exact ISA to decide structural questions about a model with known rational entries: whether a disturbance can be decoupled, what the zero dynamics of a linear system are, whether an observer with unknown inputs exists. It is also the right tool in teaching and in symbolic work, because each pass has a clear meaning. For models with measured or rounded entries, use a numerical version with orthogonal bases and an explicit rank tolerance, and check the answer for a few tolerances. If you need only the invariant zeros of a square system, a generalized eigenvalue computation on the system pencil is cheaper and better conditioned.
Pitfalls
- Line L3 without the intersection with . Without "", the recursion does not stay in , and its limit is a controlled invariant subspace that has nothing to do with the output. In the first example it gives in pass 1, which is not in .
- Line L3 with floating-point rank decisions. Take , and . For the sum is the whole plane and , of dimension 1. For it is itself, and . The exact code returns dimension lists for and for . In floating point an near the rounding unit of the floating-point model can fall on either side of the rank tolerance. State the tolerance, and look at the gaps of the singular values next to each rank decision.
- Line L3 with the image instead of the preimage. The recursion is a different map. The forward image belongs to the dual, increasing algorithm for conditioned invariant subspaces, and it does not give .
- Line L4 that compares bases. Two bases of the same subspace can differ entrywise, so a test " as matrices" can fail to stop. Compare dimensions, as line L4 does, or compare the reduced row echelon forms, which are unique.
- Line L5 is not the end of a design. alone does not give a usable feedback. The friend is not unique, and its fixed poles, the invariant zeros, may be in the right half plane. A disturbance decoupling design with such a friend has an unstable closed loop; use the stabilizable version.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/invariant-subspace-algorithm/. The authors are listed in prov/55N3T2.jsonl.
"""The invariant subspace algorithm (ISA) of geometric control.
For x' = A x + B u and a subspace K of R^n (for example ker C), the
sequence
V_0 = K, V_(k+1) = K intersected with A^(-1)(V_k + im B)
is nonincreasing and stops after at most dim K + 1 steps at V*, the largest
(A, B)-invariant subspace contained in K. A subspace V is (A, B)-invariant
when A V is contained in V + im B; then some K_f gives (A - B K_f) V in V.
All subspace operations are exact in Fraction: a subspace is a list of basis
vectors (flat lists), kept in reduced row echelon form, so two equal
subspaces have the same representation.
The disturbance decoupling problem (DDP) for x' = A x + B u + E d, y = C x,
with state feedback u = -K x, is solvable if and only if im E is contained
in V*, the largest (A, B)-invariant subspace in ker C.
"""
from fractions import Fraction
__all__ = [
"rref", "span", "kernel", "image", "subspace_sum", "intersection",
"preimage", "contains", "is_ab_invariant", "isa", "friend",
"ddp", "markov_zero",
]
def _frac_matrix(a):
return [[Fraction(v) for v in row] for row in a]
def rref(rows):
"""Return the nonzero rows of the reduced row echelon form of rows."""
m = [[Fraction(v) for v in r] for r in rows]
if not m:
return []
ncol = len(m[0])
out_row = 0
for c in range(ncol):
piv = None
for r in range(out_row, len(m)):
if m[r][c] != 0:
piv = r
break
if piv is None:
continue
m[out_row], m[piv] = m[piv], m[out_row]
p = m[out_row][c]
m[out_row] = [v / p for v in m[out_row]]
for r in range(len(m)):
if r != out_row and m[r][c] != 0:
f = m[r][c]
m[r] = [x - f * y for x, y in zip(m[r], m[out_row])]
out_row += 1
if out_row == len(m):
break
return [r for r in m[:out_row] if any(v != 0 for v in r)]
def span(vectors):
"""Return the canonical basis (reduced row echelon form) of the span."""
return rref(vectors)
def kernel(a, n=None):
"""Return a basis of {x : a x = 0}; n is the number of columns if a is empty."""
a = _frac_matrix(a)
if n is None:
n = len(a[0]) if a else 0
r = rref(a) if a else []
pivots = []
for row in r:
for j, v in enumerate(row):
if v != 0:
pivots.append(j)
break
free = [j for j in range(n) if j not in pivots]
basis = []
for f in free:
x = [Fraction(0)] * n
x[f] = Fraction(1)
for row, pj in zip(r, pivots):
x[pj] = -row[f]
basis.append(x)
return span(basis)
def image(a):
"""Return a basis of the column space of a."""
if not a or not a[0]:
return []
cols = [[Fraction(a[i][j]) for i in range(len(a))] for j in range(len(a[0]))]
return span(cols)
def subspace_sum(u, v):
"""Return a basis of U + V."""
return span(list(u) + list(v))
def intersection(u, v, n):
"""Return a basis of U intersected with V, both subspaces of R^n."""
if not u or not v:
return []
# x = U a = V b: solve [U, -V] (a, b) = 0 and map back with U.
k = len(u)
mat = [[u[j][i] for j in range(k)] + [-v[j][i] for j in range(len(v))] for i in range(n)]
sols = kernel(mat, k + len(v))
vecs = [[sum(s[j] * u[j][i] for j in range(k)) for i in range(n)] for s in sols]
return span(vecs)
def preimage(a, v):
"""Return a basis of A^(-1) V = {x : A x in V}."""
n = len(a[0])
# A x - V b = 0: solve [A, -V] (x, b) = 0 and keep the x part.
mat = [[Fraction(a[i][j]) for j in range(n)] + [-w[i] for w in v] for i in range(len(a))]
sols = kernel(mat, n + len(v))
return span([s[:n] for s in sols])
def contains(u, v):
"""Return True if the subspace V is contained in U."""
return len(subspace_sum(u, v)) == len(span(u))
def _matvec(a, x):
return [sum(Fraction(ai) * xi for ai, xi in zip(row, x)) for row in a]
def is_ab_invariant(a, b, v):
"""Return True if A V is contained in V + im B."""
target = subspace_sum(v, image(b))
return all(contains(target, [_matvec(a, x)]) for x in v)
def isa(a, b, k_space):
"""Return (V*, dims): the largest (A, B)-invariant subspace in K.
k_space is a basis of K. dims lists dim V_0, dim V_1, ... up to the
first repeated value, so the last two entries are equal.
"""
n = len(a)
im_b = image(b)
v = span(k_space) # @line L1
dims = [len(v)]
while True: # @line L2
w = intersection(span(k_space), preimage(a, subspace_sum(v, im_b)), n) # @line L3
dims.append(len(w))
if len(w) == len(v): # @line L4
return w, dims # @line L5
v = w # @line L6
def _solve_square(m, rhs):
"""Solve m x = rhs exactly; m is square and invertible, rhs is a matrix."""
n = len(m)
aug = [list(map(Fraction, m[i])) + list(map(Fraction, rhs[i])) for i in range(n)]
r = rref(aug)
if len(r) < n or any(r[i][i] != 1 for i in range(n)):
raise ValueError("matrix is singular")
return [row[n:] for row in r]
def friend(a, b, v):
"""Return K (m by n, Fraction) with (A - B K) V contained in V.
K is chosen on a basis of V and set to 0 on a complement of V. Raises
ValueError if V is not (A, B)-invariant.
"""
n = len(a)
m = len(b[0]) if b and b[0] else 0
basis = span(v)
cols = []
for x in basis:
ax = _matvec(a, x)
# A x = V w + B u: solve [V, B] (w, u) = A x.
mat = [[w[i] for w in basis] + [Fraction(b[i][j]) for j in range(m)] for i in range(n)]
sol = _particular(mat, ax)
if sol is None:
raise ValueError("V is not (A, B)-invariant")
cols.append(sol[len(basis):])
# Complete the basis of V to a basis T of R^n with unit vectors.
t = list(basis)
for i in range(n):
e = [Fraction(int(i == j)) for j in range(n)]
if len(span(t + [e])) > len(t):
t.append(e)
# K T = [u_1 ... u_k, 0 ... 0], so K = U T^(-1).
u = [[cols[j][i] if j < len(cols) else Fraction(0) for j in range(n)] for i in range(m)]
tmat = [[t[j][i] for j in range(n)] for i in range(n)]
# Solve T^T K^T = U^T for K^T.
tt = [[tmat[j][i] for j in range(n)] for i in range(n)]
ut = [[u[i][j] for i in range(m)] for j in range(n)]
kt = _solve_square(tt, ut)
return [[kt[j][i] for j in range(n)] for i in range(m)]
def _particular(mat, rhs):
"""Return one solution x of mat x = rhs, or None if there is none."""
ncol = len(mat[0])
aug = [list(map(Fraction, mat[i])) + [Fraction(rhs[i])] for i in range(len(mat))]
r = rref(aug)
x = [Fraction(0)] * ncol
for row in r:
lead = next(j for j, v in enumerate(row) if v != 0)
if lead == ncol:
return None
x[lead] = row[ncol]
return x
def ddp(a, b, c, e):
"""Solve the disturbance decoupling problem by state feedback.
Returns (K, V*) with C (A - B K)^j E = 0 for all j, or (None, V*) when
im E is not contained in V*.
"""
n = len(a)
vstar, _ = isa(a, b, kernel(c, n))
if not contains(vstar, image(e)):
return None, vstar
return friend(a, b, vstar), vstar
def markov_zero(a, b, c, e, k):
"""Return True if C (A - B K)^j E = 0 for j = 0, ..., n - 1."""
n = len(a)
m = len(b[0])
acl = [[Fraction(a[i][j]) - sum(Fraction(b[i][t]) * k[t][j] for t in range(m)) for j in range(n)] for i in range(n)]
cols = [[Fraction(e[i][j]) for i in range(n)] for j in range(len(e[0]))]
for _ in range(n):
for x in cols:
if any(v != 0 for v in _matvec(c, x)):
return False
cols = [_matvec(acl, x) for x in cols]
return True
test_invariant_subspace_algorithm.py 203 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/invariant-subspace-algorithm/. The authors are listed in prov/55N3T2.jsonl.
import itertools
import random
from fractions import Fraction
from invariant_subspace_algorithm import (
contains, ddp, friend, image, intersection, is_ab_invariant, isa,
kernel, markov_zero, preimage, span, subspace_sum,
)
def unit(i, n):
return [Fraction(int(i == j)) for j in range(n)]
def rank(a):
"""Rank by fraction-free elimination, written apart from the module."""
m = [[Fraction(v) for v in row] for row in a]
r = 0
ncol = len(m[0]) if m else 0
for c in range(ncol):
p = next((i for i in range(r, len(m)) if m[i][c] != 0), None)
if p is None:
continue
m[r], m[p] = m[p], m[r]
for i in range(r + 1, len(m)):
f = m[i][c] / m[r][c]
m[i] = [x - f * y for x, y in zip(m[i], m[r])]
r += 1
return r
def matmul(a, b):
return [[sum(Fraction(a[i][t]) * b[t][j] for t in range(len(b))) for j in range(len(b[0]))] for i in range(len(a))]
def matvec(a, x):
return [sum(Fraction(v) * w for v, w in zip(row, x)) for row in a]
def rand_mat(rng, n, m, lo=-2, hi=2):
return [[rng.randint(lo, hi) for _ in range(m)] for _ in range(n)]
def toeplitz_reference(a, b, c):
"""V* as the states x0 for which inputs u_0..u_(n-1) give y_0 = ... = y_n = 0.
For x_(k+1) = A x_k + B u_k, y_k = C x_k, stack y_0..y_n = O x0 + T u
and return {x0 : O x0 in im T}, as the x part of ker [O, T].
"""
n, m, p = len(a), len(b[0]), len(c)
powers = [[[Fraction(int(i == j)) for j in range(n)] for i in range(n)]]
for _ in range(n):
powers.append(matmul(a, powers[-1]))
obs = []
for k in range(n + 1):
obs.extend(matmul(c, powers[k]))
big = []
for k in range(n + 1):
for i in range(p):
row = list(obs[k * p + i])
for j in range(n):
if j < k:
blk = matmul(matmul(c, powers[k - 1 - j]), b)
row.extend(blk[i])
else:
row.extend([Fraction(0)] * m)
big.append(row)
sols = kernel(big, n + n * m)
return span([s[:n] for s in sols])
def test_kernel_matches_rank():
rng = random.Random(1)
for _ in range(60):
n, k = rng.randint(1, 5), rng.randint(1, 5)
a = rand_mat(rng, k, n)
ker = kernel(a, n)
assert len(ker) + rank(a) == n
for x in ker:
assert all(v == 0 for v in matvec(a, x))
def test_subspace_operations():
rng = random.Random(2)
for _ in range(40):
n = rng.randint(2, 5)
u = span([[Fraction(rng.randint(-2, 2)) for _ in range(n)] for _ in range(rng.randint(1, n))])
v = span([[Fraction(rng.randint(-2, 2)) for _ in range(n)] for _ in range(rng.randint(1, n))])
s = subspace_sum(u, v)
i = intersection(u, v, n)
assert len(s) + len(i) == len(u) + len(v)
assert contains(u, i) and contains(v, i)
a = rand_mat(rng, n, n)
pre = preimage(a, v)
for x in pre:
assert contains(v, [matvec(a, x)])
# dim A^(-1) V = dim ker A + dim (V intersected with im A)
assert len(pre) == len(kernel(a, n)) + len(intersection(v, image(a), n))
def test_chain_of_four_integrators():
n = 4
a = [[0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1], [0, 0, 0, 0]]
b = [[0], [0], [0], [1]]
c = [[1, 0, 0, 0]]
vstar, dims = isa(a, b, kernel(c, n))
assert dims == [3, 2, 1, 0, 0]
assert vstar == []
def test_ddp_example_of_the_page():
a = [[0, 1, 0], [0, 0, 1], [0, 0, -1]]
b = [[0], [1], [0]]
c = [[1, 0, 0]]
e = [[0], [0], [1]]
vstar, dims = isa(a, b, kernel(c, 3))
assert dims == [2, 1, 1]
assert vstar == [unit(2, 3)]
k, v = ddp(a, b, c, e)
assert k == [[0, 0, 1]]
assert markov_zero(a, b, c, e, k)
# Every K = [k1, k2, 1] decouples, and K = [1, 2, 1] puts all poles at -1.
assert markov_zero(a, b, c, e, [[Fraction(1), Fraction(2), Fraction(1)]])
assert not markov_zero(a, b, c, e, [[Fraction(1), Fraction(2), Fraction(0)]])
# With the disturbance in the input channel, DDP has no solution.
k2, _ = ddp(a, b, c, [[0], [1], [0]])
assert k2 is None
def test_sum_closed_intersection_not():
a = [[0, 1, 0], [0, 0, 1], [0, 0, 0]]
b = [[0], [0], [1]]
v1 = span([unit(0, 3), unit(1, 3)])
v2 = span([unit(1, 3), [Fraction(1), Fraction(0), Fraction(1)]])
assert is_ab_invariant(a, b, v1) and is_ab_invariant(a, b, v2)
assert is_ab_invariant(a, b, subspace_sum(v1, v2))
meet = intersection(v1, v2, 3)
assert meet == [unit(1, 3)]
assert not is_ab_invariant(a, b, meet)
def test_random_systems_against_toeplitz_reference():
rng = random.Random(3)
nontrivial = 0
for trial in range(500):
n = rng.randint(2, 5) if trial < 80 else rng.randint(1, 3)
m = rng.randint(1, 2)
p = rng.randint(1, 2)
a = rand_mat(rng, n, n)
b = rand_mat(rng, n, m)
c = rand_mat(rng, p, n)
if trial % 4 == 0:
# Make C B = 0 often, so V* is not trivial.
b = [[0] * m for _ in range(n)]
b[n - 1] = [1] * m
c = [[rng.randint(-2, 2) for _ in range(n - 1)] + [0] for _ in range(p)]
ker_c = kernel(c, n)
vstar, dims = isa(a, b, ker_c)
# the sequence is nonincreasing, strictly until it stops, and short
assert all(x > y for x, y in zip(dims[:-2], dims[1:-1]))
assert dims[-1] == dims[-2]
assert len(dims) - 1 <= len(ker_c) + 1
assert contains(ker_c, vstar)
assert is_ab_invariant(a, b, vstar)
assert vstar == toeplitz_reference(a, b, c)
if vstar:
nontrivial += 1
k = friend(a, b, vstar)
acl = [[Fraction(a[i][j]) - sum(Fraction(b[i][t]) * k[t][j] for t in range(m)) for j in range(n)] for i in range(n)]
for x in vstar:
assert contains(vstar, [matvec(acl, x)])
assert nontrivial >= 10
def test_ddp_random_against_brute_force_feedback():
rng = random.Random(4)
yes = no = 0
for _ in range(60):
n = rng.randint(2, 3)
a = rand_mat(rng, n, n)
b = rand_mat(rng, n, 1)
c = rand_mat(rng, 1, n)
e = rand_mat(rng, n, 1)
k, vstar = ddp(a, b, c, e)
if k is not None:
yes += 1
assert markov_zero(a, b, c, e, k)
else:
no += 1
for ks in itertools.product(range(-2, 3), repeat=n):
kk = [[Fraction(v) for v in ks]]
assert not markov_zero(a, b, c, e, kk)
assert yes >= 3 and no >= 10
def test_full_state_space_when_c_is_zero():
a = [[1, 2], [3, 4]]
b = [[1], [0]]
vstar, dims = isa(a, b, kernel([[0, 0]], 2))
assert len(vstar) == 2 and dims == [2, 2]
History
Basile and Marro (1969) introduced controlled and conditioned invariant subspaces as tools for linear system theory. Wonham and Morse (1970) introduced the name -invariant subspace, proved that the supremal one in a given subspace exists, gave the descending recursion to compute it, and used it to solve the disturbance decoupling problem and the decoupling of outputs by state feedback. Wonham's book Linear Multivariable Control, A Geometric Approach (first edition 1974, third edition 1985) made the method a standard part of linear control theory. The book of Trentelman, Stoorvogel and Hautus (2001) gives a modern treatment with the stabilizability subspaces.
References
- W. M. Wonham and A. S. Morse, Decoupling and pole assignment in linear multivariable systems, a geometric approach, SIAM Journal on Control 8(1), 1-18, 1970, the supremal (A, B)-invariant subspace contained in a given subspace and the descending recursion for it
- G. Basile and G. Marro, Controlled and conditioned invariant subspaces in linear system theory, Journal of Optimization Theory and Applications 3(5), 306-315, 1969, the controlled and conditioned invariant subspaces and the algorithms for the extreme ones
- W. Murray Wonham, Linear Multivariable Control, A Geometric Approach, third edition, Springer, 1985, Chapter 4, Disturbance Decoupling and Output Stabilization (the algorithm for the supremal (A, B)-invariant subspace)
- Harry L. Trentelman, Anton A. Stoorvogel and Malo Hautus, Control Theory for Linear Systems, Springer, 2001, Chapter 4, Controlled invariant subspaces
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 55N3T2 Edit this page History Report an error Markdown