AMI supports a set of different datatypes and it can handle these types within all defined functions.
<varname> = <any AMI datatype>
i = x .. y # running variable from value x to y
[<a1>,<a2>,...,<an>] # row vector [[<a1>][<a2>][...][<an>]] # column vector
[[<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; # 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 to A; # 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+B to A+B; #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