With the linio function, you specify two linearization input points, which are both
located on scalar Simulink signals. If you run the frestimate command to estimate the
frequency response for this model, two Simulink simulations occur, one for each input.
Linearize the model, and create an input signal using the linearization result.
sys = linearize(mdl,io);
in = frest.Sinestream(sys);
Before estimating the frequency response, find all source blocks in the signal paths of the
linearization outputs that generate time-varying signals using the findSources function.
Such time-varying signals can interfere with the signal at the linearization output points
and produce inaccurate estimation results. To disable the time-varying source blocks,
create an frestimateOptions option set and specify the BlocksToHoldConstant
option.
srcblks = frest.findSources('scdplane',io);
opt = frestimateOptions('BlocksToHoldConstant',srcblks);
Enable parallel computing using the UseParallel estimation option, which distributes
simulations among workers.
opt.UseParallel = 'on';
Run frestimate using parallel computing.
sysest = frestimate(mdl,io,in,opt);
Plot the estimation result against the analytical linearization
bodeopts = bodeoptions;
bodeopts.PhaseMatching = 'on';
bodeplot(sys,sysest,'r*',bodeopts);
Speed Up Frequency Response Estimation Using Parallel Computing