next up previous
Next: Time Dependent Variables Up: 4.3.1 The Model Definition Previous: Data types Operators and Functions

AMI supports several mathematical operators as well as built-in functions. The supported functions and operators are listed in Table 4.1 and Table 4.2.

Table 4.1: Operators supported by the Analytical Model Interface Language
Operator Function Syntax
+ addition <any datatype> + <any datatype>
- subtraction <any datatype> - <any datatype>
* multiplication <any datatype> * <any datatype>
/ division <any datatype> / <scalar datatype>
** power <any datatype> ** <scalar datatype>
^T transpose <any datatype>^T
D derive D(<any datatype>,<user function>(<any datatype>)
Sum sum Sum{i=x..y}(<user function>(i))

Table 4.2: Built-in functions supported by the Analytical Model and its ability for auto derivative option
Operator Function Syntax derive
sin sinus sin( <scalar datatype> ) yes
cos cosinus cos( <scalar datatype> ) yes
tan tangens tan( <scalar datatype> ) yes
asin arcus sinus asin( <scalar datatype> ) yes
acos arcus cosinus acos( <scalar datatype> ) yes
atan arcus tangens atan( <scalar datatype> ) yes
asinh area sinus hyperb. asinh( <scalar datatype> ) yes
acosh area cosinus hyperb. acosh( <scalar datatype> ) yes
atanh area tangens hyperb. atanh( <scalar datatype> ) yes
exp exponential exp( <scalar datatype> ) yes
sqrt square root sqrt( <positive scalar datatype> ) yes
ln natural logarithm ln( <positive scalar datatype> ) yes
bernoulli bernoulli function bernoulli( <scalar datatype> ) yes
sigma sigma function sigma( <scalar datatype> ) no
abs absolute value abs( <scalar datatype> ) no

In addition to these functions AMI has implemented two types of user definable functions. The first can be used internally and will be resolved and optimized automatically by the interpreter whenever possible. The analytical derive operator can be used on this type of function, too.

f(x1,x2,...,xn) = <any mathematical expression using x1,x2,...,xn
                   as function parameters>

The second is a so called external function that can neither be resolved nor optimized nor derived by the analytical input interface, but it is a means to submit more complex functions that can not be handled with the model definition language. It's syntax looks like

<<r1[n1,m1]>,<r2[n2,m2]>,...,<rn[nn,mn]>> = 
           <name of C-function>(<var1>,<var2>,...,<varn>)
The variables r1,r2,...,rn with optional dimension definition [n1, m1],[n2, m2],...,[nn, mm] are accessible within AMI like any other variable. During runtime the C-function with the defined name in the analytical model is evaluated using var1,var2,...,varn as its input and the variables r1,r2,...,rn are replaced with the resulting output parameters of the function. Implementing external functions is the only situation where a compilation process is necessary in order to link the external function to the existing executable.

next up previous
Next: Time Dependent Variables Up: 4.3.1 The Model Definition Previous: Data types
Mustafa Radi