Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Parameter Inheritance

Parameter Inheritance

I want to create a model of a magnetic component that overrides the value of magnetic relative permeability, using inheritance chain already defined in Modelica.
The chain of inheritance look like this: the parameter RelativePermeability mu_rConst=1 is defined in: Modelica.Magnetic.FluxTubes.Interfaces.PartialFixedShape. This parameter in turn is inherited by
Modelica.Magnetic.Shapes.Cuboid that adds some geometric constraints.

Ultimately in my model I want to override the mu_rConst=1 with mu_rConst=5000 (or so) while preserving all equations and constraints from the other two classes.
Multiple attempts result in "Class SI.RelativePermeability not found in the scope ReluctanceLinear"
Here's one of my unsuccessful attempts:

model ReluctanceLinear
  import SI;
  extends Modelica.Magnetic.FluxTubes.Shapes.FixedShape.Cuboid;
   parameter SI.RelativePermeability mu_rConst=5000;
end ReluctanceLinear;

I for sure am missing something. Any help is appreciated. 

Re: Parameter Inheritance

Should work like this:

Code:


model ReluctanceLinear
  extends Modelica.Magnetic.FluxTubes.Shapes.FixedShape.Cuboid(mu_rConst=5000);
end ReluctanceLinear;

Re: Parameter Inheritance

That's it !.
Great, thanks

There are 0 guests and 0 other users also viewing this topic