我正在研究一个包含多个子系统和相当多变量/方程的大型模型。我一直在使用子系统上的保护属性,以便只有系统级结果在仿真结果中可见。这使得在Dymola模拟选项卡或FMU输入/输出中更容易找到系统级结果。但有些情况下,能够看到子系统的完整详细程度也是很好的。是否可以在Modelica中有条件地设置方程属性?
是否可以根据布尔参数或其他方式有条件地应用保护属性?
例如,是否有可能做类似下面的伪代码?
// Parameter that sets whether or not to use the protected attribute on subsystems.
parameter Boolean useProtected = true;
// Conditionally define the subsystem with or without protected attribute
if (useProtected) then
protected subsystem subsystem1 = ...
else
subsystem subsystem1 = ...
end if;
感谢, 贾斯汀
相关:http://stackoverflow.com/questions/7583567/searching-for-a-concept-like-verbosity-in-modelica – matth