2017-05-26 67 views
0

我的模型目前大致爲2000個方程,模擬週期爲幾個星期。我正在使用OpenModelica連接編輯器。減少OpenModelica中輸出變量的數量

我面臨的問題是大量的輸出變量,並且我有劇情窗口崩潰了幾次。

問題是,我怎樣才能減少輸出變量的數量?

我只對他們中的20-50人真正感興趣。我知道我可以通過使它們受保護來刪除參數輸出,但我一直無法找到任何類似的變量技巧。

回答

1

如果您通過命令行模擬模型,請參閱variableFilter參數simulate命令https://build.openmodelica.org/Documentation/OpenModelica.Scripting.simulate.html

如果您正在使用OMEdit然後Simulation->Simulation Setup->Output->Variable Filter (Optional)

+0

感謝您的迴應!我看到它被稱爲「過濾變量」後,我遇到了這個鏈接[鏈接](https://openmodelica.org/forum/default-topic/1227-filtering-variables-in-simulation),這也很有用。 但是,我仍然無法使其實際工作。讓我們想要的變量是P,在組件abc中,然後我希望在過濾器變量行中寫入abc.P。如果我這樣做,它只是刪除所有變量(但不是參數)。 – Bart

0

其實,保護不限於參數。下面是一個複製Modelica.Mechanics.Translational.Examples.SignConvention並保護除mass1之外的所有內容的示例。 Dymola 2017FD01以迂腐模式進行測試(所以它也應該在OpenModelica中工作);它工作正常,只給出mass1參數和變量的模擬結果

model SignConvention "Examples for the used sign conventions." 
extends Modelica.Icons.Example; 
Modelica.Mechanics.Translational.Components.Mass mass1(
    L=1, 
    s(fixed=true), 
    v(fixed=true), 
    m=1) a; 

protected 
Modelica.Mechanics.Translational.Sources.Force force1 
    a; 
Modelica.Blocks.Sources.Constant constant1(k=1) a; 
Modelica.Mechanics.Translational.Components.Mass mass2(
    L=1, 
    s(fixed=true), 
    v(fixed=true), 
    m=1) a; 
Modelica.Mechanics.Translational.Sources.Force force2 
    a; 
Modelica.Blocks.Sources.Constant constant2(k=1) a; 
Modelica.Mechanics.Translational.Components.Mass mass3(
    L=1, 
    s(fixed=true), 
    v(fixed=true), 
    m=1) a; 
Modelica.Mechanics.Translational.Sources.Force force3(useSupport=true) 
    a; 
Modelica.Blocks.Sources.Constant constant3(k=1) a; 
Modelica.Mechanics.Translational.Components.Fixed fixed 
    a; 

equation 
... 
+0

在OpenModelica連接編輯器中,保護變量通常不起作用,部分原因是由於變量的別名。不幸的是,'註釋(HideResult = true)'也不起作用 – Bart