Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#3092 closed defect (fixed)

BackendDAECreate.mergeWhenCluases fails for more than one elsewhen

Reported by: wbraun Owned by: lochel
Priority: normal Milestone: 1.9.4
Component: Backend Version: trunk
Keywords: Cc:

Description

See following example:

package TestModel
  package QueueOperations
    function AddIn
      input Real qin[:, :];
      input Integer qinlength;
      input Real qinfo[size(qin, 1)];
      output Real qout[size(qin, 1), size(qin, 2)];
      output Integer qoutlength;
    algorithm
      qout := qin;
      qoutlength := qinlength + 1;
      for i in 1:qinlength loop
        qout[:, i + 1] := qin[:, i];
      end for;
      qout[:, 1] := qinfo;
    end AddIn;

    function DeleteOut
      input Real qin[:, :];
      input Integer qinlength;
      output Real qout[size(qin, 1), size(qin, 2)];
      output Integer qoutlength;
    algorithm
      qout := qin;
      qoutlength := qinlength - 1;
    end DeleteOut;

    function ReadOut
      input Real qin[:, :];
      input Integer qlength;
      output Real qinfo[size(qin, 1)];
    algorithm
      qinfo := qin[:, qlength];
    end ReadOut;
  end QueueOperations;

  model TestQueueModel
    import TQ = TestModel.QueueOperations;
    Real numberqueue[3, 10](start = zeros(3, 10));
    Integer queuelength(start = 3);
    Real P;
    Real SPC;
    Real DD;
    //Integer counter(start = 0);
  equation
    when time > 1 then
      (numberqueue, queuelength) = TQ.AddIn(pre(numberqueue), pre(queuelength), {2.125, 3, 4});
    elsewhen time > 1.5 then
      (numberqueue, queuelength) = TQ.DeleteOut(pre(numberqueue), pre(queuelength));
    elsewhen time > 2 then
      (numberqueue, queuelength) = TQ.AddIn(pre(numberqueue), pre(queuelength), {2.125, 3, 4});
/*    elsewhen time > 2.5 then
      (numberqueue, queuelength) = TQ.DeleteOut(pre(numberqueue), pre(queuelength));
    elsewhen time > 3 then
      (numberqueue, queuelength) = TQ.AddIn(pre(numberqueue), pre(queuelength), {2.125, 3, 4});
    elsewhen time > 3.5 then
      (numberqueue, queuelength) = TQ.DeleteOut(pre(numberqueue), pre(queuelength));
    elsewhen time > 4 then
      (numberqueue, queuelength) = TQ.AddIn(pre(numberqueue), pre(queuelength), {2.125, 3, 4});
*/
    end when;
    {P, SPC, DD} = TQ.ReadOut(numberqueue, queuelength);
  end TestQueueModel;
end TestModel;

Change History (10)

comment:1 Changed 10 years ago by wbraun

  • Owner changed from somebody to wbraun
  • Status changed from new to accepted

comment:2 Changed 10 years ago by wbraun

fixed in r24134.

comment:3 Changed 10 years ago by wbraun

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:4 Changed 10 years ago by lochel

  • Resolution fixed deleted
  • Status changed from closed to reopened

Initialization fails for this model.

Notification: The given system is mixed-determined.   [index > 0]
Notification: The given system is mixed-determined.   [index > 1]
Notification: The given system is mixed-determined.   [index > 2]
Notification: The given system is mixed-determined.   [index > 3]
Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

Analysis from above is wrong, since the model is just under-determined.

comment:5 Changed 10 years ago by lochel

  • Owner changed from wbraun to lochel
  • Status changed from reopened to accepted

comment:6 follow-up: Changed 10 years ago by wbraun

Why do you this ticket therefore?
There are some more models where such an issue occurs, so I don't think it really related to the handling of when clauses in BackendDAECreate.

ModelicaTest.Blocks.Logical 

Modelica.Mechanics.MultiBody.Examples.Loops.PlanarLoops_analytic.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

Modelica.Fluid.Examples.PumpingSystem.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

Modelica.Fluid.Examples.AST_BatchPlant.BatchPlant_StandardWater.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

ThermoSysPro.Examples.SimpleExamples.TestWaterHammer.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

ThermoSysPro.Examples.SimpleExamples.TestStaticCondenser.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

ThermoSysPro.Examples.SimpleExamples.TestStodolaTurbine1.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

and even some more perhaps minor testcases in the testsuite.

Last edited 10 years ago by wbraun (previous) (diff)

comment:7 Changed 10 years ago by lochel

  • Resolution set to fixed
  • Status changed from accepted to closed

The example from the description is now (r24291) handled correctly.

comment:8 in reply to: ↑ 6 Changed 10 years ago by lochel

Replying to wbraun:

Why do you this ticket therefore?
There are some more models where such an issue occurs, so I don't think it really related to the handling of when clauses in BackendDAECreate.

ModelicaTest.Blocks.Logical 

Modelica.Mechanics.MultiBody.Examples.Loops.PlanarLoops_analytic.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

Modelica.Fluid.Examples.PumpingSystem.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

Modelica.Fluid.Examples.AST_BatchPlant.BatchPlant_StandardWater.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

ThermoSysPro.Examples.SimpleExamples.TestWaterHammer.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

ThermoSysPro.Examples.SimpleExamples.TestStaticCondenser.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

ThermoSysPro.Examples.SimpleExamples.TestStodolaTurbine1.mos:// Warning: No system for the symbolic initialization was generated. A method using numerical algorithms will be used instead.

and even some more perhaps minor testcases in the testsuite.

The same error message is displayed in different situations. The examples you mentioned have nothing to do with the model from this ticket. I opened a new ticket (#3113) for some of the models that are still failing.

comment:9 Changed 9 years ago by dietmarw

  • Milestone changed from Future to pre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:10 Changed 7 years ago by sjoelund.se

  • Milestone changed from pre1.9.4 to 1.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.