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: jordeam@… Owned by: jordeam@…
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.
simulation using Modelica.Blocks.Discrete.ZeroOrderHold

Using the defined in module, does not break the simulation, but sample() stops working at 0.249.
Simulation using new ZOH.

The source code is attached.

Attachments (3)

s1.png (208.3 KB ) - added by jordeam@… 6 years ago.
simulation using Modelica.Blocks.Discrete.ZeroOrderHold
s2.png (184.0 KB ) - added by jodeam@… 6 years ago.
Simulation using new ZOH.
DCDrive.mo (25.6 KB ) - added by jordeam@… 6 years ago.
Source code

Download all attachments as: .zip

Change History (4)

by jordeam@…, 6 years ago

Attachment: s1.png added

simulation using Modelica.Blocks.Discrete.ZeroOrderHold

by jodeam@…, 6 years ago

Attachment: s2.png added

Simulation using new ZOH.

by jordeam@…, 6 years ago

Attachment: DCDrive.mo added

Source code

comment:1 by Francesco Casella, 6 years ago

Have you tried out with the latest nightly build?

Note: See TracTickets for help on using tickets.