简体   繁体   English

Modelica:使用区间作为参数:怎么办?

[英]Modelica : Use interval as a parameter : how to do?

So, i'm a beginner with modelica and I am using some clocked blocks for my model (i know that's not very good to have discrete behavior, but i am not enough good to avoid this...).所以,我是 modelica 的初学者,我正在为我的 model 使用一些时钟块(我知道离散行为不是很好,但我还不足以避免这种情况......)。

Now I have a periodicRealClock and I would like this clock to have the "Interval" parameter of the simulation.现在我有一个 periodicRealClock,我希望这个时钟具有模拟的“Interval”参数。

Do you know how to use this simulation paramater as a block paramater?你知道如何将这个模拟参数用作块参数吗?

Thks for your help.谢谢你的帮助。

I tried with "Interval" but it not works (parameter doesn't exist)...我尝试使用“Interval”但它不起作用(参数不存在)...

Please refer to this answer How to reference Dymola experiment start time and stop time as variables?请参考这个答案How to reference Dymola experiment start time and stop time as variables? which could be helpful to you.这可能对你有帮助。

I will prefer you to set a Real parameter say clockInterval at the Modelica code level and make use of the annotations to pass this parameter value to the interval setting of simulation as below:我希望您在 Modelica 代码级别设置一个 Real 参数,比如clockInterval ,并使用annotations将此参数值传递给模拟的interval设置,如下所示:

    annotation(experiment(StartTime=0, StopTime=5,Interval=clockInterval, Tolerance=1e-6))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM