By the end of this section, you should be able to
Select state variables that fully describe system
Convert higher-order differential equations into equivalent set of first-order state equations
Assemble state-space form x’ = Ax + Bu and y = Cx + Du, and interpret what A, B, C, and D represent physically
Incorporate inputs and initial conditions to predict state and output response over time
Convert between state-space and transfer function representations and verify equivalence by matching poles and key response features
Determine stability from eigenvalues of A and relate eigenvalue location to expected time-domain behavior
Simulate state and output responses in MATLAB or Simulink and check results against transfer-function-based simulations
This section introduces state-space modeling, a compact way to represent linear dynamic systems in Measurement and Dynamic Response using a state vector and the A, B, C, and D matrices. State-space form is especially useful when your model has multiple inputs or outputs, coupled equations, or when you want a representation that connects naturally to numerical simulation and control workflows. In the lessons below you will compare the benefits and drawbacks of state-space models versus transfer functions, and you will practice deciding which representation fits a given problem. You will build state-space models for linear mechanical systems by starting from free body diagrams, writing equations of motion in the time domain, and then selecting state and input variables so each equation contains only first derivatives. From there you will isolate derivatives, group coefficients, add mapping equations that relate derivatives of state variables, and assemble the matrix form needed for SISO, SIMO, MISO, and MIMO systems. You will also define outputs through the C matrix and any direct feedthrough through the D matrix, including cases where sensor definitions create relative measurements. Finally, you will use MATLAB to convert between state-space and transfer function representations and to numerically solve ordinary differential equation models using ode45 and the Runge-Kutta idea behind it. Use the table of contents below to jump to examples, workflows, and MATLAB resources.
Draw all FBDs
Write EOM(s) for each FBD in the time domain
Identify state and input variables
Create input vector (u) and state vector (x)
State variables include one less than the highest derivative for each dependent variable
Rewrite equations using state variables such that there is only one first derivative in any one equation
If a variable can be replaced by a state variable, it must be
Isolate all first derivatives on LHS of equations
Group coefficients in front of state and input variables on RHS
Add “mapping” equations to relate derivatives of state variables
Put system of equations into matrix form
Create A and B
Create the output matrix, C, and feedthrough matrix, D
Outputs of the system will be state variables themselves, combinations of state variables or scaled versions of state variables
Often matrices of zeros and ones for this course
C can be complicated by using sensors with relative measurements
If there are state variable, inputs and outputs/observables
A will be
B will be
C will be
D will be
See https://sites.google.com/view/jmm-matlab/course-content/3-numerical-mathematics/10-ordinary-differential-equations-odes for more detail on using ode45.