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

Hysteresis37 #4241

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Hysteresis37 #4241

wants to merge 10 commits into from

Conversation

HansOlsson
Copy link
Contributor

This clears up the unit-issues in the Hysteresis models.

Facts about the PR:

  • Unit-consistent
  • Without unit-casts
  • Are the new unit strings correct? I don't know; it's possible - even likely, but I haven't seen the original model.

It requires more than Modelica Language 3.6, due to the odd units.

@HansOlsson HansOlsson added the L: Magnetic.FluxTubes Issue addresses Modelica.Magnetic.FluxTubes label Dec 13, 2023
@HansOlsson HansOlsson added the requires Modelica 3.7 Issue that requires Modelica Language Specification 3.7 label Dec 13, 2023
"Related to saturation value of magnetization";
parameter Real r(final unit="1")=0.55
parameter Real r(final unit="T-(1/2)")=0.55
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See: modelica/ModelicaSpecification#3439 for this new unit-string, added after Modelica Language 3.6.

@HansOlsson HansOlsson requested review from ThomasBoedrich and removed request for AHaumer December 13, 2023 08:06
@christiankral
Copy link
Contributor

christiankral commented Dec 13, 2023

I understand that the proposed change of units somehow leads to a consistent set of units:

  • I do not understand the physical meaning of the parameters P1...P4 with their unit $\sqrt{\mathrm T}$ and of the parameter r with its unit $\sqrt{\frac{1}{\mathrm T}}$. Parameters with such weird units are usually related with emperic "numeric value equations".
  • Yet, if unit consistency requires such weird units, it shall be fine with me.
  • The term (1-mat.r), however, does not make sense to me at all, as the 1 has to have the same unit as r to make this calculation unit consistent.

@HansOlsson
Copy link
Contributor Author

  • The term (1-mat.r), however, does not make sense to me at all, as the 1 has to have the same unit as r to make this calculation unit consistent.

True, that would imply mat.r.unit="1".

The derivation of the unit for P1...P4 was independent of that; so then the conclusion is then that P1.unit="T(1/2)", mat.r.unit="1", and mat.M.unit="T(1/2)" (since P1=mat.M*mat.r); and the eps-binding in GenericHystTellinenEverett is just broken.
Note that this complete fixes Modelica.Magnetic.FluxTubes.Shapes.HysteresisAndMagnets.GenericHystPreisachEverett; where eps is just a fixed constant.

Someone really need to look up the original models - to me the most likely way to solve that is that the eps-binding equation is wrong in some way; likely that it seemed logical to relate the eps to mat.M and it wasn't considered in detail.

Also note that (1-mat.r) will change sign if mat.r passes through 1, and Modelica.Magnetic.FluxTubes.Material.HysteresisEverettParameter.Vacodur50 has mat.r>1; I don't know the significance of that.

@christiankral
Copy link
Contributor

Someone really need to look up the original models - to me the most likely way to solve that is that the eps-binding equation is wrong in some way; likely that it seemed logical to relate the eps to mat.M and it wasn't considered in detail.

I would guess the quantity eps is solely used to numericall stabilize the model. Most likely, there is no physical reason to have it.

@HansOlsson
Copy link
Contributor Author

Someone really need to look up the original models - to me the most likely way to solve that is that the eps-binding equation is wrong in some way; likely that it seemed logical to relate the eps to mat.M and it wasn't considered in detail.

I would guess the quantity eps is solely used to numericall stabilize the model. Most likely, there is no physical reason to have it.

Seems that way; I tried some simple experiment, and it seemed the result was fairly unchanged even if eps was changed by an order of magnitude.

@HansOlsson
Copy link
Contributor Author

I have now updated to mat.r.unit="1" and changed eps to a unit-consistent value.

@christiankral
Copy link
Contributor

In order to somehow understand the physics behind the equations

  hystR = -Js + (P1*P2-P3*P4) + mu0*Hstat - eps/2;
  hystF =  Js + (P4*P2-P3*P1) + mu0*Hstat + eps/2;

we need know the literature source. From what ist listed in Modelica.Magnetic.FluxTubes.UsersGuide.Literature I cannot find any source which uses the variables P1, P2, P3, P4.

I guess the first step where to identify the literature reference, on which the implemented equations are based.

So far I could only identify the variable P1 in [Ma03]:

image

This does not indicate what unit P1 is as it is not clear what unit $v_1$ has:

image

@christiankral
Copy link
Contributor

I wonder if @ThomasBoedrich could give some input here.

@AHaumer
Copy link
Contributor

AHaumer commented Oct 12, 2024

This solution is weird: Units like T^(-1/2) bare physical meaning.
I think the only way to cure this part of Modelica.Magnetic is a major redesign:

  • Search for all relevant pubilcations and formulas. If necessary, ask @ThomasBoedrich .
  • Formulate the equations with dimensionless variables, i.e.
    r=(B/Bref)^(-1/2)
    This is the clean solution for such equations. However, this is a considerable amount of work.
    But we should stop curing single occurences of variables and parameters with weird units.
    @casella @christiankral What is your opinion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Magnetic.FluxTubes Issue addresses Modelica.Magnetic.FluxTubes requires Modelica 3.7 Issue that requires Modelica Language Specification 3.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants