-
Notifications
You must be signed in to change notification settings - Fork 44
Various places where parameter variability seems too high #3811
Description
This issue collects a number of items questioning the use of parameter variability, when evaluable variability seems to make more sense. (The issue was originally formulated just for smooth, but was generalized in order to not result in too many, too similar, issues.)
I haven't analyzed all of these carefully, but I find it better to err on the side of bringing up too many on the table than bringing up too few, and leave it for the group to determine which cases we shouldn't touch.
smooth
I believe that the purpose of the smooth operator, https://specification.modelica.org/master/operators-and-expressions.html#modelica:smooth, is to allow tools to use the smoothness information during symbolic processing. Hence, I believe it is a mistake that it is currently not required that the smoothness order is evaluable.
Strictly speaking, also a non-evaluable smoothness order could have been used for integration method order selection, but this appears far more complicated to implement than what I believe is the intention behind the design.
cat
The dimension cat should operate, https://specification.modelica.org/master/arrays.html#array-concatenation.
Component condition
The introduction to the section needs to use correct variability when talking about the component condition, or not talk about its variability at all: https://specification.modelica.org/master/class-predefined-types-and-declarations.html#component-declarations
Just saying this might be good enough:
an optional
Booleancondition
Array dimensions example
From the array dimensions example in https://specification.modelica.org/master/class-predefined-types-and-declarations.html#component-declaration-static-semantics:
parameter Integer n = 0;
Real z[n*2] = cat(1, ones(n), zeros(n));// Parameter expressions are allowed
Connections.root
Since connection handling happens during translation, non-evaluable variability in the non-normative remark seems wrong: https://specification.modelica.org/master/connectors-and-connections.html#modelica:Connections.root
Also note the incorrect grammar in a parameter expressions.
Equations within when-equations
Maybe we already have an open issue about this, but in case we don't: https://specification.modelica.org/master/equations.html#equations-within-when-equations
This sounds wrong:
unless all switching conditions of the
if-equation are parameter expressions
Array dimensions in functions as specialized class
From https://specification.modelica.org/master/functions.html#function-as-a-specialized-class:
or given by constant or parameter expressions
Subscripts inside pre
Restriction on the subscripts inside pre(…): https://specification.modelica.org/master/operators-and-expressions.html#modelica:pre
Restrictions for transitions
The if-equation restriction for state machine transition operators: https://specification.modelica.org/master/state-machines.html#transitions
This looks wrong:
cannot be used inside
if-equations with conditions that are not parameter expressions
Synchronous argument restrictions
Looks like this was forgotten:
In cases when special handling of parameter expressions is specified, it is an indication that the values are not needed during translation.
Real interval clock
https://specification.modelica.org/master/synchronous-language-elements.html#modelica:clock-interval
Two occurrences of parameter expression, but I believe the intention is to allow computations on the periodic clock interval during translation?
hold
https://specification.modelica.org/master/synchronous-language-elements.html#modelica:hold
Input argument
$u$ is a … or a parameter expression.
It would just be a bit unusual to see the use of parameter expression in this chapter, but I must say that applying hold to a non-evaluable parameter expression seems pretty harmless.