Opened 15 years ago

Last modified 14 years ago

#1140 closed defect (fixed)

check of all Examples in Modelica.Electrical.Machines in MSL3.1 fails

Reported by: Peter Aronsson Owned by: Peter Aronsson
Priority: critical Milestone:
Component: Version:
Keywords: Cc: Peter Aronsson, Martin Sjölund

Description

All examles in Modelica.Electrical.Machines (in MSL 3.1) fails to check.

Many of them have similar error, e.g:
Error: No constant value for variable Lm in scope Modelica.Electrical.Machines.BasicMachines.Components.AirGapS

MathCore TRAC: http://intranet/trac/mathmodelica/ticket/2729

Comment from Rikhard (@MathCore):

Most of the examples now check, but TransformerTestbench, Rectifier6pulse and Rectifier12pulse still fails. The failing examples all contain transformers.

Checking the partial model
Modelica.Electrical.Machines.BasicMachines.Components.BasicTransformer
(all other transformers in the library extends this component) gives the following msg:

"Error: Error occured while flattening model  Modelica.Electrical.Machines.BasicMachines.Components.BasicTransformer"

Change History (3)

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

Small example to reproduce the problem described above (if the model is balanced, it will succeed even though the error messages are put into the buffer). I'd say the problem that printing Lm is not a constant (it's not even supposed to be constant!), is a minor issue.

It is very easy to enable the message for constants, but I'm not sure that is desired (since parameters with bindings are actually constant-evaluated in OpenModelica). You still get warnings that fixed is true and it doesn't have a value. Maybe we should rewrite start attributes of parameters to EQMOD instead (the attributes aren't present in lookupVar!)...

The problem that the machines are not balanced seems to be an unrelated issue.

(Run with omc +showErrorMessages +d=failtrace,ceval)

class A

parameter Real Lm;

end A;

class B

A a(final Lm = Lm);
parameter Real Lm(start = r2*2.0+17);
parameter Real r2 = r;
parameter Real r(start = 17.0);
Real r3; Make this unbalanced, so wrong error messages are printed out

end B;

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

In the trunk, this seems to now work as expected:

"Check of Modelica.Electrical.Machines.BasicMachines.Components.AirGapS completed successfully.

Warning: Parameter Lm has no value, and is fixed during initialization (fixed=true)
Warning: Parameter p has no value, and is fixed during initialization (fixed=true)

Class Modelica.Electrical.Machines.BasicMachines.Components.AirGapS has 32 equation(s) and 32 variable(s).
12 of these are trivial equation(s).
"

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

Closing this again as it is actually working in the trunk. Also, if you find a new problem with something, please open a new bug instead of reopening things I fixed ages ago (or at least add the comment as a comment in the bug in addition to editing the description).

{{{$ time omc a.mos
true
"Check of Modelica.Electrical.Machines.Examples.TransformerTestbench completed successfully.

Class Modelica.Electrical.Machines.Examples.TransformerTestbench has 676 equation(s) and 672 variable(s).
518 of these are trivial equation(s).
"
"Check of Modelica.Electrical.Machines.Examples.Rectifier6pulse completed successfully.

Class Modelica.Electrical.Machines.Examples.Rectifier6pulse has 491 equation(s) and 491 variable(s).
359 of these are trivial equation(s).
"
"Check of Modelica.Electrical.Machines.Examples.Rectifier12pulse completed successfully.

Class Modelica.Electrical.Machines.Examples.Rectifier12pulse has 870 equation(s) and 870 variable(s).
622 of these are trivial equation(s).
"

real 0m17.111s
user 0m13.860s
sys 0m1.690s}}}

Note: See TracTickets for help on using tickets.