为什么我在 Simulink 模型中收到有关奇点(​singularit​y)的错误信息?

45 vues (au cours des 30 derniers jours)
MathWorks Support Team
MathWorks Support Team le 10 Oct 2019
完整的错误信息是:
Derivative of block at time is Inf of NaN. Stopping Simulation. There may be a singularity in thesolution. If not, try reducing the stepsize (either by reducing the fixed step size or by tightening the errortolerances.)
我尝试缩小步长(step size)和调整容差(error tolerances),但我还是收到同样的错误信息。我还尝试了改变求解器(solver),也没有很好的解决办法。

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 10 Oct 2019
Modifié(e) : MathWorks Support Team le 10 Oct 2019
此报错信息可能是由系统中的奇点引起的。
产生这种奇点的原因之一是,状态变量的值在一个步长内变化很大。此时,状态变量的值在两个状态之间“跳变”,Simulink 求解器将很难在容差范围内找到合适的步长。
要检查是否属于这种情况:
1. 返回并查看系统的状态变量值,具体方法为:
a)菜单栏选择:Simulation -> Configuration Parameters
b)选择 Data Import/Export -> Save to Workspace -> States,并将其保存为 output。
2.运行模型
3.绘制状态变量曲线:
plot(tout,xout)
从而查看是否有一个状态变量在某一个步长中(通常是曲线末尾)变化非常快。
有一些方法可以改善这种情况。如果可能,您可以重新建模(例如增加状态变量的阶数,即将原本忽略的某些高阶系统还原),从而使得状态变量不会跳变。
此外,您还可以为系统中的积分器块(integrator)设置特定的容差。更为详细的信息,请执行:
doc integrator
并参阅“Specifying the Absolute Tolerance for the Block's Outputs”标题下的内容。

Plus de réponses (0)

Catégories

En savoir plus sur 建模 dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!