This example shows how to validate linearization results by comparing the simulated output of the nonlinear model and the linearized model.
Linearize Simulink® model.
If you linearized your model in the Model Linearizer, you must export the linear model to the MATLAB® workspace.
Create input signal for validation. For example, a step input signal:
Simulate the Simulink model using the input signal.
simout is the simulated output of the nonlinear model.
Simulate the linear model
sys, and compare the time-domain
responses of the linear and nonlinear Simulink model.
The step response of the nonlinear model and linearized model are close, which validates that the linearization is accurate.
Increase the amplitude of the step signal from
Repeat the frequency response estimation with the increased amplitude of the input signal, and compare this time response plot to the exact linearization results.
The step response of linear system you obtained using exact linearization does not match the step response of the estimated frequency response with large input signal amplitude. The linear model obtained using exact linearization does not match the full nonlinear model at amplitudes large enough to deviate from the specified operating point.
For time-domain validation of linearization, use
frest.createStep to create a step signal. Use the step signal as an input to
frest.simCompare, which compares the
simulated output of the nonlinear model and the linearized model.
The step input helps you assess whether the linear model accurately captures the dominant time constants as it goes through the step transients.
The step input also shows whether you correctly captured the DC gain of the Simulink model by comparing the final value of the exact linearization simulation with the frequency response estimation.