By the end of this section, you should be able to
Understand benefits/drawbacks of state-space (SS) models versus transfer functions (TF)
Know when each may be appropriate to use
Create SS models for linear mechanical systems and identify state vector and matrices that describe system
Do this for SISO, SIMO, MISO and MIMO systems
Convert SS model to TF and vice-versa in MATLAB
Numerically solve SS models using MATLAB (ode45)
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.