- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Parameter Inheritance
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;
- adrpo
- 885 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Parameter Inheritance