Next: 4.3.1.2 Operators and Functions Up: 4.3.1 The Model Definition Previous: 4.3.1 The Model Definition

### 4.3.1.1 Data types

AMI supports a set of different datatypes and it can handle these types within all defined functions.

• constants: any number within AMI is interpreted as a constant value with the precision of a C-double value
• variables: any non numeric value within AMI is interpreted as a variable which can represent any datatype.
```<varname> = <any AMI datatype>
```
• running variables: are defined as a set of integer values
i = x, i = x + 1, i = x + 2,..., i = x + n = y
``` i = x .. y     # running variable from value x to y
```
• vectors: represent a one-dimensional field including constants and variables. If vectors include variables representing vectors or matrices the dimension is automatically expanded to fit the new datatype.
```[<a1>,<a2>,...,<an>]             # row vector
[[<a1>][<a2>][...][<an>]]        # column vector
```
• matrices: represent an n-dimensional field including constants and variables. If matrices include variables representing vectors or matrices the dimensions are automatically expanded to fit the new datatype.
```[[<a11>,<a12>,...,<a1n>]         # matrix definition
[<a21>,<a22>,...,<a2n>]         # within AMI
[       ...           ]
[<am1>,<am2>,...,<amn>]]
```
A single value of a vector or matrix can be accessed using the index written style supported by the model description language of AMI, shown in the following examples.

```# EXAMPLE 1:
var1 = A[1];           # variable var1 represents the first
# value of the vector A

# EXAMPLE 2:
i = 1..5;
var2[i] = A[i+1];      # variable var2 is a vector of size 1x5
# with the values of vector A[2] to A[6];

# EXAMPLE 3:
i = 1..5;
f(x,y) = x+y;

var3[i] = f(A[i],B[i+1]);
# variable var3 is a vector of size 1x5
# with the sum of A[1]+B[2] to A[5]+B[6];

#EXAMPLE 4:
var4 = (A.t0 - A.t1)/(t.t0 - t.t1)
# variable var4 is a vector of size 1x6
# holding the discretized first order
# derivatives in time for quantity A
```

Next: 4.3.1.2 Operators and Functions Up: 4.3.1 The Model Definition Previous: 4.3.1 The Model Definition