Opened 4 years ago
Last modified 3 years ago
#6363 assigned defect
MSL 4.0.0 including Clocked supported by OM 1.16.2?
Reported by: | Owned by: | Andreas Heuermann | |
---|---|---|---|
Priority: | blocker | Milestone: | 1.19.0 |
Component: | *unknown* | Version: | 1.16.2 |
Keywords: | Cc: |
Description
It seems to me: yes, but 2 aspects seem to be wrong:
- It seems to me that the initial trigger is ignored.
E.g. the sampled setpoint (Examples 3 and 4) starts with zero, then jumps.
- One example (3. BoilerClocked) is horribly wrong: the control error doesn't vanish.
I played around with clocked while preparing a course,
and implemented a simple boiler model step by step with different controllers:
- BoilerTriac using a continuous LimPID.
- BoilerSampled sampling I/O of the continuous LimPID.
- BoilerClocked using a clocked section with the continuous LimPID.
- BoilerDiscrete using a clocked section with a discrete PI.
Attachments (1)
Change History (14)
by , 4 years ago
Attachment: | ThermalExamples.mo added |
---|
comment:1 by , 4 years ago
comment:3 by , 4 years ago
Milestone: | 1.16.3 → 1.17.0 |
---|
comment:4 by , 4 years ago
Milestone: | 1.17.0 → 1.18.0 |
---|
Retargeted to 1.18.0 because of 1.17.0 timed release.
comment:5 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:6 by , 4 years ago
Priority: | critical → blocker |
---|
comment:7 by , 4 years ago
When looking at our nightly MSL 4.0.0 tests we see that there are multiple problems with Clocked.
Thanks for the examples you provided, but it's a difficult for me to figure out what exactly is going wrong. I'll start to work with the wrong examples from Modelica.Clocked and see if I'm able to find some root problems.
comment:9 by , 4 years ago
We can't handle changing intervals in clocks
model test1 Integer nextInterval ( start = 2); Real y2 ( start = 0); equation when Clock ( nextInterval , 100) then nextInterval = previous ( nextInterval ) + 1; y2 = previous ( y2 ) + 1; end when; end test1;
According to Modelica Language Specification, example in 16.3, should tick at 0, 0.03, 0.07, 0.12.
But our implementation ticks at 0, 0.02, 0.04, 0.06, 0.11, 0.17,...
At first I looked like I can fix #6212 with some minor modifications, but I'm afraid I need to redo the part computing the next time for clocks to fire completely and add a bunch of tests to our testsuite.
comment:11 by , 4 years ago
Next example not working:
model testBaseClockCond Clock c = Clock(x>2, 0.1); Real count(start=0); Real x(start=1); equation der(x) = 2*x; count = sample(time,c); end testBaseClockCond;
We only get one tick when x becomes greater then 2, but not at the time step + 0.1 and so on.
Windows 10 pro 64 bit + OM 1.16.2 64 bit