Adrian,

Initializing the parameter is not a problem as such (we normally do provide
default values in our models for parameters), but the fact that parameters
are now fixed by default is. It means that now suddenly I have to modify all
our models and add fixed=false everywhere. I still don't understand what the
reasoning is behind this (but probably I'm missing something, so please
enlighten me). To me it seems that non-fixed parameters occur much more
frequently than fixed ones, hence the first situation is preferable as a
default, no?

In any case, I will have a look at the spec, maybe the rationale behind this
decision is explained there.


Filip.

-----Original Message-----
From: Adrian Pop [mailto:[email protected]] 
Sent: Monday, August 09, 2010 2:48 PM
To: openmodelicainterest
Cc: Filip Claeys
Subject: Re: BOUNCE [email protected]: Non-member submission


Hi Filip,

You send the email from an alternate address that is not
subscribed to the openmodelicainterest list. It bounced
to me for approval, so I'm sending it to the list.

As for your problem, this is how the parameters should
be treated in Modelica 3.x, if they do not have a default
value a warning is issued.

This problem can be fixed in several ways:
1. add a default value for the parameter
2. add a start value for the parameter
3. add an initial equation that sets the parameter

See the Modelica specification 3.x in regard to
treatment of parameter values for more information.

Cheers,
Adrian Pop/


> From: "Filip Claeys"<[email protected]>
> To:<[email protected]>
>
> Apparently something has changed in the official 1.5.0 release of OMC
> compared to previous versions with regard to the default value of the
> fixed attribute of parameters.
>
> Consider the following example:
>
> ---
> block Test
>    parameter Real p;
>    output Real y;
> equation
>    y = p;
> end Test;
> ---
>
> Running it through OMC (to produce flat code, which is what we always
> do) gives:
>
> ---
> fclass Test
>    parameter Real p;
>    output Real y;
> equation
>    y = p;
> end Test;
> Warning: Parameter p has no value, and is fixed during initialization
> (fixed=true)
> ---
>
> Not only does the last line with the warning message give a parse error
> when processing the flat code with our back-end compiler, but the fact
> that fixed is set to true by default for parameters is generally
> annoying and also not logical I think. Was there any pertinent reason to
> change this in the official 1.5.0 release?
>
> Best regards,
>
>
> Filip.
>


Reply via email to