【发布时间】:2019-10-07 08:40:27
【问题描述】:
我是一名 OpenModelica 初学者,试图对具有恒定电压和电流限制的 DC/DC 转换器进行建模。基本上,输出应该提供恒定电压,直到达到最大电流,然后通过降低电压来保持该电流。
到目前为止,这是我代码的方程式部分:
model DC_DC "Voltage source with current limiting"
import SI = Modelica.SIunits;
parameter SI.Voltage Vnom(start=1) "Value of nominal output voltage";
parameter SI.Current Inom(start=1) "Value for maximum continous output current";
parameter SI.Current Imax(start=1) "Value for maximum output current";
Modelica.Electrical.Analog.Interfaces.PositivePin p
annotation (Placement(transformation(extent={{-110, -10},{-90,10}})));
Modelica.Electrical.Analog.Interfaces.NegativePin n
annotation (Placement(transformation(extent={{110, -10},{90,10}})));
SI.Voltage v;
equation
v = p.v - n.v;
if n.i > Imax and v <= Vnom then
n.i = Imax;
0 = p.i + n.i;
else
Vnom = p.v - n.v;
0 = p.i + n.i;
end if;
end DC_DC;
每当我进行模拟时,电压和电流的结果看起来就像我预期的那样,因此计算似乎是正确的。但是,我收到警告
已达到最大迭代次数,但未找到根。
谁能给我解释一下?谢谢!
【问题讨论】:
-
您能分享一个最小的工作示例吗?我可以想象
n.i是一个状态,并且您想将 when-equation 与 reinit-operator 一起使用。 -
我添加了最小工作模型。在这种情况下,您将如何应用 reinit 运算符?
标签: simulation modelica openmodelica dymola