Function : The mathematical concept that one quantity (the argument of the function, also known as the input) completely determines another quantity (the value, or the output)

So a function might be f(t) in which the value of t determines the value of f(t) or f(x,t) where the combination of x and t determine the value of f. In this case t is the argument of f.

More examples of functions can be found here http://wiki.deltares.nl/display/TOOLS/2009/04/17/Some+examples+of+functions

A function has arguments (which completely determine the value of the outcome of f) and one or more components which specify the output. For example a function of windfield might have a Vy and Vx component for every x,y location on a map. In this case x and y are the arguments of Vx and Vy are components.

F VxVy(x,y)

Variable

A variable is a function with only one component. Therefore it's type can specified. Variables can be used as arguments and as components in a function. If a variable is used as a argument it's values should be unique. This is because the value of the variable should fully determine the output of the function. For example: a function y uses variable x as it's argument: y= f(x). The values of this function might be :

x

f(x)

1

1

2

3

3

5

It should be clear that the values of x should be unique to make sure f(x) is the same when x is the same.

Next to determining values a variable also has a unit (for example datetime) and name (for example concentration Cl-)

Dependent variables (Components)
Dependent variables are in size and value dependent of the values of the arguments. For example
a function y = 2x. Then y is dependent on the value x and therefore not 'free'. In deltashell terms this means that the number of values for a dependent variables should be the product of the number values of it's arguments.

var x = new Variable<int>();
var y = new Variable<int>();
y.Arguments.Add(x);//now x is the argument and y the component
x.Values.Add(1);
Assert.AreEqual(1,y.Values.Count);//note that Y resized! because it _depends_ on X

Independent variables (Arguments)
Independent variables are variables without arguments. You can add values to independent variables but these values should be unique

FunctionStore

A FunctionStore is the datastore for functions. It can be a file or in memory. Functions can be added to a store and can be in only one store at a time. If a function is added to another store it's values are copied into the store. A functionstore is also responsible for evaluating functions. This is because the evaluation might depend on the storage.

  • No labels