2014-02-27 51 views
2

我無法真正在Modelica規範中找到任何答案,所以生病的人問你們。規範說明 A tool is free to solve equations, reorder expressions and to not evaluate expressions if their values do not influence the result (e.g. short-circuit evaluation of Boolean expressions). If-statements and if-expressions guarantee that their clauses are only evaluated if the appropriate condition is true, but relational operators generating state or time events will during continuous integration have the value from the most recent event. If a numeric operation overflows the result is undefined. For literals it is recommended to automatically convert the number to another type with greater precision. 現在,我想知道,工具是否可以選擇在積分器步驟中多次評估表達式?例如(可能不是一個有效的例子,只是給你們我想知道什麼:)的想法)Modelica評估訂單

Real x; 

equation 
    der(x) = -t; 
    Modelica.Utilities.Streams.print(String(time)); 

這將打印多次的同時,所以我有某種迭代繼續。但我真的很希望得到某些來源的證實。

回答

5

這很正常。 可變步長解算器(如dassl)可以及時返回 以查找曲線的方向。 另外,如果您有事件,可以同時生成更多值 。

如果你只想在精確的時刻打印時間或值需要時等式:

when sample(0, 1) then 
    Modelica.Utilities.Streams.print(String(time)); 
end when; 

在Modelica的規格瞭解更多關於樣本。

也可以使用像歐拉那樣的固定步長解算器。

+2

甚至固定步驟解算器可能會根據根發現策略及時倒退;) –

+1

感謝Adrian Pop!我認爲是這樣。其實我現在正在寫我的碩士論文,這就是爲什麼我想真正確定。你知道我在哪裏可以找到關於這方面的信息嗎?我可以在撰寫報告時作爲參考。 – FluxxSimon

+1

這裏有一些Modelica書籍: https://www.modelica.org/publications –