Opened 11 years ago

Last modified 10 years ago

#2432 closed defect

no support for mixed systems containing algorithms — at Version 12

Reported by: Lennart Ochel Owned by: Willi Braun
Priority: blocker Milestone: 1.9.1
Component: Backend Version: trunk
Keywords: Cc: Patrick Täuber, Martin Sjölund, Adrian Pop

Description (last modified by Lennart Ochel)

It seems that there is no support for mixed systems that contain algorithms.
Example:

model test
  Real a;
  Integer b;
algorithm
  b:=if a > 0 then 1 else -1;
algorithm
  a:=b * time;
end test;

Output:

Translation	13:38:22		0:0-0:0	Internal error ./Compiler/BackEnd/SimCodeUtil.mo: function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]
Translation	13:38:22		0:0-0:0	Internal error ./Compiler/BackEnd/SimCodeUtil.mo: function createEquationsForSystem1 failed
Translation	13:38:22		0:0-0:0	Internal error ./Compiler/BackEnd/SimCodeUtil.mo: function createEquationsForSystem1 failed for component {{1:1},
{2:2} Size: 1 No analytic jacobian} Size: 1
Translation	13:38:22		0:0-0:0	Internal error ./Compiler/BackEnd/SimCodeUtil.mo: function createOdeSystem failed for component {{1:1},
{2:2} Size: 1 No analytic jacobian} Size: 1
Translation	13:38:22		0:0-0:0	Internal error ./Compiler/BackEnd/SimCodeUtil.mo: function extractDiscEqs failed!

Change History (12)

comment:1 by Lennart Ochel, 11 years ago

Cc: Lennart Ochel added
Owner: changed from probably noone to Willi Braun
Status: newassigned

comment:2 by Lennart Ochel, 11 years ago

Cc: ptauber added

Probably OpenModelica is not able to solve any mixed system containing integer variables. It seems that only Boolean variables are supported – in some way. Mixed systems containing integer variables are only solved using tearing. So this is probably a tearing ticket?!

comment:3 by Martin Sjölund, 11 years ago

Or about adding support for solving mixed integer systems :)

comment:4 by Willi Braun, 11 years ago

Owner: changed from Willi Braun to Lennart Ochel

yes, Martin is right.
We haven't support for mixed integer system at all.

comment:5 by Lennart Ochel, 11 years ago

Cc: Patrick Täuber added; ptauber removed

comment:6 by Lennart Ochel, 11 years ago

Owner: changed from Lennart Ochel to Willi Braun

comment:7 by Lennart Ochel, 11 years ago

Minor modifications to the initial example to get more interesting trajectories:

model test
  Real a;
  Integer b;
algorithm 
  b:=if a > 0 then integer(time*10) else -integer(time*10);
algorithm 
  a:=b * time;
end test;

comment:8 by Lennart Ochel, 11 years ago

Description: modified (diff)

comment:9 by Lennart Ochel, 11 years ago

With the following modification this model works fine using OpenModelica:

model test
  Real a;
  Integer b;
  Boolean c;
algorithm
  c := a > 0;
algorithm 
  b := if c then integer(time*10) else -integer(time*10);
algorithm 
  a := b * time;
end test;

in reply to:  9 ; comment:10 by Willi Braun, 11 years ago

Replying to lochel:

With the following modification this model works fine using OpenModelica:

model test
  Real a;
  Integer b;
  Boolean c;
algorithm
  c := a > 0;
algorithm 
  b := if c then integer(time*10) else -integer(time*10);
algorithm 
  a := b * time;
end test;

That model doesn't work neither for me. Also same error message.

in reply to:  10 comment:11 by Lennart Ochel, 11 years ago

Cc: Martin Sjölund Adrian Pop added; Lennart Ochel removed

Replying to wbraun:

That model doesn't work neither for me. Also same error message.

You are using linux, right? That model works fine for me using omc 1.9.1+dev (r17769) on Windows.

comment:12 by Lennart Ochel, 11 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.