diff --git a/Modelica/Electrical/Analog/Basic.mo b/Modelica/Electrical/Analog/Basic.mo index 4af6da6341e..c181b1fe809 100644 --- a/Modelica/Electrical/Analog/Basic.mo +++ b/Modelica/Electrical/Analog/Basic.mo @@ -299,6 +299,9 @@ package Basic "Basic electrical components" model SaturatingInductor "Simple model of an inductor with saturation" extends Modelica.Electrical.Analog.Interfaces.OnePort(i(start=0)); + import Modelica.Constants.pi; + import Modelica.Constants.eps; + import Modelica.Constants.small; parameter SI.Current Inom(start=1) "Nominal current"; parameter SI.Inductance Lnom(start=1) "Nominal inductance at Nominal current"; @@ -311,15 +314,14 @@ package Basic "Basic electrical components" protected parameter SI.Current Ipar(start=Inom/10, fixed=false); initial equation - (Lnom - Linf) = (Lzer - Linf)*Ipar/Inom*(Modelica.Constants.pi/2 - - Modelica.Math.atan(Ipar/Inom)); + (Lnom - Linf)/(Lzer - Linf)=Ipar/Inom*(pi/2 - atan(Ipar/Inom)); equation assert(Lzer > Lnom + Modelica.Constants.eps, "Lzer (= " + String(Lzer) + ") has to be > Lnom (= " + String(Lnom) + ")"); assert(Linf < Lnom - Modelica.Constants.eps, "Linf (= " + String(Linf) + ") has to be < Lnom (= " + String(Lnom) + ")"); - (Lact - Linf)*i/Ipar = (Lzer - Linf)*noEvent(Modelica.Math.atan(i/Ipar)); - Psi = Lact*i; + Lact = Linf + (Lzer - Linf)*(if noEvent(abs(i)/Ipar