Opened 15 years ago

Last modified 15 years ago

#1193 closed defect (fixed)

Error when final array parameter is set via an initial equation

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone:
Component: Instantiation Version:
Keywords: Cc: Adrian Pop, Per Östlund

Description

This model:

model FinalInitialEquation
 final parameter Real p[3](each unit="1", each fixed=false);
 Real x(start = 1);
initial equation
 p = {1.0, 2.0, 3.0}; 
equation
 der(x) = -p[1] * x;
end FinalInitialEquation;

wrongly gives error:

[FinalInitialEquation.mo:3:2-3:60:readonly] Error: Variable p: trying to override final variable in class:

Attachments (2)

LoopsTotal.mo (294.8 KB ) - added by Adrian Pop 15 years ago.
This is a bigger model that has this error. […] If this error is fixed on the smaller model, it should be verified also against this bigger model.
LoopsTotal.mos (145 bytes ) - added by Adrian Pop 15 years ago.
This is a bigger model that has this error. […] If this error is fixed on the smaller model, it should be verified also against this bigger model.

Download all attachments as: .zip

Change History (4)

by Adrian Pop, 15 years ago

Attachment: LoopsTotal.mo added

This is a bigger model that has this error.

./omc LoopsTotal.mos
[LoopsTotal.mo:3786:13-3787:72:readonly] Error: Variable jointRRP.e_im: trying to override final variable in class: 
Error: Error occured while flattening model Modelica.Mechanics.MultiBody.Examples.Loops.Engine1b_analytic

If this error is fixed on the smaller model, it should be verified also against this bigger model.

by Adrian Pop, 15 years ago

Attachment: LoopsTotal.mos added

This is a bigger model that has this error.

./omc LoopsTotal.mos
[LoopsTotal.mo:3786:13-3787:72:readonly] Error: Variable jointRRP.e_im: trying to override final variable in class: 
Error: Error occured while flattening model Modelica.Mechanics.MultiBody.Examples.Loops.Engine1b_analytic

If this error is fixed on the smaller model, it should be verified also against this bigger model.

comment:1 by Adrian Pop, 15 years ago

See also the attachments!

comment:2 by Per Östlund, 15 years ago

Fixed in revision 5303. Turned out to be a problem with modifications on final variables, and nothing to do with initial equations. The LoopsTotal model still gives errors, but I think the remaining errors are unrelated to this bug so I'm marking this bug as resolved anyway.

Note: See TracTickets for help on using tickets.