2016-08-02 51 views
1

我正在研究一个包含多个子系统和相当多变量/方程的大型模型。我一直在使用子系统上的保护属性,以便只有系统级结果在仿真结果中可见。这使得在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; 

感谢, 贾斯汀

+0

相关:http://stackoverflow.com/questions/7583567/searching-for-a-concept-like-verbosity-in-modelica – matth

回答

1

使用HideResult是一种可能性 - 另一个是始终让它保护,并存储受保护的变量(“模拟设置>输出>存储其他变量“)。

相关问题