Opened 4 years ago

Last modified 3 years ago

#6052 new defect

Issue with analyzeInitialSystem in HanserModelica

Reported by: Francesco Casella Owned by: Karim Adbdelhak
Priority: blocker Milestone: 1.19.0
Component: Initialization Version:
Keywords: Cc: dr.christiankral@…

Description

There are three models in the HanserModelica library that fail for unspecified reasons during analyzeInitialSystem, see:

@Karim, would you mind having a look at your earliest convenience? I think we should solve these for the next release, so we can claim 100% support over this nice library for teaching.

Attachments (1)

TestSingleLayer12over12.png (263.0 KB ) - added by Christian Kral <dr.christian.kral@…> 4 years ago.
Screen shot of error message

Download all attachments as: .zip

Change History (13)

comment:1 by Christian Kral <dr.christian.kral@…>, 4 years ago

The new frontend drops the following error message:

[/var/lib/jenkins2/ws/LINUX_BUILDS/tmp.build/openmodelica-1.16.0~dev-548-gd3091d6/OMCompiler/Compiler/NFFrontEnd/NFEvalFunction.mo: 732:9-735:52]: 
Internal error NFEvalFunction.assignArrayElement: unimplemented case for fill(0, if false then div(24, 2) else 24)[1] = 1

Unfortunately I do not understand what exactly this error message means. Might this be a Modelica implementation issue of HanserModelica?

comment:2 by Karim Adbdelhak, 4 years ago

Looks like the fill() operator is indexed ... does this appear in the model like that? I don't think that this would be modelica language compliant.

If that is the case just replace it with an auxiliary variable which is created with fill and index that variable instead.

comment:3 by Francesco Casella, 4 years ago

First of all, I didn't notice that these three models work fine with the old frontend. I guess this can give some clue so as to what is going wrong.

Then, it is a bit weird that I am not getting the same error message that @christiankral is getting. If I try out TestDoubleLayer7over9 with the new frontend using v1.16.0-dev-545-ga1be2e6252 under Windows, the backend fails with

[1] 18:40:26 Translation Error
No system for the symbolic initialization was generated

which is the same that happens with the Jenkins testing under Linux, currently with v1.16.0-dev.548+gd3091d6954. There is no error in the frontend, apparently, even though the way the new frontend handles this model eventually breaks the backend.

@christiankral are you installing OMC using APT or are you compiling it yourself? Maybe there is something wrong with that?

comment:4 by Francesco Casella, 4 years ago

I checked the flattened model with the old and new frontend. The main difference I see is that the OF can split the binding equation for N into its scalar counterparts

  parameter Real N[1].re = 108.2294825561955 "Real part of complex number";
  parameter Real N[1].im = 0.0 "Imaginary part of complex number";
  parameter Real N[2].re = -54.11474127809771 "Real part of complex number";
  parameter Real N[2].im = 93.72948133211004 "Imaginary part of complex number";
  parameter Real N[3].re = -54.11474127809775 "Real part of complex number";
  parameter Real N[3].im = -93.72948133211004 "Imaginary part of complex number";

while the NF keeps it together and apparently defers their evaluation to the backend (which fails for some reason)

  parameter Real N[1].re(fixed = false) "Real part of complex number";
  parameter Real N[1].im(fixed = false) "Imaginary part of complex number";
  parameter Real N[2].re(fixed = false) "Real part of complex number";
  parameter Real N[2].im(fixed = false) "Imaginary part of complex number";
  parameter Real N[3].re(fixed = false) "Real part of complex number";
  parameter Real N[3].im(fixed = false) "Imaginary part of complex number";
...
initial equation
  N = HanserModelica.Machines.Functions.complexTurns(winding);

I'm not sure why the backend cannot handle that. @Karim, maybe you want to give a look?

in reply to:  3 comment:5 by Christian Kral <dr.christian.kral@…>, 4 years ago

Replying to casella:

@christiankral are you installing OMC using APT or are you compiling it yourself? Maybe there is something wrong with that?

I am using APT to install and update OMC.

comment:6 by Francesco Casella, 4 years ago

Weird.

I am using the latest released version of HanserModelica, are you?

comment:7 by Christian Kral <dr.christian.kral@…>, 4 years ago

I am using the exact same version v1.1.0 (2019-03-24).

by Christian Kral <dr.christian.kral@…>, 4 years ago

Attachment: TestSingleLayer12over12.png added

Screen shot of error message

comment:8 by Christian Kral <dr.christian.kral@…>, 4 years ago

One more note to not miss any important detail: I suppose that the path /var/lib/jenkins2/... shown in the error message is something like a virtual path as /var/lib/jenkins2 does physically not exist on my machine.

comment:9 by Francesco Casella, 4 years ago

Ping...

comment:10 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 after 1.17.0-dev.beta2 release

comment:11 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

comment:12 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.