User Tools


Parameter file tuning

User_Functions

In this block it is possible to include user defined functions for use during the simulation, e.g. a special voltage function. The syntax is the following:

type function_name(variable_name=type) = {
  return calculated_value;
};

The type of the function as well as the variables can be “integer” or “float”, the names of both are arbitrary but have to start with a letter. The number of variables is not limited and the calculated value can include common mathematical functions. An example of such a user function is the modulo function:

float myModulo(dividend=float, divisor=float) = {
  integer quotient = dividend / divisor;
  return dividend - quotient * divisor;
};

The use of this user function in the voltage function of an electrode would be e.g.:

vf = "-VP*myModulo(TIME, PAR.PERIOD)+DC_BIAS";