Main Content

Validate Linearization in Frequency Domain at Command Line

This example shows how to validate a block-by-block analytical linearization result using frequency response estimation. To run this example, you need Aerospace Blockset™ software.

Linearize Model

为轻型飞机打开Si金宝appmulink®型号。有关此模型的更多信息,请参阅Lightweight Airplane Design(Aerospace Blockset).

mdl ='scdskyhogg'; open_system(mdl)

You can linearize the lightweight airplane model from the altitude command signal,AltCMD, to the sensed height,h_sensed. These linear analysis points are already specified in the model.

io = getlinio(mdl)
2x1 vector of Linearization IOs: -------------------------- 1. Linearization input perturbation located at the following signal: - Block: scdskyhogg/Pilot/添加 - 端口:1-信号名称:AltCMD 2.线性化输出测量值位于以下信号: - 块:ScdskyHogg/车辆系统模型/Autopilot/Bus Selector1-端口:1-信号名称:

Linearize the model using the线性化function. The model is preconfigured to use an operating point obtained using a simulation snapshot at t = 75.

sys = linearize(mdl,io); bode(sys)

Estimate Frequency Response

To determine whether the linearization results properly capture characteristics of the nonlinear model, such as the anti-resonance around 6.28 rad/s, you can validate the linearization result usingfrestimate.

Create a sinestream input signal. Use the linearization result as an input argument to automatically set various parameters of the sinestream input signal, such as the set of frequencies and the number of periods for each frequency, based on the linear system.

in = frest.Sinestream(sys); in.Amplitude = 0.5
The sinestream input signal: Frequency : [0.0034142;0.0054345;0.0086502;0.013768 ...] (rad/s) Amplitude : 0.5 SamplesPerPeriod : [110417;69370;43582;27381 ...] NumPeriods : [4;4;4;4 ...] RampPeriods : 0 FreqUnits (rad/s,Hz): rad/s SettlingPeriods : [1;1;1;1 ...] ApplyFilteringInFRESTIMATE (on/off) : on SimulationOrder (Sequential/OneAtATime): Sequential

该软件选择25个计算响应的频率。这些频率在0.0034 rad/s和14.5 rad/s之间变化。自动选择的频率集中在有趣的动力学上(例如6.28 rad/s的抗共振)。对于每个频率中的每个频率,估计系统达到稳态所需的周期数量,并且在1个周期之间变化(0.0034 rad/s)和188个周期(14.5 rad/s)。

Estimate the frequency response using this input signal.frestimate使用输入信号模拟模型,这可能需要在正常模拟模型中花费很长时间。为了加快仿真的速度,请配置模型以使用快速加速器模式。

set_param(mdl,“SimulationMode','rapid');

Using rapid accelerator mode can significantly increase the speed of the simulation. The actual speed improvement depends on your computer configuration.

To run the frequency response estimation use the following command.

sysest = frestimate(mdl,in,io);

For this example, you can load the estimation result from a MAT-file.

加载scdskyhogg_frestresults.mat;

Compare the analytical linearization result against the frequency response data fromfrestimate. The frequency response data and analytical linearization result match well, validating that anti-resonance between the frequencies 1 and 10 rad/s does exist in the actual nonlinear airplane model.

bode(sys,sysest,'r*')

Close the model.

bdclose('scdskyhogg')

See Also

相关话题