Frequency Domain System Identification - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


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

 

System Definition

 

The parameters, variables, and equations that define the spring-mass-damper model are found in the following sections:

Parameter Definition

 

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

s

Number of samples Ns

Noise standard deviation std

 

 

Retrieve parameters

 

 

Variable Definition

 

Name

Description

Input Variables

ut

Input force on the mass

Output Variables

yt

Output position of the mass

 

Model Definition

 

MassSpringDamperEqMy..+by.+kyt=ut

Mⅆ2ⅆt2yt+bⅆⅆtyt+kyt=ut

(1)

InitialConditionsy0=0, y.0=0

y0=0,Dy0=0

(2)

ParameterListM=mvalue,k=kvalue,b=bvalue

M=5,k=3,b=2

(3)

MassSpringDamperSys__continuousDiffEquationMassSpringDamperEq,inputvariable=ut,outputvariable=yt:

MassSpringDamperSysToDiscreteMassSpringDamperSys__continuous,Ts:PrintSystemMassSpringDamperSys

Diff. Equationdiscrete; sampletime = .5e-11 output(s); 1 input(s)inputvariable=uqoutputvariable=yqde=[M400.0000000yq800.0000000yq+1+400.0000000yq+2+b20.00000000yq+20.00000000yq+1+kyq=uq]

(4)

 

 

Signal Generation and Simulation

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.

InputSignalChirp1,0.9950,0.01,hertz=true,discrete=true,samplecount=Ns,sampletime=Ts:

noise is added to reflect a realistic application.

 

 

NoiseRV  StatisticsRandomVariableNormal0, 0.05:

NoiseVectorconvertseqStatisticsSampleNoiseRV, i1,i=1..Ns,Vectorcolumn:

NoisyInputInputSignal+~NoiseVector:

TimeVectorconvertseqi,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.

 

OutputResponseSimulateMassSpringDamperSys, NoisyInput, parameters=ParameterList,initialconditions=InitialConditions:

plot1plotTimeVector,OutputResponse,legend=output response:

plot2plotTimeVector,NoisyInput,color=blue,legend=input signal,transparency=0.3:     

plots:-displayplot1,plot2,gridlines=true

Discrete Fourier Transform Calculations

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.

 

DFT calculations

 -

Model-Based Parameter Estimation

 

The Maple commands used to obtain the model-based parameter values are found in the following code edit region.

 

Parameter Estimation Proc

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

(5)

 

The difference in parameter values between those measured and those obtained through the estimation process are shown below.

ParameterDifferenceΔb=evalb,opt2evalb,ParameterList, Δk=evalk,opt2evalk,ParameterList, ΔM=evalM,opt2evalM,ParameterList

Δb=0.137120985154965,Δk=0.0228813052214467,ΔM=0.0437636052115664

(6)

 

The plot below shows the frequency response of the measured and the estimated model.