2016-08-02 48 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是一種可能性 - 另一個是始終讓它保護,並存儲受保護的變量(「模擬設置>輸出>存儲其他變量「)。

相關問題