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: ahaumer@… 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:

  1. It seems to me that the initial trigger is ignored.

E.g. the sampled setpoint (Examples 3 and 4) starts with zero, then jumps.

  1. 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:

  1. BoilerTriac using a continuous LimPID.
  2. BoilerSampled sampling I/O of the continuous LimPID.
  3. BoilerClocked using a clocked section with the continuous LimPID.
  4. BoilerDiscrete using a clocked section with a discrete PI.

Attachments (1)

ThermalExamples.mo (21.5 KB ) - added by Anton Haumer <ahaumer@…> 4 years ago.

Download all attachments as: .zip

Change History (14)

by Anton Haumer <ahaumer@…>, 4 years ago

Attachment: ThermalExamples.mo added

comment:1 by Anton Haumer <ahaumer@…>, 4 years ago

Windows 10 pro 64 bit + OM 1.16.2 64 bit

comment:2 by Francesco Casella, 4 years ago

Thanks @ahaumer, we'll look into that and report.

comment:3 by Francesco Casella, 4 years ago

Milestone: 1.16.31.17.0

comment:4 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:5 by Francesco Casella, 4 years ago

Owner: changed from somebody to Andreas Heuermann
Status: newassigned

comment:6 by Francesco Casella, 4 years ago

Priority: criticalblocker

comment:7 by Andreas Heuermann, 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:8 by Andreas Heuermann, 4 years ago

Related ticket #6212

Last edited 4 years ago by Francesco Casella (previous) (diff)

comment:9 by Andreas Heuermann, 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.

Last edited 4 years ago by Andreas Heuermann (previous) (diff)

comment:10 by Francesco Casella, 4 years ago

Good that we understand this now.

comment:11 by Andreas Heuermann, 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.

comment:12 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

comment:13 by Francesco Casella, 3 years ago

Milestone: 1.19.0

1.18.0 blocker tickets moved to 1.19.0

Note: See TracTickets for help on using tickets.