主要内容

Troubleshoot Linearization Results at Command Line

此示例显示了如何使用A在命令行处调试Simulink®模型的线性化金宝app线性化范围目的。您还可以进行交互式解决线性化结果。有关更多信息,请参阅故障排除线性化导致模型线性化器

打开模型。

mdl =“ scdpendulum”;Open_System(MDL)

摆角的初始条件是90degrees counterclockwise from the upright unstable equilibrium of0学位。摆角速度的初始条件是0deg/s。维持此状态的名义扭矩是-49。05n m。此配置保存为模型初始条件。

线性化模型

Linearize the model using the analysis points defined in the model and the model operating point.

io = getlinio(mdl); linsys = linearize(mdl,io);

要检查线性化结果,请绘制其Bode响应。

bode(linsys)

该模型线性为零,使得扭矩,tau,对角度或角速度没有影响。要查找零线性化的来源,您可以使用线性化范围目的。

通过启用顾问线性化模型

要在线性化过程中收集诊断信息并创建用于故障排除的顾问,请首先创建一个线性化选项集,指定Storeadvisor选项为true

opt =线性化(线性化)(“ Storeadvisor”,真的);

使用此选项集线性化simul金宝appink模型。返回信息output argument, which contains linearization diagnostic information in a线性化范围目的。

[linsys1,〜,info] =线性化(mdl,io,opt);

Extract the线性化范围目的。

advisor = info.Advisor;

突出显示线性化路径

要显示当前线性化的线性化路径,请使用highlight

突出显示(顾问)

查看摆子系统。

如线化路径对话框中所示,块突出显示了:

  • Blue numerically influence the model linearization.

  • 红色在线化路径上,但不影响当前工作点和块参数的模型线性化。

由于该模型是线性化为零的,因此没有块有助于线性化。

调查潜在问题的障碍

要获取可能有问题的块障碍信息,请使用advise。此功能返回一个新功能线性化范围对象包含在线性路径上的块上的信息,该块至少满足以下标准之一:

  • 有有关其线性化的诊断信息

  • 线性化至零

  • 已取代线性化

adv1 =建议(顾问);

View a summary of the diagnostic information for these blocks, usegetBlockinfo

getBlockinfo(adv1)
ANS =块的线性化诊断:块信息:------------索引块路径上有助于线性化线性化方法1. scdpendulum/pendulum/pendulum/pendulum/饱和度是否确切2. SCDPENDULUM/ANGEN_WRAP/TRIGOMETRIC函数1是否扰动3. scdpendulum/pendulum/trigonometric函数是否扰动

In this case, the advisor reports three potentially problematic blocks, a Saturation block and two Trigonometric Function blocks. When you run this example in MATLAB, the block paths display as hyperlinks. To go to one of these blocks in the model, click the corresponding block path hyperlink.

要查看有关特定块线性化的更多信息,请使用getBlockinfo。有关可用诊断的信息,请参阅大诊断

例如,获取饱和块的诊断信息。

Diaginfo = getBlockinfo(adv1,1)
diaginfo = scdpendulum/pendulum/pertation具有属性的线性化诊断:isonPath:'yes'''rontrestolinearization:'no'''''''线性化method:'精确'线性化:[1x1 ss] linearization:[1x1 ss]工作点:[1x1 linearize.Advisor.blockoperatippoint point.blockoperatiptoppoint points]

该块关于其线性化结果具有以下两个诊断消息。

  • The block is analytically linearized to zero because the signal input value (-49.05) is outside the lower limit of the block (-49). Consider linearizing the block as a gain.

  • The linearization of the block has at least one zero input/output pair resulting in a zero input/output pair for the system linearization. Modify the block parameters and/or operating point if the block is expected to contribute to the model linearization.

第一条消息表明该块在其较低饱和极限的外部线性化-49,由于输入操作点是-49。05

The message also indicates that the block can be linearized as a gain, which linearizes the block as1不管输入工作点是什么。

当您在MATLAB中运行此示例时,文本将块线性化为增益显示为超链接。要打开饱和块的“块参数”对话框,并突出显示将块线性化为增益的选项,请单击此超链接。

选择线性化时将其视为增益,然后单击OK

另外,您可以从命令行设置此参数。

set_param(“ scdpendulum/pendulum/饱和度”,,,,“线性化”,,,,'在'的)

第二个诊断消息指出,该块的线性化导致总体模型线性化至零。查看此块的线性化。

Diaginfo.Linearization
ans = d = u1 y1 0名称:饱和静态增益。

由于该块线性化为零,因此通过将其视为增益来修改块线性化是获得非零模型线性化的好第一步。

重新性化模型

要查看将饱和块视为增益的效果,请重新线性化模型并绘制其Bode响应。

[linsys2,〜,info] =线性化(mdl,io,opt);Bode(Linsys2)

模型线性化现在为非零。

To check if any blocks are still potentially problematic for linearization, extract the advisor object, and use theadvise功能。

Advisor2 = info.Advisor;adv2 =建议(Advisor2);

查看块诊断信息。

getBlockinfo(adv2)
ANS =块的线性化诊断:块信息:-----------索引块路径有助于线性化线性化方法1. scdpendulum/安安_wrap/trigonometric函数1是否扰动2. scdpendulum/pendulum/pendulum/trigonometric功能是否扰动

仍然列出了两个三角功能块。

突出显示更新线性化的线性化路径。

突出显示(Advisor2)

查看摆子系统。

要了解为什么这些块不导致线性化,请查看其相应的块诊断信息。例如,获取第二个三角功能块的诊断信息。

diagInfo = getBlockInfo(adv2,2)
diagInfo = Linearization Diagnostics for scdpendulum/pendulum/Trigonometric Function with properties: IsOnPath: 'Yes' ContributesToLinearization: 'No' LinearizationMethod: 'Perturbation' Linearization: [1x1 ss] OperatingPoint: [1x1 linearize.advisor.BlockOperatingPoint]

查看此块的线性化。

Diaginfo.Linearization
ans = D = u1 y1 0 Name: Trigonometric Function Static gain.

块线性为零。要查看该块当前操作条件是否期望此结果,请检查其操作点。

diagInfo.OperatingPoint
ANS = scdpendulum/pendulum/Trigonometric函数输入的块操作点:-------端口U 1 1.5708

块的输入操作点是$ \ pi/2 = 1.5708 $

您可以通过将SIN函数的第一个导数相对于输入来分析地分析块的线性化。

$$ \ frac {\ partial} {\ partial u} \ sin(u)= \ cos(u)$$

因此,在评估时$u = \pi/2$块的线性化为零。输入的来源是二阶集成器的第一个输出,该输出取决于状态θ.。因此,如果该块线性化至零$ \ theta = \ pi/2 + k \ pi $, 在哪里$ k $是一个整数。Angle_wrap子系统中的其他三角功能块适用于相同的条件。如果这些块不预期将这些块线性化至零,则可以修改操作点状态θ.,并重新确定模型。

创建并运行自定义查询

线性化顾问还提供用于创建自定义查询的对象和功能。使用这些查询,您可以在模型中找到匹配特定条件的块。例如,要查找使用数值扰动线性化的所有SISO块,请首先为每个搜索标准创建查询对象:

  • 有一个输入

  • 有一个输出

  • 在数值上受到干扰

QIN = LinqueryHasinputs(1);qout = linqueryhasoutputs(1);qperturb = linqueryIsnumeralyPerterted;

创建一个复合通过使用逻辑运算符组合这些查询对象来对象。

sisopert = Qin&Qout&qperturb;

搜索块诊断advisor2对于符合这些条件的块。

sisopertblocks = find(Advisor2,Sisopert)
sisopertblocks = linearizationAdvisor具有属性:模型:'scdpendulum'opuroppoint:[1x1 opcond.operatingpoint] blockdiagnostics:[1x3 linearize.Advisor.blockdiengnostic] queryType] queryType:'

模型中有三个使用数值扰动线性化的SISO块。

有关使用自定义查询的更多信息,请参阅在线性化结果中查找与特定标准匹配的块

BDCLOSE(MDL)

也可以看看

职能

Related Topics