This example shows how to validate linearization results using an estimated linear model.
In this example, you linearize a Simulink® model using the I/Os specified in the model. You then estimate the frequency response of the model using the same operating point (model initial condition). Finally, you compare the estimated response to the exact linearization result.
Linearize Simulink Model
Open the model.
sys = 'scdDCMotor'; open_system(sys)
Open the Linear Analysis Tool for the model.
In the Simulink model window, in the Apps gallery, click Model Linearizer.
Linearize the model at the default operating point and analysis I/Os, and generate a bode plot of the result.
Bode. The Bode plot of the linearized plant appears, and the
linsys1 appears in the Linear Analysis
Estimate Frequency Response of Model
Create a sinestream input signal for computing an approximation of the model by
frequency response estimation. In the Estimation tab, in the
Input Signal drop-down list, select
Initialize the input signal frequencies and parameters based on the linearized model.
Click Initialize frequencies and parameters.
The frequency display in the dialog box is populated with frequency points. The
software chooses the frequencies and input signal parameters automatically based on
the dynamics of
Set the amplitude of the input signal at all frequency points to 1. In the frequency display, select all the frequency points.
Enter 1 in the Amplitude field, and click
OK. The new input signal
appears in the Linear Analysis Workspace.
Estimate the frequency response and plot its frequency response on the existing Bode plot of the linearized system response. Click Bode Plot 1.
Examine estimation results.
Bode Plot 1 now shows the Bode responses for the estimated model and the linearized model.
The frequency response for the estimated model matches that of the linearized model.
For more information about frequency response estimation, see Frequency Response Estimation Basics.
For frequency-domain validation of linearization, create a sinestream signal. By analyzing one sinusoidal frequency at a time, the software can ignore some of the impact of nonlinear effects.
|Input Signal||Use When||See Also|
|Sinestream||All linearization inputs and outputs are on continuous signals.|
|Sinestream with fixed sample time||One or more of the linearization inputs and outputs is on a discrete signal|
You can easily create a sinestream signal based on your linearized model. The software uses the linearized model characteristics to accurately predict the number of sinusoid cycles at each frequency to reach steady state.
When diagnosing the frequency response estimation, you can use the sinestream signal to determine whether the time series at each frequency reaches steady state.