System Identification Overview
System identification is a methodology for building mathematical models of dynamic systems using
measurements of the input and output signals of the system.
The process of system identification requires that you:
Measure the input and output signals from your system in time or frequency domain.
Select a model structure.
Apply an estimation method to estimate values for the adjustable parameters in the
candidate model structure.
Evaluate the estimated model to see if the model is adequate for your application needs.
Dynamic Systems and Models
In a dynamic system, the values of the output signals depend on both the instantaneous values of
the input signals and also on the past behavior of the system. For example, a car seat is a dynamic
system—the seat shape (settling position) depends on both the current weight of the passenger
(instantaneous value) and how long the passenger has been riding in the car (past behavior).
A model is a mathematical relationship between the input and output variables of the system.
Models of dynamic systems are typically described by differential or difference equations, transfer
functions, state-space equations, and pole-zero-gain models.
You can represent dynamic models in both continuous-time and discrete-time form.
An often-used example of a dynamic model is the equation of motion of a spring-mass-damper
system. As the following figure shows, the mass moves in response to the force F(t) applied on the
base to which the mass is attached. The input and output of this system are the force F(t) and
displacement y(t), respectively.
Continuous-Time Dynamic Model Example
You can represent the same physical system as several equivalent models. For example, you can
represent the mass-spring-damper system in continuous time as a second-order differential
equation:
md2ydt2+cdydt+ky(t)=F(t)
Here, m is the mass, k is the stiffness constant of the spring, and c is the damping coefficient. The
solution to this differential equation lets you determine the displacement of the mass y(t), as a
function of external force F(t) at any time t for known values of constant m, c, and k.
Consider the displacement y(t) and velocity v(t)=dy(t)dt as state variables:
x(t)=[y(t)v(t)]
You can express the previous equation of motion as a state-space model of the system:
dxdt=Ax(t)+BF(t)y(t)=Cx(t)
The matrices A, B, and C are related to the constants m, c, and k as follows:
ABC=⎡⎢⎢⎣0−km1−cm⎤⎥⎥⎦=[01m]=[10]
You can also obtain a transfer function model of the spring-mass-damper system by taking the
Laplace transform of the differential equation:
G(s)=Y(s)F(s)=1(ms2+cs+k)
Here, s is the Laplace variable.
Discrete-Time Dynamic Model Example
Suppose you can observe only the input and output variables F(t) and y(t) of the mass-spring-
damper system at discrete time instants t = nTs, where Ts is a fixed time interval and n = 0, 1 , 2, ....
The variables are said to be sampled with sample time Ts. Then, you can represent the relationship
between the sampled input-output variables as a second-order difference equation, such as
y(t)+a1y(t−Ts)+a2y(t−2Ts)=bF(t−Ts)
Often, for simplicity, Ts is taken as one time unit, and the equation can be written as
y(t)+a1y(t−1)+a2y(t−2)=bF(t−1)
Here, a1 and a2 are the model parameters. The model parameters are related to the system
constants m, c, and k, and the sample time Ts.
This difference equation shows the dynamic nature of the model. The displacement value at the
time instant t depends not only on the value of force F at a previous time instant, but also on the
displacement values at the previous two time instants y(t–1) and y(t–2).
You can use this equation to compute the displacement at a specific time. The displacement is
represented as a weighted sum of the past input and output values:
y(t)=bF(t−1)−a1y(t−1)−a2y(t−2)
This equation shows an iterative way of generating values of the output y(t) starting from initial
conditions y(0) and y(1) and measurements of input F(t). This computation is called simulation.
Alternatively, the output value at a given time t can be computed using the measured values of
output at the previous two time instants and the input value at a previous time instant. This
computation is called prediction. For more information on simulation and prediction using a model,
see topics on the Simulation and Prediction page.
You can also represent a discrete-time equation of motion in state-space and transfer-function
forms by performing the transformations similar to those described in Continuous-Time Dynamic
Model Example.
Use Measured Data in System Identification
System identification uses the input and output signals you measure from a system to estimate the
values of adjustable parameters in a given model structure. You can build models using time-
domain input-output signals, frequency response data, time -series signals, and time-series
spectra.
To obtain a good model of your system, you must have measured data that reflects the dynamic
behavior of the system. The accuracy of your model depends on the quality of your measurement
data, which in turn depends on your experimental design.
Time-Domain Data
Time-domain data consists of the input and output variables of the system that you record at a
uniform sampling interval over a period of time.
For example, if you measure the input force F(t) and mass displacement y(t) of the spring-mass-
damper system illustrated in Dynamic Systems and Models at a uniform sampling frequency of 10
Hz, you obtain the following vectors of measured values:
umeas=[F(Ts),F(2Ts),F(3Ts),...,F(NTs)]ymeas=[y(Ts),y(2Ts),y(3Ts),...,y(NTs)]
Here, Ts = 0.1 seconds and NTs is the time of the last measurement.
If you want to build a discrete-time model from this data, the data vectors umeas and ymeas and the
sample time Ts provide sufficient information for creating such a model.
If you want to build a continuous-time model, you must also know the intersample behavior of the
input signals during the experiment. For example, the input can be piecewise constant (zero-order
hold) or piecewise linear (first-order hold) between samples.
Frequency-Domain Data
Frequency-domain data represents measurements of the system input and output variables that
you record or store in the frequency domain. The frequency-domain signals are Fourier transforms
of the corresponding time-domain signals.
Frequency-domain data can also represent the frequency response of the system, represented by
the set of complex response values over a given frequency range. The frequency
response describes the outputs to sinusoidal inputs. If the input is a sine wave with frequency ω,
then the output is also a sine wave of the same frequency, whose amplitude is A(ω) times the
input signal amplitude and a phase shift of Φ(ω) with respect to the input signal. The frequency
response is A(ω)e(iΦ(ω)).
In the case of the mass-spring-damper system, you can obtain the frequency response data by
using a sinusoidal input force and measuring the corresponding amplitude gain and phase shift of
the response over a range of input frequencies.
You can use frequency-domain data to build both discrete-time and continuous-time models of
your system.
Data Quality Requirements
System identification requires that your data capture the important dynamics of your system. Good
experimental design ensures that you measure the right variables with sufficient accuracy and
duration to capture the dynamics you want to model. In general, your experiment must:
Use inputs that excite the system dynamics adequately. For example, a single step is
seldom enough excitation.
Measure data long enough to capture the important time constants.
Set up a data acquisition system that has a good signal-to-noise ratio.
Measure data at appropriate sampling intervals or frequency resolution.
You can analyze the data quality before building the model using the functions and techniques
described in Analyze Data. For example, you can analyze the input spectra to determine if the input
signals have sufficient power over the bandwidth of the system. To get analysis and processing
recommendations for your specific data, use advice.
You can also analyze your data to determine peak frequencies, input delays, important time
constants, and indication of nonlinearities using nonparametric analysis tools in this toolbox. You
can use this information for configuring model structures for building models from data. For more
information, see:
Correlation Models
Frequency-Response Models
Build Models from Data
Model Structure
A model structure is a mathematical relationship between input and output variables that contains
unknown parameters. Examples of model structures are transfer functions with adjustable poles
and zeros, state-space equations with unknown system matrices, and nonlinear parameterized
functions.
The following difference equation represents a simple model structure:
y(k)+ay(k−1)=bu(k)
Here, a and b are adjustable parameters.