Constants
A constant is a numerical quantity whose value does not vary during the lifetime of any instance (Element) of the model in which it is declared or defined.
Defined Constants
A defined constant is a constant local to the model which is defined in its Constants area and whose value is that of a local expression to the model.
<Constant> ::=
<name> : <quantity> = <value> <ConstantOption> ;
|
<name> : <quantity> in [ <vmin> , <vmax> ] = <value> <ConstantOption> ;
|
<name> : <quantity> in { <v1>, …, <vn> } = <value> <ConstantOption> ;
|
<name> : <quantity> = <constant expression> <ConstantOption> ;
|
<name> : <quantity> in [ <cexprmin> , <cexprmax> ] = <constant expression> <ConstantOption> ;
|
<name> : <quantity> in { <v1>, …, <vn> } = <constant expression > <ConstantOption> ;
with
<ConstantOption> ::=
|
default
|
redefine
Note
Some universal constants are predefined in DEPS. Thus Pi represents the predefined constant whose value is that of the transcendental number π.
Declared constants
A declared constant is a constant local to the model which is defined in its Constants area and whose value is that of an expression passed as an argument of the model.
<Constant> ::=
<name> : <quantity> ;
|
<name> : <quantity> in [ <vmin> , <vmax> ] ;
|
<name> : <quantity> in { <v1>, …, <vn> } ;
|
<name> : <quantity> in [ <cexprmin> , <cexprmax> ] ;
|
<name> : <quantity> in { <v1>, …, <vn> } ;
Examples
The following peace of Model shows an example of the constant’s zone of a Model:
Constants
a : Real = 3.5 ;
b : Real in [0, , 20 ] = a^3 ;
c : Real in { -10.2, 0.0, 1.5, 2.3} = 1.5 ;
d : Real = a/b+ln(c) ;
e : Real in [ 2*a , 2*a+5 ] = 2*a+3 ;
f : Real in { a+2, a+4 , a+6} = a+4;
We can see that constants may depend on other previously defined constants both for the definition domain and for the value.