Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Unexpected behaviour of block.sources.trapezoid

Unexpected behaviour of block.sources.trapezoid

I'm using block.sources.trapezoid to generate triangle waves, and for certain parameters the behaviour is peculiar.
For example, with rising = falling = 0.4, width = 0, period = 0.8, stop time = 8, the first 6 cycles are triangle waves as desired, but then the remaining 4 cycles are sawtooth waves (rising = 0.4, falling = 0). Shorter rise/fall times and periods (always with stop time = 10 x period) all show the same problem.
With rising = falling = 0.45, period = 0.9, stop time = 9, all 10 cycles are nice triangle waves. Longer rise/fall times and periods all show the correct behaviour.
Keeping the rising/falling/period/stop = 0.4/0.4/0.8/8, if I try different numbers of output intervals, 500 and 1000 give the bad results, but 900, 1001, 1010, 1020, 1050 and anything higher that I've tried give the correct results. And if I specify 1024 output intervals, I get 2 triangles, 1 sawtooth, 4 triangles, 1 sawtooth and 2 triangles.
This is all with the dassl integration method. I tried dassl2 and euler a couple of times and they behaved the same as dassl.
This is with OMEdit 1.7.0 under Windows.

There are 0 guests and 0 other users also viewing this topic
You are here: