State-Space Controllability Simulator Back
Control Engineering

State-Space Controllability Simulator

For a 2nd-order linear time-invariant system ẋ=Ax+Bu, this tool checks whether the input u alone can steer every direction of the state space — its controllability. Adjust the system matrix A and the input vector B to see the controllability matrix 𝒞=[B AB], its determinant, rank and verdict update in real time.

Parameters
Entries of the system matrix A. A=[[a11,a12],[a21,a22]] governs the free (natural) motion of the state x.
a11 (A row 1, col 1)
a12 (A row 1, col 2)
a21 (A row 2, col 1)
a22 (A row 2, col 2)
Input vector B=[b1,b2]. It sets which direction the input u pushes the state.
b1 (B row 1)
b2 (B row 2)
Results
Determinant det(𝒞)
Rank rank(𝒞)
AB component 1
AB component 2
Controllability
|det(𝒞)| (controllability strength)
Controllability-matrix column vectors — state plane

The two arrows from the origin are the column vectors B and AB of the controllability matrix. If independent, they span the plane (green parallelogram); if collinear (linearly dependent), they overlap on a red line and the system is uncontrollable.

Sensitivity of det(𝒞) — sweeping b2
Column-vector components of 𝒞
Theory & Key Formulas

$$\dot{x}=Ax+Bu,\qquad \mathcal{C}=\begin{bmatrix}B & AB\end{bmatrix}$$

The state equation and the controllability matrix 𝒞. For a 2nd-order system, 𝒞 is a 2×2 matrix with columns B and AB. AB is the product of A and the vector B.

$$\text{controllable}\iff \operatorname{rank}\mathcal{C}=n$$

Kalman controllability test. n is the state order (n=2 here). If the rank is less than n, the system is uncontrollable. For a 2×2 matrix, det(𝒞)≠0 and rank(𝒞)=2 are equivalent.

$$\det\mathcal{C}=b_1(AB)_2-b_2(AB)_1$$

Determinant of the 2×2 controllability matrix. For an n-th-order system you generally form the n×n matrix 𝒞=[B, AB, A²B, …, Aⁿ⁻¹B] and examine its rank.

What is Controllability?

🙋
"Controllability" came up in my control engineering class... in plain terms, what kind of property is it?
🎓
In one sentence, it is whether you can freely steer the system's state x to wherever you want using only the input u. Take an inverted pendulum standing on a cart: the state is four things — cart position, cart velocity, pendulum angle and angular velocity. If it is controllable, the force pushing the cart alone can drive all four to any values you like. If it is uncontrollable, no matter how hard you try, some state stays out of reach.
🙋
A state that stays out of reach — how do you tell when that happens? This tool has sliders for A and B.
🎓
That is where the "controllability matrix" 𝒞 comes in. For a 2nd-order system, 𝒞=[B AB] — the input vector B and AB (B multiplied once by A) placed side by side as a 2×2 matrix. B is the direction the input pushes directly, and AB is the direction that influence reaches one step later. If these two vectors can span the whole plane, the system is controllable; if they cannot, it is uncontrollable. The canvas in the top right shows exactly these two arrows.
🙋
I see — two arrows! So to check whether they "span the plane", you look at the determinant?
🎓
Right, for a 2×2 case computing det(𝒞) is the quickest. If B and AB are independent, the determinant is some non-zero value, the rank is 2, and the system is controllable. If B and AB are parallel (linearly dependent), the determinant is exactly 0, the rank drops to 1, and the system is uncontrollable. With the default b1=0, b2=1 on the left, AB becomes [1,-2], so det=-1. Since that is not zero, the result card says this system is controllable.
🙋
I get that a non-zero determinant is good. But does the value of |det| itself mean anything? There is a "controllability strength" card.
🎓
Good question. Whether the system is controllable is a yes/no test of "is it zero or not", but in practice "how close to zero" matters too. A system with a small |det| is controllable on paper but numerically almost uncontrollable: feedback gains blow up enormously, so it becomes noise-sensitive or the actuator saturates. So watching |det| as a measure of "controllability strength" gives you a sense of whether the design is realistic. The rigorous tool is the singular value of the Gramian, but |det| is enough to build intuition.
🙋
One last thing. If a system is controllable, what is the payoff?
🎓
If it is controllable, you can do "pole placement" freely — that is the biggest reward. By choosing the gain K of the state feedback u=-Kx well, you can put the poles (eigenvalues) of the closed-loop system anywhere you want. That means even an unstable system can be designed to have exactly the response speed and damping you want. With an uncontrollable mode, that pole cannot be moved by K. If that mode happens to be unstable, no state feedback can ever stabilize it. That is why checking controllability is the starting point of control system design.

Frequently Asked Questions

Controllability is the property of whether a suitable input u(t) can move the state x to any point in finite time. For an n-th-order LTI system ẋ=Ax+Bu, you form the controllability matrix 𝒞=[B, AB, A²B, …, Aⁿ⁻¹B] and the system is controllable if its rank equals n (the Kalman controllability test). This tool handles a 2nd-order system, so 𝒞=[B AB], and the system is controllable when its determinant is non-zero (rank = 2).
When det(𝒞)=0, the column vectors B and AB lie on the same line (linearly dependent) and the rank of the controllability matrix drops from 2 to 1 or below. This means the input u can move the state in only part of the state space — the system is uncontrollable. Physically, a mode exists that the input cannot excite, so the state along that direction stays at its initial value or is left to the system's free motion. In this tool, B and AB overlap on a red line.
There is no direct relation. Controllability asks "can the input move the state?" while stability asks "will the state stay bounded if left alone?" — two separate properties. Systems can be uncontrollable yet stable, or controllable yet unstable. The key point is that if an uncontrollable mode is unstable, state feedback cannot stabilize it. If the system is controllable, arbitrary pole placement is possible, so even unstable poles can be moved freely into the left half-plane.
The further |det(𝒞)| is from zero, the closer the column vectors B and AB are to being orthogonal and independent, giving a rough measure of "controllability strength". A system with a small |det| (close to zero) is numerically near-uncontrollable: feedback gains become extremely large, or a tiny model error makes it effectively uncontrollable. The rigorous measure is the smallest singular value of the controllability Gramian, but the |det| in this tool is an intuitive approximate indicator.

Real-World Applications

Stabilizing an inverted pendulum / cart system: The inverted pendulum, a control-engineering classic, is modeled with a 4th-order state of position, velocity, angle and angular velocity. The first design step is to confirm the system is controllable. If it is, state feedback can place the poles and shift the unstable "falling" mode into the left half-plane to keep it upright. The 2nd-order system in this tool lets you experience that decision logic in its minimal form.

Actuator placement for multi-input systems: In aircraft attitude control or four-wheel independent steering, where you place the actuators (the direction of the input B) determines controllability. At the design stage, you compare the rank and |det| of the controllability matrix for several candidate B vectors and choose a layout that can move every mode with sufficient "strength". The same test appears in fault-tolerant design — checking that the system does not become uncontrollable if one sensor or actuator fails.

Prerequisite check for modern control (LQR / pole placement): State-feedback design by LQR or pole placement assumes the plant is controllable (or at least stabilizable). Field toolchains such as MATLAB's ctrb / rank and Python python-control's ctrb always begin with a controllability test. If an uncontrollable mode is present, the designer cannot touch it, so the choice of input or the modeling itself must be reconsidered.

Process control and power systems: Even in large-scale systems such as temperature/concentration control of a chemical plant or frequency/voltage control of a power grid, controllability is the basis for judging whether a given control input can drive the whole system to a desired state. It is also directly tied to strategies like separating the controllable and uncontrollable subspaces (Kalman decomposition) and concentrating design resources only on the controllable part.

Common Misconceptions and Pitfalls

The most common mistake is confusing controllability with stability. Controllability is "can the input move the state?" while stability is "does the state stay bounded once the input is removed?" — completely separate properties. A controllable-but-unstable system (like an inverted pendulum) is perfectly ordinary; in fact that is exactly where control is needed. Conversely, uncontrollable-but-stable systems also exist. Understand that the det(𝒞) in this tool is a controllability indicator, distinct from the eigenvalues of A (stability). det(𝒞)≠0 alone does not mean the system is stable.

Next, assuming that being numerically controllable means there is no practical problem. Even if det(𝒞) is non-zero, a system with det very close to zero is "almost uncontrollable". Forcing pole placement in that state makes the feedback gain K extremely large, amplifies measurement noise, saturates actuators quickly, and becomes extremely sensitive to model error. Even with rank=2 on paper, a small |det| can mean "the design is possible but useless in reality". The practical rule is to look not only at the yes/no of controllability but also at its "strength".

Finally, over-trusting the numerical rank computation of the controllability matrix. As the order n grows, the terms Aⁿ⁻¹B in 𝒞=[B, AB, …, Aⁿ⁻¹B] become orders of magnitude larger (or smaller), making the matrix extremely ill-conditioned. For high-order systems, therefore, instead of the determinant or a naive rank computation, you evaluate the effective rank with singular value decomposition (SVD), or use the numerically stable controllability Gramian or a transformation to staircase form. This tool is a 2nd-order system for conceptual understanding so the issue does not surface, but for real systems it is important not to simply trust "rank=n means controllable" and to check the condition number too.

How to Use

  1. Enter the four state matrix A coefficients (a11, a12, a21, a22) defining your 2nd-order LTI system dynamics ẋ=Ax+Bu.
  2. Specify the input vector B components or allow the simulator to use default [1, 0] or [0, 1] configurations.
  3. Click Calculate to compute the controllability matrix 𝒞=[B AB] and its rank; the system is controllable if rank(𝒞)=2.

Worked Example

Consider a DC motor speed-control system with A=[[0, 1], [-5, -2]] (natural frequency ωn≈2.24 rad/s, damping ζ≈0.45) and B=[0, 1]. The controllability matrix is 𝒞=[[0, 1], [1, -2]]. det(𝒞)=-1, rank(𝒞)=2, so the system is fully controllable. An input torque command can independently regulate both angular position and velocity. If instead B=[1, 0], then det(𝒞)=0 and rank(𝒞)=1; velocity control via position input alone becomes impossible.

Practical Notes

  1. Aircraft pitch control: A typically represents short-period dynamics; controllability confirms elevator input reaches both pitch rate and angle states.
  2. Zero determinant (det(𝒞)=0) indicates unobservable or uncontrollable modes; check B placement relative to A eigenvalues.
  3. Controllability strength |det(𝒞)| guides observer/controller pole placement margins; larger values enable more aggressive feedback without saturation.