% Set the model reference to normal mode for accurate linearization
set_param('scdspeed_ctrlloop/Engine Model','SimulationMode','Normal')
% Linearize the model
sys = linearize(mdl,io);
% Estimate the frequency response between 10 and 100 rad/s
in = frest.Sinestream('Frequency',logspace(1,2,10),'NumPeriods',30,'SettlingPeriods',25);
[sysest,simout] = frestimate(mdl,io,in);
% Compare the results
frest.simView(simout,in,sysest,sys)
The linearization results do not match the estimated frequency response for the first two
frequencies. To view the unfiltered time response, right-click the time response plot, and
clear Show filtered steady state output only.
The step input and external disturbances drive the model away from the operating point,
preventing the response from reaching steady-state. To correct this problem, find and
disable these time-varying source blocks that interfere with the estimation.
Identify the time-varying source blocks using frest.findSources.
srcblks = frest.findSources(mdl,io);
Create a frestimate options set to disable the blocks.
Effects of Time-Varying Source Blocks on Frequency Response Estimation