| Contents | Index |
| On this page… |
|---|
Estimating Frequency Response Using Linear Analysis Tool Estimating Frequency Response with Linearization Based Input Using Linear Analysis Tool |
This example shows how to perform frequency response estimation for a model using the Linear Analysis Tool.
Step 1. Open Simulink model and Linear Analysis Tool.
Open Simulink model.
sys = 'scdDCMotor';
open_system(sys);Open the Linear Analysis Tool for the model.
In the Simulink model window, select Tools > Control Design > Linear Analysis.
Step 2. Create an input signal for estimation.
Click the Frequency Response Estimation tab.

Open the Create sinestream input dialog box.
In the Input Signal list, select Sinestream.

Open the Add frequencies dialog box.
Click
to add frequency points to the input signal.
Specify the frequency range for the input.
Enter .1 in the From box and 100 in the To box. Enter 100 in the box for the number of frequency points.

Click OK.
The added points are visible in the Frequency content viewer of the Create sinestream input dialog box.

In the Frequency content viewer of the Create sinestream input dialog box, select all the frequency points.

Specify the amplitude of the input signal.
Enter 1 in the Amplitude box.
Create the input sinestream signal.
Click OK. The new input signal, in_sine1, appears in the Linear Analysis Workspace.
Step 3. Estimate frequency response.
Click
. The frequency response estimation result, estsys1,
appears in the Linear Analysis Workspace.

This example shows how to perform frequency response estimation for a model using the Linear Analysis Tool. The input signal used for estimation is based on the linearization of the model.
Step 1. Linearize Simulink model.
Open Simulink model.
sys = 'scdDCMotor';
open_system(sys);Open the Linear Analysis Tool for the model.
In the Simulink model window, select Tools > Control Design > Linear Analysis.
In the Plot Result list, choose New Bode.
Linearize the model.
Click
. A new linearized model, linsys1,
appears in the Linear Analysis Workspace.
The software used the model initial conditions as the operating point to generate linsys1.

Step 2. Create sinestream input signal.
Click the Frequency Response Estimation tab.
In this tab, you estimate the frequency response of the model.
Open the Create sinestream input dialog box.
Select Sinestream from the Input Signal list.

Initialize the input signal frequencies and parameters based on linsys1.
Click Initialize frequencies and parameters.

The Frequency content viewer is populated with frequency points. The software chooses the frequencies and input signal parameters automatically based on the dynamics of linsys1.
In the Frequency content viewer of the Create sinestream input dialog box, select all the frequency points.

Specify the amplitude of the input signal.
Enter 1 in the Amplitude box.
Create the input sinestream signal.
Click OK. The input signal in_sine1 appears in the Linear Analysis Workspace.
Step 3. Select the plot to display the estimation result.
In the Plot Result list, choose Bode Plot 1 to add the next computed linear system to Bode Plot 1.

Step 4. Estimate frequency response.
Click
. The estimated system, estsys1,
appears in the Linear Analysis Workspace.
Step 5. 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.
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 Specify Model Portion 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.
![]() | Modifying 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 |