Frequency Domain System Identification
System identification deals with the problem of identifying a model to accurately describe the response of a physical system to some input. This worksheet uses a spring-mass-damper system to illustrate the problem where the structure of the model is known and the parameters of the model are to be identified.
Identifying the model parameters that best describe the physical system is accomplished by exciting the system with a realistic input signal. The resulting output is then converted to the frequency domain and the parameters are estimated using a least-squares approximation approach.
System Definition
Parameter Definition
Variable Definition
Model Definition
Signal Generation and Simulation
Discrete Fourier Transform Calculations
Model-Based Parameter Estimation
The parameters, variables, and equations that define the spring-mass-damper model are found in the following sections:
Name
Value
Units
Parameters
Mass of the object m
kg
Damping coefficient (b)
kgs
Spring constant k
Nm
Simulation time Tsim
s
Sampling time Ts
Number of samples Ns
Noise standard deviation std
Description
Input Variables
ut
Input force on the mass
Output Variables
yt
Output position of the mass
MassSpringDamperEq≔M⋅y..+b⋅y.+k⋅yt=ut
M⁢ⅆ2ⅆt2⁢y⁡t+b⁢ⅆⅆt⁢y⁡t+k⁢y⁡t=u⁡t
InitialConditions≔y0=0, y.0=0
y⁡0=0,D⁡y⁡0=0
ParameterList≔M=mvalue,k=kvalue,b=bvalue
M=5,k=3,b=2
MassSpringDamperSys__continuous≔DiffEquationMassSpringDamperEq,inputvariable=ut,outputvariable=yt:
MassSpringDamperSys≔ToDiscreteMassSpringDamperSys__continuous,Ts:PrintSystemMassSpringDamperSys
Diff. Equationdiscrete; sampletime = .5e-11 output(s); 1 input(s)inputvariable=u⁡qoutputvariable=y⁡qde=[M⁢400.0000000⁢y⁡q−800.0000000⁢y⁡q+1+400.0000000⁢y⁡q+2+b⁢−20.00000000⁢y⁡q+20.00000000⁢y⁡q+1+k⁢y⁡q=u⁡q]
Excitation Input
System Response
To excite the system, we apply a discrete chirp signal that sweeps the frequency spectrum from 0.01 Hz to 1 Hz over 50 seconds.
InputSignal≔Chirp1,0.9950,0.01,hertz=true,discrete=true,samplecount=Ns,sampletime=Ts:
noise is added to reflect a realistic application.
NoiseRV ≔ StatisticsRandomVariableNormal0, 0.05:
NoiseVector≔convertseqStatisticsSampleNoiseRV, i1,i=1..Ns,Vectorcolumn:
NoisyInput≔InputSignal+~NoiseVector:
TimeVector≔convertseqi,i=0.05..Tsim,Ts,Vectorcolumn:
The system response to InputSignal can be obtained using the DynamicSystems[Simulate] command. The response can be seen in the following plot.
OutputResponse≔SimulateMassSpringDamperSys, NoisyInput, parameters=ParameterList,initialconditions=InitialConditions:
plot1≔plotTimeVector,OutputResponse,legend=output response:
plot2≔plotTimeVector,NoisyInput,color=blue,legend=input signal,transparency=0.3:
plots:-displayplot1,plot2,gridlines=true
The results of converting the input, output and model signals to the frequency domain can be seen in the plots below. The Maple commands used to generated the Discrete Fourier Transform are found in the code edit region.
-
The Maple commands used to obtain the model-based parameter values are found in the following code edit region.
Using Maple's optimization routines, the parameter values that best describe the physical model were found to be:
EstimatedParameters
M=5.04376360521157,b=1.86287901484504,k=3.02288130522145
The difference in parameter values between those measured and those obtained through the estimation process are shown below.
ParameterDifference≔Δb=evalb,opt2−evalb,ParameterList, Δk=evalk,opt2−evalk,ParameterList, ΔM=evalM,opt2−evalM,ParameterList
Δb=−0.137120985154965,Δk=0.0228813052214467,ΔM=0.0437636052115664
The plot below shows the frequency response of the measured and the estimated model.
Download Help Document