Opened 4 years ago

Last modified 3 years ago

#6053 new defect

Issue with ASCC and state selection in HanserModelica

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

Description

Please check HanserModelica.SynchronousMachines.SMEE_ShortCircuit2. The backend processing fails at some point because of singular linear equations / circular equalities. I suspect the ASCC algorithm may be involved, since the system contains an induction motor with the usual three-phase inductors current constraint.

More specifically, -d=bltdump reports a fixed state selection

1: smee.phiMechanical:STATE(1,smee.wMechanical)(start = -(3.141592653589793 + gamma0) / /*Real*/(smee.p) unit = "rad" fixed = true )  "Mechanical angle of rotor against stator"HanserModelica.SynchronousMachines.SMEE_ShortCircuit2, Modelica.Magnetic.FundamentalWave.BasicMachines.SynchronousInductionMachines.SM_ElectricalExcited type: Real 
2: smee.excitation.electroMagneticConverter.Phi.re:STATE(1)(unit = "Wb" )  "Real part of complex number"HanserModelica.SynchronousMachines.SMEE_ShortCircuit2, Modelica.Magnetic.FundamentalWave.BasicMachines.SynchronousInductionMachines.SM_ElectricalExcited, Modelica.Magnetic.FundamentalWave.BasicMachines.Components.SinglePhaseWinding, Modelica.Magnetic.FundamentalWave.Components.SinglePhaseElectroMagneticConverter, Modelica.SIunits.ComplexMagneticFlux type: Real 
3: smee.stator.core.Phi.im:STATE(1)(unit = "Wb" )  "Imaginary part of complex number"HanserModelica.SynchronousMachines.SMEE_ShortCircuit2, Modelica.Magnetic.FundamentalWave.BasicMachines.SynchronousInductionMachines.SM_ElectricalExcited, Modelica.Magnetic.FundamentalWave.BasicMachines.Components.SymmetricMultiPhaseWinding, Modelica.Magnetic.FundamentalWave.Components.EddyCurrent, Modelica.SIunits.ComplexMagneticFlux type: Real 
4: smee.stator.core.Phi.re:STATE(1)(unit = "Wb" )  "Real part of complex number"HanserModelica.SynchronousMachines.SMEE_ShortCircuit2, Modelica.Magnetic.FundamentalWave.BasicMachines.SynchronousInductionMachines.SM_ElectricalExcited, Modelica.Magnetic.FundamentalWave.BasicMachines.Components.SymmetricMultiPhaseWinding, Modelica.Magnetic.FundamentalWave.Components.EddyCurrent, Modelica.SIunits.ComplexMagneticFlux type: Real 
5: smee.stator.zeroInductor.i0:STATE(1)(unit = "A" ) HanserModelica.SynchronousMachines.SMEE_ShortCircuit2, Modelica.Magnetic.FundamentalWave.BasicMachines.SynchronousInductionMachines.SM_ElectricalExcited, Modelica.Magnetic.FundamentalWave.BasicMachines.Components.SymmetricMultiPhaseWinding, Modelica.Electrical.MultiPhase.Basic.ZeroInductor type: Real 

and immediatly afterwards reports a singularity

[3] 16:47:38 Symbolic Warning
The linear system: 
1 : smee.is[2] = -smee.is[1]
2 : 3.0 * smee.stator.zeroInductor.i0 = smee.is[1] + smee.is[2] + smee.is[3]
[
  1.0 , 1.0 ;
  -1.0 , -1.0
]
  *
[
  smee.is[2] ;
  smee.is[1]
]
  =
[
  0.0 ;
  smee.is[3] + (-3.0) * smee.stator.zeroInductor.i0
]
 might be structurally or numerically singular for variable smee.is[1] since U(2,2) = 0.0. It might be hard to solve. Compilation continues anyway.

I am pretty sure smee.stator.zeroInductor.i0 shouldn't be a state, maybe @christiankral can comment on that.

For your reference, Dymola selects a fixed state and four dynamically selected states

Statically selected continuous time states
constantSpeed.phi

Dynamically selected continuous time states
There is one set of dynamic state selection.
There are 4 states to be selected from:
smee.excitation.electroMagneticConverter.Phi.re
smee.is[1]
smee.rotorCage.electroMagneticConverter.singlePhaseElectroMagneticConverter[1].Phi.re
smee.rotorCage.electroMagneticConverter.singlePhaseElectroMagneticConverter[2].Phi.im
smee.stator.electroMagneticConverter.singlePhaseElectroMagneticConverter[1].Phi.re
smee.stator.electroMagneticConverter.singlePhaseElectroMagneticConverter[2].Phi.im

Attachments (2)

SMEE_ShortCircuit2Ground.png (45.7 KB ) - added by Christian Kral <dr.christian.kral@…> 4 years ago.
Duplicate of SMEE_ShortCircuit2 with ground connection
SMEE_ShortCircuit2Ground.mo (1.3 KB ) - added by Christian Kral <dr.christian.kral@…> 4 years ago.
Duplicate of SMEE_ShortCircuit2 with ground connection

Download all attachments as: .zip

Change History (9)

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

The model HanserModelica.SynchronousMachines.SMEE_ShortCircuit2 fails with the new frontend.

When I create a duplicate model HanserModelica.SynchronousMachines.SMEE_ShortCircuit2Ground and add a connection of the two phase short circuit to the "ground", the simulation works with the new front end.

In this case OpenModelica shows:

Selected continuous states: (6)
========================================
1: smee.strayLoad.phi:STATE(1)(start = -1.570796326794897 unit = "rad" fixed = true )  "Angle between shaft and support" type: Real
2: smee.excitation.electroMagneticConverter.Phi.re:STATE(1)(unit = "Wb" )  "Real part of complex number" type: Real
3: smee.stator.core.Phi.im:STATE(1)(unit = "Wb" )  "Imaginary part of complex number" type: Real
4: smee.stator.core.Phi.re:STATE(1)(unit = "Wb" )  "Real part of complex number" type: Real
5: smee.stator.zeroInductor.i0:STATE(1)(unit = "A" )  type: Real
6: smee.is[2]:STATE(1)(start = 0.0 unit = "A" stateSelect=StateSelect.never )  "Stator instantaneous currents" type: Real [3]

Dymola shows:

Statically selected continuous time states
constantSpeed.phi

Dynamically selected continuous time states
There is one set of dynamic state selection.
There are 5 states to be selected from:
smee.excitation.electroMagneticConverter.Phi.re
smee.is[2]
smee.rotorCage.electroMagneticConverter.singlePhaseElectroMagneticConverter[1].Phi.re
smee.rotorCage.electroMagneticConverter.singlePhaseElectroMagneticConverter[2].Phi.im
smee.stator.electroMagneticConverter.singlePhaseElectroMagneticConverter[1].Phi.re
smee.stator.electroMagneticConverter.singlePhaseElectroMagneticConverter[2].Phi.im
smee.stator.zeroInductor.i0

For the duplicated and modified model, in OpenModelica and Dymola the variable smee.stator.zeroInductor.i0 is (dynamically) selected as state.

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

Duplicate of SMEE_ShortCircuit2 with ground connection

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

Attachment: SMEE_ShortCircuit2Ground.mo added

Duplicate of SMEE_ShortCircuit2 with ground connection

comment:2 by massimo ceraolo, 4 years ago

Very often OM fails when three-phase systems are involved.

Maybe it is of help knowing that considering the two models from the PhotoVoltaics library: Examples.SimpleModuleMP and Examples.SimpleModuleMP3, the first one runs correctly, the second hangs.
The second one is very much the same as the first: the only difference is that in the second case a three-phase AC line is involved.

in reply to:  2 comment:3 by Francesco Casella, 4 years ago

Replying to ceraolo:

Very often OM fails when three-phase systems are involved.

The reason for that is that there are implicit constraints among the three phase currents (which are potential state variables due to phase inductances) that make the system index 2. They need to be made explicit in order to reduce the system to index 1 via Pantelides' algorithm. The ASCC algorithm is meant to reveal these hidden constraints, but it doesn't always manage to do that.

Maybe it is of help knowing that considering the two models from the PhotoVoltaics library: Examples.SimpleModuleMP and Examples.SimpleModuleMP3, the first one runs correctly, the second hangs.

Having more examples of failing cases helps a lot to improve the algorithm, thanks!

comment:4 by Francesco Casella, 4 years ago

It's interesting to see that the entire HanserModelica library works perfectly fine with the older OMC 1.13.2.

comment:5 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Rescheduled to 1.18.0

comment:6 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

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