Saarland University
Lehrstuhl für Automatisierungstechnik

Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> Changing of parameters
post Aug 8 2006, 03:07 PM
Post #1

Advanced Member

Group: Members
Posts: 53
Joined: 5-July 06
From: Germany
Member No.: 18

Hallo Matthias,

Some parameters are evaluated during translation. For example, conditional components depending on a parameter. In that case the translation depends on that parameter and the translated model is only valid for a certain range of the parameter. In this way the translate model can be optimized. You can suppress the evaluation of parameters using the annotation Evaluate=false. If you do not give any default value parameters are not evaluated, too.

Hence, rewrite you model in one of the following ways:

parameter Modelica.SIunits.MagneticFieldStrength H1 = 3264.3 annotation(Evaluate=false);


parameter Modelica.SIunits.MagneticFieldStrength H1;

Another possibility is to rewirte your scripts to change parameters for the translation as a modification of the model.

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
post Aug 8 2006, 02:32 PM
Post #2


Group: Members
Posts: 1
Joined: 8-August 06
Member No.: 28

Hello everyone,

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:

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;


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
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
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


Lo-Fi Version Time is now: 18th August 2019 - 04:52 AM