Opened 6 years ago
Last modified 6 years ago
#5150 new defect
The utility sample() freezes the output after a amount of simulation time.
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | OMSimulator | Version: | v1.12.0 |
Keywords: | Cc: |
Description
I am using OpenModelica for control in electrical drives classes. I used a tiny sample period of 100e-6s. After a time of simulation, sample() stops working and the simulation gives wrong answers. I tested all available numerical algorithms without success. I also used fixed step simulation with less than 1us of step and also failed. I use a ZOH in the feedback, one fo each loop, because OpenModelica is not able to solve numerically the system without those, but after a certain time, provided ZOH in the library as well as a locally defined ZOH fails because of sample(), that freezes its output.
Using provided ZeroOrderHold breaks the simulation before desired ending time.
Using the defined in module, does not break the simulation, but sample() stops working at 0.249.
The source code is attached.
simulation using Modelica.Blocks.Discrete.ZeroOrderHold