Visual
Topic overview
State space analysis represents a system using a set of first-order differential equations expressed in matrix form: x_dot = Ax + Bu and y = Cx + Du. Errors in state space problems almost always trace back to incorrectly constructing the A, B, C, or D matrices, confusing state variables with output variables, or making sign errors when reading from a differential equation or transfer function.
Common mistakes
Mistake 1: Treating output variables as state variables when writing the state equations
Why it happens: State variables must be energy storage variables (inductor currents, capacitor voltages, or integrator outputs). Output variables can be algebraic combinations of states and inputs. Students sometimes assign the output y directly as a state variable and then write an equation for dy/dt instead of identifying the true states.
Correct approach: Identify state variables first. For an nth-order system described by a single ODE, the standard choice is x1 = y, x2 = y_dot, ..., xn = y^(n-1). Write the state equation for each. Then write the output equation separately using the C and D matrices.
Example: Wrong: For y_ddot + 3y_dot + 2y = u, student sets x1 = y_dot, x2 = y_ddot. State equation becomes x1_dot = x2, x2_dot = -2x1 - 3x2 + u. C matrix set to read x2 as output. Correct: Set x1 = y, x2 = y_dot. Then x1_dot = x2, x2_dot = -2x1 - 3x2 + u. A = [[0,1],[-2,-3]], B = [[0],[1]], C = [1,0], D = [0]. Output y = x1.
Mistake 2: Writing the companion matrix A with wrong signs in the last row
Why it happens: The last row of the companion form A matrix contains the negative coefficients of the characteristic polynomial. Students copy the coefficients directly from the ODE without negating them.
Correct approach: For the ODE y^(n) + a_{n-1}*y^(n-1) + ... + a_1*y_dot + a_0*y = u, the last row of A is [-a_0, -a_1, ..., -a_{n-1}]. Every coefficient must be negated.
Example: Wrong: y_ddot + 5y_dot + 6y = u. Student writes last row of A as [5, 6] (positive). A = [[0,1],[5,6]]. Eigenvalues of this A are not the poles of the system. Correct: Last row = [-6, -5]. A = [[0,1],[-6,-5]]. Eigenvalues: det(sI-A) = s^2 + 5s + 6 = (s+2)(s+3). Poles at -2 and -3, matching the ODE.
Mistake 3: Computing eigenvalues of A incorrectly by using the trace-determinant method for a 3x3 matrix
Why it happens: The trace-determinant shortcut (eigenvalues from trace and determinant) works for 2x2 matrices only. For 3x3 and larger matrices, students apply this shortcut and get wrong eigenvalues, which leads to incorrect stability conclusions.
Correct approach: For a 3x3 matrix, expand the characteristic polynomial det(lambda*I - A) = 0 fully. This gives a cubic equation. Solve it using the rational root theorem or numerical methods. Do not use the 2x2 trace-determinant shortcut.
Example: Wrong: For A = [[0,1,0],[0,0,1],[-6,-11,-6]], student computes trace=−6, det=−6. Uses eigenvalues = (trace ± sqrt(trace^2 - 4*det))/2 = wrong values. Correct: det(lambdaI - A) = lambda^3 + 6lambda^2 + 11lambda + 6 = (lambda+1)(lambda+2)(lambda+3) = 0. Eigenvalues: -1, -2, -3.
Mistake 4: Omitting the D matrix term in the output equation when the system has direct feedthrough
Why it happens: For strictly proper transfer functions, D=0 and the output equation y = Cx is sufficient. When the degree of the numerator equals the degree of the denominator, D is non-zero. Students default to D=0 for all systems.
Correct approach: Check whether the transfer function is proper (degree of numerator less than denominator) or biproper (degrees equal). If degrees are equal, D equals the leading coefficient ratio and must appear in y = Cx + Du.
Example: Wrong: H(s) = (s+3)/(s+2). Student writes state equation x_dot = -2x + u, output y = Cx only. With C=1, y = x. But y(inf) for unit step input is 3/2, not 1. Correct: H(s) = 1 + 1/(s+2). D=1. Output y = Cx + Du = x + u. For unit step at steady state: y = x_ss + 1 = 1/2 + 1 = 3/2. Correct.
Debugging tips
- After writing A, B, C, D matrices, verify by computing the transfer function H(s) = C*(sI-A)^(-1)*B + D and checking it matches the original transfer function.
- To check eigenvalues, verify that det(lambda_i*I - A) = 0 for each eigenvalue lambda_i you computed. This takes seconds and catches arithmetic errors immediately.
- Check matrix dimensions before multiplying. For a system with n states, p inputs, and q outputs: A is n x n, B is n x p, C is q x n, D is q x p. Dimension mismatch is an immediate signal of an error.
- For controllability, compute the controllability matrix M_c = [B, AB, A^2*B, ..., A^(n-1)*B] and check if its rank is n. If rank < n, the system is not fully controllable.
- For observability, compute the observability matrix M_o = [C; CA; CA^2; ...; CA^(n-1)] and check if its rank is n. These two checks together confirm whether state feedback and state estimation are feasible.
Exam warnings
- Stability in state space is determined by the eigenvalues of matrix A. A system is stable if and only if all eigenvalues have negative real parts. A common trap uses a matrix with a repeated eigenvalue on the imaginary axis. This system is marginally stable, not asymptotically stable. Check the Jordan form if eigenvalues are repeated.
- When a problem gives the state transition matrix phi(t) = e^(At) and asks for the system response, the free response is x(t) = phi(t)*x(0) and the forced response involves a convolution integral. Students often add these incorrectly by computing phi(t)*B*u(t) without the integral.
- Controllable canonical form and observable canonical form have the same characteristic polynomial but different A matrices. Do not assume a system in one canonical form is automatically in the other. The C matrix structure differs significantly.
- If a problem asks whether a specific state variable can be estimated from the output, check observability of the system. If the system is not fully observable, some states cannot be reconstructed from output measurements, regardless of how long you observe the output.