Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ record BaseData "Base Data Record"
extends Modelica.Icons.Record;
parameter SI.MagneticFieldStrength Hsat=100
"Hysteresis region between -Hsat .. Hsat";
parameter Real M(final unit="1")=0.95
parameter Real M(final unit="T(1/2)")=0.95
"Related to saturation value of magnetization";
parameter Real r(final unit="1")=0.55
"Proportion of the straight region in the vicinity of Hc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,10 @@ equation
H3= -alpha-mat.Hc;
H4= beta-mat.Hc;

E = unitT*
((mat.M*mat.r*(2/pi*atan(mat.q*H1)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H1)+exp(-mat.p2*H1))))*
(mat.M*mat.r*(2/pi*atan(mat.q*H2)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H2)+exp(-mat.p2*H2))))-
(mat.M*mat.r*(2/pi*atan(mat.q*H3)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H3)+exp(-mat.p2*H3))))*
(mat.M*mat.r*(2/pi*atan(mat.q*H4)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H4)+exp(-mat.p2*H4)))));
E = ((mat.M*mat.r*(2/pi*atan(mat.q*H1)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H1)+exp(-mat.p2*H1))))*
(mat.M*mat.r*(2/pi*atan(mat.q*H2)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H2)+exp(-mat.p2*H2))))-
(mat.M*mat.r*(2/pi*atan(mat.q*H3)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H3)+exp(-mat.p2*H3))))*
(mat.M*mat.r*(2/pi*atan(mat.q*H4)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H4)+exp(-mat.p2*H4)))));

der(J) = (if init then 0.5 else 1) * der(E);
B = J + mu0 * Hstat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ protected
mat.Hsat,-mat.Hsat, mat, false)
"Saturation polarization";
//final parameter Real mu0 = mat.K * mu_0;
parameter SI.MagneticFluxDensity eps=mat.M/1000;
parameter Real P1 = (mat.M*mat.r*(2/pi*atan(mat.q*(mat.Hsat-mat.Hc))+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*(mat.Hsat-mat.Hc))+exp(-mat.p2*(mat.Hsat-mat.Hc)))));
parameter Real P4 = (mat.M*mat.r*(2/pi*atan(mat.q*(-mat.Hsat-mat.Hc))+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*(-mat.Hsat-mat.Hc))+exp(-mat.p2*(-mat.Hsat-mat.Hc)))));
parameter SI.MagneticFluxDensity eps=Js/1000;
parameter Real P1(final unit="T(1/2)") = (mat.M*mat.r*(2/pi*atan(mat.q*(mat.Hsat-mat.Hc))+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*(mat.Hsat-mat.Hc))+exp(-mat.p2*(mat.Hsat-mat.Hc)))));
parameter Real P4(final unit="T(1/2)") = (mat.M*mat.r*(2/pi*atan(mat.q*(-mat.Hsat-mat.Hc))+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*(-mat.Hsat-mat.Hc))+exp(-mat.p2*(-mat.Hsat-mat.Hc)))));

SI.MagneticFieldStrength H2;
SI.MagneticFieldStrength H3;
Real P2;
Real P3;
Real P2(final unit="T(1/2)");
Real P3(final unit="T(1/2)");
Real H_lim;
constant SI.MagneticFluxDensity unitT = 1;

Expand All @@ -32,8 +32,8 @@ equation
P2 = (mat.M*mat.r*(2/pi*atan(mat.q*H2)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H2)+exp(-mat.p2*H2))));
P3 = (mat.M*mat.r*(2/pi*atan(mat.q*H3)+1)+(2*mat.M*(1-mat.r))/(1+1/2*(exp(-mat.p1*H3)+exp(-mat.p2*H3))));

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

annotation (defaultComponentName="core", Icon(graphics={Text(
extent={{40,0},{40,-30}},
Expand Down
9 changes: 4 additions & 5 deletions Modelica/Magnetic/FluxTubes/Utilities/everett.mo
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ algorithm
h3:=-a-p.Hc;
h4:=b-p.Hc;

J:= unitT*(
(p.M*p.r*(2/pi*atan(p.q*h1)+1)+(2*p.M*(1-p.r))/(1+1/2*(exp(-p.p1*h1)+exp(-p.p2*h1))))*
(p.M*p.r*(2/pi*atan(p.q*h2)+1)+(2*p.M*(1-p.r))/(1+1/2*(exp(-p.p1*h2)+exp(-p.p2*h2))))-
(p.M*p.r*(2/pi*atan(p.q*h3)+1)+(2*p.M*(1-p.r))/(1+1/2*(exp(-p.p1*h3)+exp(-p.p2*h3))))*
(p.M*p.r*(2/pi*atan(p.q*h4)+1)+(2*p.M*(1-p.r))/(1+1/2*(exp(-p.p1*h4)+exp(-p.p2*h4)))));
J:= ((p.M*p.r*(2/pi*atan(p.q*h1)+1)+(2*p.M*(1-p.r))/(1+1/2*(exp(-p.p1*h1)+exp(-p.p2*h1))))*
(p.M*p.r*(2/pi*atan(p.q*h2)+1)+(2*p.M*(1-p.r))/(1+1/2*(exp(-p.p1*h2)+exp(-p.p2*h2))))-
(p.M*p.r*(2/pi*atan(p.q*h3)+1)+(2*p.M*(1-p.r))/(1+1/2*(exp(-p.p1*h3)+exp(-p.p2*h3))))*
(p.M*p.r*(2/pi*atan(p.q*h4)+1)+(2*p.M*(1-p.r))/(1+1/2*(exp(-p.p1*h4)+exp(-p.p2*h4)))));
else
J:=0;
end if;
Expand Down