Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initial conditions of Magnetic.FluxTubes hysteresis examples #3410

Conversation

modelonrobinandersson
Copy link

@modelonrobinandersson modelonrobinandersson commented Feb 13, 2020

This is related to issue #3409

In order to setup the initial equation system to Modelica.Magnetic.FluxTubes.Examples.Hysteresis.SinglePhaseTransformerWithHysteresis1 additional equations are needed in order to obtain a balanced system.

That the equations below are added is natural as a consequence of the start values and fixed=true for these states:

winding1.i = 0;
winding2.i = 0;
core.MagRel = 0.5;

However, the fourth equation that is needed is not clearly defined, and different compiler heuristics will lead to different initial equations.
We suggest to explicitly add

initial equation
    core.derHstat = 0.0;

…TransformerWithHysteresis1

In order to setup the initial equation system to Modelica.Magnetic.FluxTubes.Examples.Hysteresis.SinglePhaseTransformerWithHysteresis1 additional equations are needed in order to obtain a balanced system.

That the equations below are added is natural as a consequence of the start values and fixed=true for these states:
```
winding1.i = 0;
winding2.i = 0;
core.MagRel = 0.5;
```
However, the fourth equation that is needed is not clearly defined, and different compiler heuristics will lead to different initial equations.
We suggest to explicitly add 
```
initial equation
    core.derHstat = 0.0;
```
@claassistantio
Copy link

claassistantio commented Feb 13, 2020

CLA assistant check
All committers have signed the CLA.

@beutlich beutlich changed the title Update to Modelica.Magnetic.FluxTubes.Examples.Hysteresis.SinglePhase… Update to Modelica.Magnetic.FluxTubes.Examples.Hysteresis.SinglePhaseTransformerWithHysteresis1 Feb 13, 2020
@beutlich beutlich added example Issue only addresses example(s) L: Magnetic.FluxTubes Issue addresses Modelica.Magnetic.FluxTubes labels Feb 13, 2020
@beutlich beutlich added this to the MSL3.2.3+maint milestone Feb 13, 2020
@dietmarw
Copy link
Member

dietmarw commented Feb 14, 2020

Is this also relevant for master (i.e., 4.0.0) or only for 3.2.3 as maintenance bugfix?

@christiankral christiankral changed the title Update to Modelica.Magnetic.FluxTubes.Examples.Hysteresis.SinglePhaseTransformerWithHysteresis1 Fix initial conditions of Magnetic.FluxTubes hysteresis examples Feb 15, 2020
@christiankral
Copy link
Contributor

Examples.Hysteresis.SinglePhaseTransformerWithHysteresis1 is not the only model with only partly specified initial conditions. So I will update this PR to also cover the other hysteresis models.

@christiankral
Copy link
Contributor

Is this also relevant for master (i.e., 4.0.0) or only for 3.2.3 as maintenance bugfix?

Yes this is also relevant to master.

@christiankral
Copy link
Contributor

@dietmarw @beutlich I actually wonder why this issue was not yet discovered when releasing MSL 3.2.3 -- or was it possibly overlooked (by myself).

@christiankral christiankral requested review from AHaumer and removed request for ThomasBoedrich February 15, 2020 09:58
Copy link
Contributor

@christiankral christiankral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now all the hysteresis examples shall work with exact initial conditions

@christiankral
Copy link
Contributor

In the three phase transformer model protected was remove to access all the magnetic components from outside the model. Particularly, as protected is not needed and as the three phase transformer model is clearly intended to be used in the example only, this change is justified on my opinion.

@dietmarw dietmarw added the bug Critical/severe issue label Feb 17, 2020
@dietmarw dietmarw assigned beutlich and dietmarw and unassigned christiankral and beutlich Feb 17, 2020
@dietmarw dietmarw merged commit dec96df into modelica:maint/3.2.3 Feb 18, 2020
@beutlich beutlich removed the request for review from AHaumer February 22, 2020 20:24
@beutlich
Copy link
Member

@dietmarw @beutlich I actually wonder why this issue was not yet discovered when releasing MSL 3.2.3 -- or was it possibly overlooked (by myself).

It was reported here, but it is not detected since translateModel returns true even in pedantic mode of Dymola.

Advanced.PedanticModelica:=true;
translateModel("Modelica.Magnetic.FluxTubes.Examples.Hysteresis.SinglePhaseTransformerWithHysteresis1");
 = true

@beutlich
Copy link
Member

beutlich commented Feb 23, 2020

I will update the MSL release checks to improve the error detection.

@beutlich
Copy link
Member

I will update the MSL release checks to improve the error detection.

bernhard-thiele added a commit to bernhard-thiele/ModelicaStandardLibrary that referenced this pull request Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue example Issue only addresses example(s) L: Magnetic.FluxTubes Issue addresses Modelica.Magnetic.FluxTubes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants