modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
453 stars 165 forks source link

Hysteresis37 #4241

Open HansOlsson opened 7 months ago

HansOlsson commented 7 months ago

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

Facts about the PR:

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

christiankral commented 7 months ago

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

HansOlsson commented 7 months ago
  • 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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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