I created a Dymola model of a nonlinear magnetic resistor which has some parameters and I wrote a script to change the values of the parameters after the translation. But I can't change the values of two of them (H0, H1). The Dymola warning says: "Warning: Setting nonlinearMagneticResistor5_1.H0 has no effect in model.
After translation you can only set literal start-values and non-evaluated parameters." I don't understand this warning. Can anyone of you help me?
This is the Modelica code of the resistor that I tested in a very simple magnetic circle using the MagneticLibrary package:
QUOTE
model NonlinearMagneticResistor5
"Magnetic reluctance of flux tube with nonlinear characteristic"
extends Magnetic.Interfaces.MagneticFluxTube;
\\The following parameters define the B-H-curve of the magnetic material
parameter Modelica.SIunits.Permeability muI = 2.3626e-5;
parameter Modelica.SIunits.MagneticFieldStrength H0 = 28.475;
parameter Modelica.SIunits.MagneticFieldStrength H1 = 3264.3;
parameter Modelica.SIunits.MagneticFluxDensity Ba = 0.83263;
parameter Modelica.SIunits.MagneticFluxDensity Bm = 0.91058;
parameter Modelica.SIunits.MagneticFieldStrength Ha = 3602.2;
parameter Modelica.SIunits.MagneticFieldStrength Hm = 3630.6;
parameter Modelica.SIunits.MagneticFluxDensity B0 = Ba*sqrt(1-((H0-Hm)/Ha)^2)+Bm;
parameter Modelica.SIunits.MagneticFluxDensity B1 = Ba*sqrt(1-((H1-Hm)/Ha)^2)+Bm;
parameter Modelica.SIunits.Length l_Fe = 1;
parameter Modelica.SIunits.Area A = 1;
Modelica.SIunits.MagneticFieldStrength H;
Modelica.SIunits.MagneticFluxDensity B;
equation
B = Phi/A;
if abs(H)<H0 then
B = sign(H)*abs(H)*B0/H0; //The first part of the curve is a straight line
elseif abs(H)>H1 then
B = sign(H)*(B1 + (abs(H)-H1)*muI); //The last part of the curve is also a straight line
else
B=sign(H)*(Ba*sqrt(1-((abs(H)-Hm)/Ha)^2)+Bm); //The straight lines are connected through an ellipsis
end if;
V_mag = H*l_Fe;
end NonlinearMagneticResistor5;
"Magnetic reluctance of flux tube with nonlinear characteristic"
extends Magnetic.Interfaces.MagneticFluxTube;
\\The following parameters define the B-H-curve of the magnetic material
parameter Modelica.SIunits.Permeability muI = 2.3626e-5;
parameter Modelica.SIunits.MagneticFieldStrength H0 = 28.475;
parameter Modelica.SIunits.MagneticFieldStrength H1 = 3264.3;
parameter Modelica.SIunits.MagneticFluxDensity Ba = 0.83263;
parameter Modelica.SIunits.MagneticFluxDensity Bm = 0.91058;
parameter Modelica.SIunits.MagneticFieldStrength Ha = 3602.2;
parameter Modelica.SIunits.MagneticFieldStrength Hm = 3630.6;
parameter Modelica.SIunits.MagneticFluxDensity B0 = Ba*sqrt(1-((H0-Hm)/Ha)^2)+Bm;
parameter Modelica.SIunits.MagneticFluxDensity B1 = Ba*sqrt(1-((H1-Hm)/Ha)^2)+Bm;
parameter Modelica.SIunits.Length l_Fe = 1;
parameter Modelica.SIunits.Area A = 1;
Modelica.SIunits.MagneticFieldStrength H;
Modelica.SIunits.MagneticFluxDensity B;
equation
B = Phi/A;
if abs(H)<H0 then
B = sign(H)*abs(H)*B0/H0; //The first part of the curve is a straight line
elseif abs(H)>H1 then
B = sign(H)*(B1 + (abs(H)-H1)*muI); //The last part of the curve is also a straight line
else
B=sign(H)*(Ba*sqrt(1-((abs(H)-Hm)/Ha)^2)+Bm); //The straight lines are connected through an ellipsis
end if;
V_mag = H*l_Fe;
end NonlinearMagneticResistor5;
Thank you