简体   繁体   中英

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...).

Now I have a periodicRealClock and I would like this clock to have the "Interval" parameter of the simulation.

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)...

Please refer to this answer 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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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