Opened 9 years ago

Closed 7 years ago

#3691 closed defect (fixed)

indexReduction doesn't reduce system with algebraic loop state constrains

Reported by: Willi Braun Owned by: Willi Braun
Priority: blocker Milestone: 1.12.0
Component: Backend Version: v1.9.4-dev-nightly
Keywords: indexReduction, AlgebraicLoops Cc: Volker Waurich, Vitalij Ruge

Description (last modified by Willi Braun)

The attached model is passed by the indexReduction with 2 states, but actually the model should have only 1 state. This result into a singular equation system while runtime.

It works fine if +preOptModule+=resolveLoops is activated.

Attachments (1)

A.mo (2.1 KB ) - added by Willi Braun 9 years ago.

Download all attachments as: .zip

Change History (16)

by Willi Braun, 9 years ago

Attachment: A.mo added

comment:1 by Willi Braun, 9 years ago

Description: modified (diff)

comment:2 by Volker Waurich, 9 years ago

Probably the same as in "Dymola User Manual Volume 2" p401. ResolveLoops solves the problem as stated in my papers. It's long time ago since I tested resolveLoops to be default. If I remember correctly, some initialization of stateSets failed in one model in msl32. But it might be time to check it again. Are you planning to set resolveLoops to default?

comment:3 by Willi Braun, 9 years ago

Wow, section "8.8 Symbolic Processing of Modelica Models" of "Dymola User Manual Volume 2" sounds really interesting, but I've never saw this before.

Okay perhaps we could really try it once again, but I'm currently occupied with other things.
Do we have a ticket therefore or should we use this one?

comment:4 by Volker Waurich, 9 years ago

Lets keep this ticket and check the effect on the library later.
Btw: You can set a kind of sensitivity of the heuristic behind resolveLoops with +reshuffle=1 (2 or 3)

comment:5 by Willi Braun, 9 years ago

BTW: This module fixes also the MSL example
Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.SMEE_Generator_MultiPhase
which fails currently.

comment:6 by Willi Braun, 9 years ago

Priority: criticalblocker

The following models:

Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.AIMC_DOL_MultiPhase.mos
Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.AIMS_Start_MultiPhase.mos
Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.SMEE_Generator_MultiPhase.mos
Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.SMPM_Inverter_MultiPhase.mos
Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.SMR_Inverter_MultiPhase.mos

have probably the same issue, since they have also one state too many.
That results into a singular system at initialization:

stdout | warning | The default linear solver fails, the fallback solver with total pivoting is started at time 0.000000. That might raise performance issues, for more information use -lv LOG_LS.
stdout | warning | The default linear solver fails, the fallback solver with total pivoting is started at time 0.000000. That might raise performance issues, for more information use -lv LOG_LS.

which is currently fixed by a total pivot linear solver.

This fact also yields into a really unstable behaviour in the sense that an actually non critical change like sorting the variables or equation in a different order results into unreasonable failings in different other modules or simulation( see +preOptModules+=sortEqnsVars)

Other modules that influences this models in a unpredictable way:

  • removeSimpleEquations
  • tearingMethods
  • resolveLoops

And perhaps other actually unrelated changes in the compiler might break this tests, therefore this tests should not prohibit any commits or we actually should deactivate them till this ticket is fixed.

comment:7 by Adrian Pop, 9 years ago

Owner: changed from somebody to Willi Braun
Status: newassigned

comment:8 by Willi Braun, 9 years ago

Milestone: Future1.10.0

comment:9 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:10 by Volker Waurich, 8 years ago

resolveLoops can reveal alias states and constant states but it still needs some enhancements. I am working on it.

comment:11 by Lennart Ochel, 8 years ago

What is this about? Is there a bug inside the index reduction? If yes, we should not try to hide it with some other optimization module, right?

comment:12 by Volker Waurich, 8 years ago

There is no bug in index reduction. Some models just have implicit state constraints among various equations. I dont think that there is an index reduction procedure which handles this. Might also be much more complicated to implement this inside the IR. Besides that, it could be possible in ODE systems, as well.

comment:13 by Volker Waurich, 8 years ago

resolveLoops is now activated by default.
Some tiny improvements in msl:
https://test.openmodelica.org/hudson/view/Library%20Testing/job/MSL_trunk_Simulation/1187/
However, some tests failed especially for cpp runtime:
https://test.openmodelica.org/hudson/view/Library%20Testing/job/MSL_trunk_cpp_Simulation/1050/
I will check that.

comment:14 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:15 by Adrian Pop, 7 years ago

Resolution: fixed
Status: assignedclosed

resolveLoops is now activated by default which should fix this ticket.
please open another ticket if there are still issues.

Note: See TracTickets for help on using tickets.