ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Numerical issue in IMC_YD

Open maltelenz opened this issue 8 months ago • 4 comments

There was some discussion here about Modelica.Electrical.Machines.Examples.InductionMachines.IMC_YD being numerically extremely challenging when touching the tolerance.

We now see this for System Modeler even with the tolerance that is set in the model, where it just "gets stuck" (or moves forward very very slowly) with hundreds of thousands of function evaluations. Playing around with step size, tolerance or changing to CVODES all can make it work again, or make it get stuck even worse.

Given that two different tools have now shown these problems, I will blame this on the model.

maltelenz avatar May 28 '25 07:05 maltelenz

see also #4486: set FundamentalWave..SymmetricPolyphaseWinding.ZeroInductor.i0(nominal=10)

As far as I see both Modelica.Electrical.Machines.Examples.InductionMachines.IMC_YD and Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.InductionMachines.IMC_YD and Modelica.Magnetic.QuasiStatic.FundamentalWave.Examples.BasicMachines.InductionMachines.IMC_YD (since the last compares a transient and a quasistatic machine model) have the same issue. I tried to exchange the switchYD against a normal Modelica.Electrical.Machines.Utilities.TerminalBox in star-connection (Y) and as far as I see even with tighter tolerance both models run without complaints. @maltelenz you could check yourself - see enclosed package (EM_IMC_Y_ and FW_IMC_Y_). So my suspicion is that the switchYD causes problems - I think because the D-switch is not really off but with a high resistance in parallel to the Y-switch which is no really on but with a high conductance. I'll have to play around trying to solve this issue. @christiankral do you have an idea?

IMC_YD_4654.zip

AHaumer avatar May 28 '25 09:05 AHaumer

I searched for solutions and I believe it is related to the zero system (i_0_s resp. stator.zeroInductor.i0). I have to do further tests but it looks like a small resistance in series to the zero inductance could solve the problem. Any other ideas? Does anyone have experience with zero system in machines resp. in grids? @dietmarw ?

AHaumer avatar May 28 '25 11:05 AHaumer

Some results: Examples that start the same machine direct-on-line in Y or D-connection run without problems. Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.InductionMachines.IMC_YD runs without problems even with tighter tolerance. IMHO the treatment of the zero system is pretty much the same in Electrical.Machines and FundamentalWave:

i0 = sum(i)/m
v0 = Lzero*der(i0)

v0 is impressed in all m phases. The zero system is in most cases only numerical noise but necessary to complete the equation system. Only Modelica.Electrical.Machines.Examples.InductionMachines.IMC_YD with tighter tolerance is problematic. Interesting: Modelica.Electrical.Machines.Examples.InductionMachines.IMC_YDarc uses switches with simple implementation of switching arc and a short delay between Y->off and D->on runs without problems even with tighter tolerance.

@maltelenz is it possible to analyze with WSM which state dominates the error, using Modelica.Electrical.Machines.Examples.InductionMachines.IMC_YD with tighter tolerance? We could try to use a similar solution as in #4486 :

  Machines.BasicMachines.InductionMachines.IM_SquirrelCage aimc( ...
    i_s_0(nominal=10)) ...;

but I'm afraid that's not enough to solve the problems. I'll try to further analyze the switchYD with an eye on the zero system.

AHaumer avatar May 29 '25 09:05 AHaumer

Thanks to my friend @johhell - he supported me with testing and found the following: Removing the zero inductor lszero cures the problem! I'll do:

  • some more tests
  • implement a Boolean parameter which switches the zero inductor on / off
  • develop an idea how to transfer the idea to FundamentalWave
  • and prepare a PR.

Using the Boolean parameter we can leave all other examples (and user models) untouchend and cure this one problematic example. @christiankral what's your opinion?

AHaumer avatar May 29 '25 11:05 AHaumer