| Contents | Index |
| On this page… |
|---|
This example shows how to perform frequency response estimation for a model using the Linear Analysis Tool.
Open Simulink model.
sys = 'f14'; open_system(sys);
To learn more about general model requirements, see Model Requirements.
Create an input signal for estimation.
To easily create the input signal, linearize the model and use the linearization result. Alternately, you may manually specify the parameters of the input signal by using the Create sinestream input dialog box of the Linear Analysis Tool. For more information, see Creating Input Signals for Estimation.
Define linearization input and output signals.
Right-click the f14/Sum1 block output signal. Select Linearization Points > Input Point.
Right-click the f14/Gain5 output signal. Select Linearization Points > Output Point.
(Optional) Identify all time varying source blocks and hold them constant during the estimation.
Time varying signals can interfere with the signal at the linearization output points and produce inaccurate estimation results.
In the Frequency Response Estimation tab, click Options.
This action opens the Options for frequency response estimation dialog box.
In the Time Varying Sources tab, click Find and add time varying blocks automatically.

This action populates the time varying sources list with the block paths of the time varying sources in the model. These sources will be held constant during estimation.

(Optional) Enable the Diagnostic Viewer.
In the Frequency Response Estimation tab, select the Launch Diagnostic Viewer check box.
This action sets the Diagnostic Viewer to open when the frequency response estimation is performed.
Estimate the frequency response.
Click
to estimate the frequency response of the model.

This action generates a frequency response estimation of the plant, estsys1, in the Linear Analysis Workspace. estsys1 uses in_sine1 as the input signal and the model operating conditions as the operating point.

See the Diagnostic Viewer to analyze the estimated frequency response.

For more information, see Analyzing Estimated Frequency Response.
Use linearization I/O points to specify input and output points for frequency response estimation.
Example:
io(1) = linio('f14/Sum1',1)
io(2) = linio('f14/Gain5',1,'out')
For more information about linearization I/O points, see Specifying Subsystem, Loop, or Block to Linearize and the linio reference page.
Identify all source blocks that generate time-varying signals in the signal path of the linearization outputs. Such time-varying signals can interfere with the signal at the linearization output points and produce inaccurate estimation results.
First, use frest.findSources to identify time-varying source blocks that can interfere with estimation. frest.findSources finds all time-varying source blocks in the signal path of the linearization output points.
Example:
Identify the time-varying source blocks in the f14 model:
srcblks = frest.findSources('f14',io); Next, to disable these blocks during estimation, use frestimateOptions.
For example:
opts = frestimateOptions; opts.BlocksToHoldConstant = srcblks;
For more information, see the frest.findSources and frestimateOptions reference pages.
Estimate the frequency response.
Example:
[sysest,simout] = frestimate('f14',io,input,opts)sysest is the estimated frequency response. simout is the simulated output that is a Simulink.Timeseries object.
For more information about syntax and argument descriptions, see the frestimate reference page.
Tip To speed up your estimation or decrease memory requirements, see Managing Estimation Speed and Memory. |
Open the Simulation Results Viewer to analyze the estimated frequency response. For example:
frest.simView(simout,input,sysest);
You can compare the estimated frequency response (sysest) to a system you linearized using exact linearization (sys):
frest.simView(simout,input,sysest,sys);

For more information, see Analyzing Estimated Frequency Response.
![]() | Creating Input Signals for Estimation | Analyzing Estimated Frequency Response | ![]() |

Learn more about resources for designing, testing, and implementing control systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |