Opened 5 years ago

Last modified 5 years ago

#5597 new defect

Two examples of the new Modelica.Electrical.Batteries package do not work with the new frontend

Reported by: Christian Kral <dr.christian.kral@…> Owned by: Per Östlund
Priority: blocker Milestone: 2.0.0
Component: New Instantiation Version: v1.14.0-dev-nightly
Keywords: Cc: a.haumer@…, modelica@…

Description

I tested the new Batteries package which is going to be included in the MSL by
modelica/ModelicaStandardLibrary#3054. When investigating the three examples of the Batteries library I was running into problems with two of the examples:

Modelica.Electrical.Batteries.Examples.BatteryDischargeCharge

Error message with new frontend:

[4] 12:38:18 Translation Error
[/var/lib/jenkins3/ws/LINUX_BUILDS/tmp.build/openmodelica-1.14.0~dev-26599-g88bb448/OMCompiler/Compiler/NFFrontEnd/NFCeval.mo: 1401:9-1402:94]: Internal error NFCeval.evalRelationLessEq failed to evaluate ‘Modelica.Electrical.Batteries.ParameterRecords.RCData.R <= 0.0‘

[5] 12:38:18 Translation Error
[/var/lib/jenkins3/ws/LINUX_BUILDS/tmp.build/openmodelica-1.14.0~dev-26599-g88bb448/OMCompiler/Compiler/NFFrontEnd/NFCeval.mo: 2459:20-2459:79]: Internal error NFCeval.evalBuiltinSum got invalid arguments (cellData2.rcData.R)

[6] 12:38:18 Translation Notification
[Modelica.Electrical.Batteries.Examples.BatteryDischargeCharge: 42:3-51:71]: From here:

[7] 12:38:18 Translation Error
[Modelica.Blocks.Tables: 11:5-13:80]: Constant cellData2 is used without having been given a value.

[8] 12:38:18 Translation Notification
[Modelica.Electrical.Batteries.ParameterRecords.CellData: 6:3-8:47]: From here:

[9] 12:38:18 Translation Error
[Modelica.Blocks.Tables: 11:5-13:80]: Constant battery2.cellData.useLinearSOCDependency is used without having been given a value.

So [5] may be the relevant hint, since the calculation of the sum seems to fail.

The example simulates OK with the old frontend

Modelica.Electrical.Batteries.Examples.CCCVcharging

Pretty much the same error message with the new frontend. The old frontend compiles and simulates fine.

Change History (6)

comment:1 by Francesco Casella, 5 years ago

Component: FrontendNew Instantiation
Milestone: 1.14.02.0.0
Owner: changed from somebody to Per Östlund
Priority: highblocker

@perost, is this yet another case of record issues with the old FE?

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

I re-tested the three examples of Modelica.Electrical.Batteries.Examples taken from https://github.com/modelica/ModelicaStandardLibrary/pull/3243/commits/e9ab51312f55cec9c29dc1c594754b5325f2976b with OpenModelica and found the following:

  1. Modelica.Electrical.Batteries.Examples.BatteryDischargeCharge does not simulate with the old frontend any more; the new frontend does not work either; even the "Check model" doesn't work
  1. Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge checks and translates but fails at the begin of the simulation with the following message:
Limited backtrace at point of segmentation fault
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fd630dda890]
/tmp/OpenModelica_christian/OMEdit/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge(Modelica_Electrical_Batteries_Examples_SuperCapDischargeCharge_performSimulation+0x1f4)[0x405554]

/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(solver_main+0x334)[0x7fd632371774]
/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(+0x856c0)[0x7fd6323956c0]

/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(startNonInteractiveSimulation+0xa30)[0x7fd632394b76]

/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(_main_SimulationRuntime+0x72)[0x7fd632396d4a]
/tmp/OpenModelica_christian/OMEdit/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge(main+0x197)[0x4082fd]

/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fd6309f8b97]
/tmp/OpenModelica_christian/OMEdit/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge(_start+0x2a)[0x40529a]

The initialization finished successfully without homotopy method.
Process crashed
Process crashed
Simulation process failed. Exited with code 11.
  1. Modelica.Electrical.Batteries.Examples.CCCVcharging does neither check nor translate (with the new or old frontend)

Tested with

Connected to OpenModelica 1.16.0~dev-69-g54cc546
Connected to OMSimulator unknown-linux

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

Due to #5744 my previous report was not correct. The following updates apply (for the new frontend):

Replying to Christian Kral <dr.christian.kral@…>:

I re-tested the three examples of Modelica.Electrical.Batteries.Examples taken from https://github.com/modelica/ModelicaStandardLibrary/pull/3243/commits/e9ab51312f55cec9c29dc1c594754b5325f2976b with OpenModelica and found the following:

  1. Modelica.Electrical.Batteries.Examples.BatteryDischargeCharge does not simulate with the old frontend any more; the new frontend does not work either; even the "Check model" doesn't work
[4] 09:05:01 Translation Error
[Modelica.Electrical.Batteries.ParameterRecords.CellData: 20:3-21:82]: Failed to deduce dimension 1 of OCV_SOC due to missing binding equation.

The displayed link refers to the parameter OCV_SOC in:

record CellData "Parameters of a battery cell"
...
  parameter Real OCV_SOC[:,2]=[SOCmin,OCVmin/OCVmax; SOCmax,1] "OCV/OCVmax versus SOC table"
    annotation(Dialog(group="OCV versus SOC", enable=not useLinearSOCDependency));
...

end CellData;
  1. Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge checks and translates but fails at the begin of the simulation with the following message:
Limited backtrace at point of segmentation fault
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fd630dda890]
/tmp/OpenModelica_christian/OMEdit/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge(Modelica_Electrical_Batteries_Examples_SuperCapDischargeCharge_performSimulation+0x1f4)[0x405554]

/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(solver_main+0x334)[0x7fd632371774]
/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(+0x856c0)[0x7fd6323956c0]

/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(startNonInteractiveSimulation+0xa30)[0x7fd632394b76]

/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(_main_SimulationRuntime+0x72)[0x7fd632396d4a]
/tmp/OpenModelica_christian/OMEdit/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge(main+0x197)[0x4082fd]

/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fd6309f8b97]
/tmp/OpenModelica_christian/OMEdit/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge/Modelica.Electrical.Batteries.Examples.SuperCapDischargeCharge(_start+0x2a)[0x40529a]

The initialization finished successfully without homotopy method.
Process crashed
Process crashed
Simulation process failed. Exited with code 11.

The simulation works OK and no error is triggered.

  1. Modelica.Electrical.Batteries.Examples.CCCVcharging does neither check nor translate (with the new or old frontend)

Causes the same error message as in example 1.

Tested with

Connected to OpenModelica 1.16.0~dev-69-g54cc546
Connected to OMSimulator unknown-linux

Examples 1 and 3 do not work with the old frontend either.

Tested with

Connected to OpenModelica 1.16.0~dev-72-gc3a557c
Connected to OMSimulator unknown-linux

comment:5 by Francesco Casella, 5 years ago

More examples in MSL PR #3289

comment:6 by Per Östlund, 5 years ago

All of the Batteries models now pass the frontend, but CCCV_Stack and CCCV_StackRC seem to have some issues with expandable connectors that probably originate in the frontend.

Note: See TracTickets for help on using tickets.