State Space Representation Calculator
Convert a 2nd-order transfer function into controllable canonical form state-space matrices A, B, C, D, with eigenvalues and a stability verdict.
🔲 What is State Space Representation?
State-space representation describes a dynamic system using a set of first-order matrix differential equations, x-dot = Ax + Bu and y = Cx + Du, instead of a single higher-order transfer function. The vector x holds the system's internal state variables, and the constant matrices A, B, C, and D together fully define how the system evolves over time and how its output relates to its input and internal state.
Control engineers convert transfer functions into state-space form constantly when moving from classical (frequency-domain) design methods toward modern control techniques. A controls engineer designing a linear-quadratic regulator (LQR) or a Kalman filter needs the system already expressed as A, B, C, D matrices, since those design methods are formulated directly in state-space terms. A student verifying a hand-derived state-space model checks that the eigenvalues of A match the transfer function's known poles, exactly the cross-check this calculator provides automatically. An engineer working with a multi-input multi-output (MIMO) system uses state-space form because a single transfer function cannot represent multiple inputs and outputs at once, while a state-space model extends naturally.
A common misconception is that there is only one correct state-space representation for a given transfer function. In reality, controllable canonical form (the specific realization this calculator builds) is just one of infinitely many equivalent representations, including observable canonical form, modal form, and Jordan form, all related by similarity transformations and all describing exactly the same input-output behavior with different internal state variables.
This calculator takes the four coefficients of a 2nd-order transfer function G(s) = (b1*s + b0) / (s^2 + a1*s + a0), builds the controllable canonical form state-space matrices A, B, C, and D directly, computes the eigenvalues of A as a stability cross-check against the transfer function's known poles, and illustrates the underlying signal flow with a labeled block diagram.
📐 Formula
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 — Stable System with Complex Eigenvalues
D(s) = s² + 4s + 13, N(s) = 13 (a1=4, a0=13, b1=0, b0=13)
Example 2 — Stable System with Real Distinct Eigenvalues
D(s) = s² + 5s + 6, N(s) = s + 3 (a1=5, a0=6, b1=1, b0=3)
Example 3 — Unstable System with Complex Eigenvalues
D(s) = s² − 2s + 5, N(s) = 4 (a1=−2, a0=5, b1=0, b0=4)
❓ Frequently Asked Questions
🔗 Related Calculators
What is state-space representation?
State-space representation describes a dynamic system using a set of first-order differential equations in matrix form, x-dot = Ax + Bu (the state equation) and y = Cx + Du (the output equation), instead of a single higher-order transfer function. The vector x holds the system's internal state variables, A, B, C, and D are constant matrices that fully define the system's behavior.
How do you convert a transfer function to state-space form?
For G(s) = (b1*s + b0) / (s^2 + a1*s + a0), controllable canonical form gives A = [[0, 1], [-a0, -a1]], B = [[0], [1]], C = [b0, b1], and D = [0], read directly off the transfer function's coefficients with no need to solve any equations.
What is controllable canonical form?
Controllable canonical form is a standard state-space realization built directly from a transfer function's coefficients with a simple, mechanical pattern (the denominator coefficients populate the bottom row of A with a sign flip, the numerator coefficients populate C directly). It guarantees the resulting state-space system is fully controllable, meaning every state can be driven to any value by choosing the right input.
How do you find the eigenvalues of the A matrix?
For the 2x2 matrix A = [[0, 1], [-a0, -a1]], the characteristic equation is lambda squared plus a1 times lambda plus a0 equals zero, solved with the quadratic formula: lambda = (-a1 plus-or-minus square root of (a1 squared minus 4*a0)) divided by 2. A negative discriminant gives a complex-conjugate pair of eigenvalues.
Why do the eigenvalues of A equal the poles of the transfer function?
This is a fundamental property of any valid state-space realization: the eigenvalues of the state matrix A are always identical to the poles of the transfer function it represents, regardless of which canonical form (controllable, observable, modal) was used to build A. It is a useful built-in cross-check when converting by hand.
How is stability determined from a state-space model?
A linear time-invariant state-space system is stable if and only if every eigenvalue of the state matrix A has a strictly negative real part, placing all eigenvalues in the left half of the complex plane. This is the exact same stability condition as checking a transfer function's poles, since the two sets of values are identical.
What do the B, C, and D matrices represent?
B (the input matrix) determines how the input u affects each state's rate of change. C (the output matrix) determines how the output y is built from the current state values. D (the feedthrough matrix) captures any direct, instantaneous path from input to output that bypasses the states entirely, D = [0] here since this transfer function's numerator degree is lower than its denominator degree.
Is controllable canonical form the only way to write a state-space model?
No. The same transfer function can be represented in observable canonical form, modal (diagonal) form, Jordan form, or countless other coordinate choices related by a similarity transformation. All of these give identical input-output behavior and identical eigenvalues, they differ only in what the internal state variables physically represent.
Why is state-space representation preferred over transfer functions for complex systems?
State-space representation naturally extends to systems with multiple inputs and multiple outputs (MIMO systems), time-varying dynamics, and nonlinear systems in ways a single-input single-output transfer function cannot. Modern control techniques like the linear-quadratic regulator (LQR) and Kalman filtering are formulated directly in state-space terms.
Does the order of setting a1, a0, b1, b0 matter for the result?
No, all four coefficients are independent inputs read directly from your entered transfer function G(s) = (b1*s + b0) / (s^2 + a1*s + a0). Changing any one of them updates the corresponding matrix entry (or entries) immediately, without affecting how the others map into A, B, C, or D.