Opened 15 years ago

Last modified 14 years ago

#1154 closed defect (fixed)

Lookup of record constructor in modification fails (from MathCore)

Reported by: Jan Brugård Owned by: Jan Brugård
Priority: blocker Milestone:
Component: Version:
Keywords: Cc: Jan Brugård, Martin Sjölund

Description

Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke in the Modelica 3.1 library does not work as lookup of record constructor fails. In the following line of code:

Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.Components.PermeanceActuator pmActuator(material=Modelica.Magnetic.FluxTubes.Material.HardMagnetic.PlasticNdFeB(), x(start=pmActuator.x_min, fixed=true), armature(v(fixed=true)), coil(i(fixed=true)))

gives the following error message:

[9] 11:23:01 Validation of class Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke
Check of Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke failed
Error: Error occured while flattening model Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke
Error: Variable pmActuator.R not found in scope Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke
Error: Class Modelica.Magnetic.FluxTubes.Material.HardMagnetic.PlasticNdFeB not found in scope

This is used a lot in the Magnetic library, and probably by any library that uses the Media library, and is therefore important to fix if these libraries are to work.

MathCore - Björn 2010-02-03
The model instantiates but gives error messages;

end Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke;
"
"Error: No constant value for variable stateSelect in scope Modelica.Mechanics.Translational.Components.Mass.
Error: Variable B_rRef not found in scope Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke
Error: No constant value for variable B_rRef in scope Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke.
Error: Variable B_rRef not found in scope Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke
Error: No constant value for variable B_rRef in scope Modelica.Magnetic.FluxTubes.Examples.MovingCoilActuator.ArmatureStroke.
Error: No constant value for variable stateSelect in scope Modelica.Mechanics.Translational.Components.Mass.
"

Change History (3)

comment:2 by Martin Sjölund, 15 years ago

/* adrpo: TODO! handle also the case model extends x end x; */

I will try to rewrite the code to also handle extends...

comment:3 by Martin Sjölund, 14 years ago

Works in trunk. No error messages.

Note: See TracTickets for help on using tickets.