Next: 4.3.1.3 Time Dependent Variables Up: 4.3.1 The Model Definition Previous: 4.3.1.1 Data types

### 4.3.1.2 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 + - subtraction - * multiplication * / division / ** power ** ^T transpose ^T D derive D(,() Sum sum Sum{i=x..y}((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( ) yes cos cosinus cos( ) yes tan tangens tan( ) yes asin arcus sinus asin( ) yes acos arcus cosinus acos( ) yes atan arcus tangens atan( ) yes asinh area sinus hyperb. asinh( ) yes acosh area cosinus hyperb. acosh( ) yes atanh area tangens hyperb. atanh( ) yes exp exponential exp( ) yes sqrt square root sqrt( ) yes ln natural logarithm ln( ) yes bernoulli bernoulli function bernoulli( ) yes sigma sigma function sigma( ) no abs absolute value abs( ) 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: 4.3.1.3 Time Dependent Variables Up: 4.3.1 The Model Definition Previous: 4.3.1.1 Data types