【发布时间】:2020-04-21 01:02:09
【问题描述】:
大家好,
2020 年新年快乐
我在 64 位 windows 7 系统上使用 Openmodelica 1.14 发行版。
我在使用 OMSimulator 中的“when”语句时遇到了一些问题。在寻找解决方案时,我遇到了closed ticket #2664 in Openmodelica。我仍然可以在当前版本的 Openmodelica 中看到报告的问题。
我包含了#2664票的相关文件。
model SimpleTest "just a simple model - Compilation etc."
Modelica.Blocks.Interfaces.IntegerInput u annotation(Placement(visible = true, transformation(origin = {-100, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-80, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.IntegerOutput y annotation(Placement(visible = true, transformation(origin = {100, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {100, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
algorithm
when change(u) then
y := y + 2;
end when;
annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2}), graphics = {Rectangle(origin = {-6.15, 2.93}, fillColor = {0, 133, 199}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-77.89, 83.75}, {88.14, -92.53}})}));
end SimpleTest;
SimpleTest.mo 是否符合 Modelica 标准?
在编译 SimpleTest.mo 时,它会引发翻译警告
Assuming fixed start value for the following 1 variables:
y:DISCRETE(flow=false fixed = false ) SimpleTest type: Integer
如何避免这个错误?
【问题讨论】:
标签: modelica openmodelica