User function definition

@USER_FUNCTION_DEFINITION {
@USER_FUNCTION_NAME {TimFunName} {
@FUNCTION_1D_TYPE {Fun1DType}
@USER_FUNCTION_ID {funID}
@PARAMETERS {p1, p2, ...}
@COMMENTS {CommentText}
}
}

Introduction

A user function describes a function of a single variable, F = F(x), where x is the independent variable and F the value of the function. The user function possesses a specific analytical form that the user will program in a routine that becomes a part of the code. User functions are used in conjunction with 1D functions. A plot of the function will be generated if plotting control parameters are defined.

Notes

  1. The nature of the data entered in the tabulated function is determined by parameter Fun1DType.
    • Possible values of parameter Fun1DType are listed for the associated 1D function.
    • Parameters Fun1DType defined for the user function and associated 1D function must match.
    • Parameter Fun1DType defines the units of the independent variable, x, and of user function F.
  2. An integer function ID, funID, must be provided to identify the user function uniquely.
  3. Optionally, a list of parameters, p1, p2, ..., can be defined. These parameters will be passed onto the user function routine when it is evaluated.
  4. It is possible to attach comments to the definition of the object; these comments have no effect on its definition.

User provided time functions

User provided time functions are arbitrary function provided by the user, involving a number of input parameters. In this case, the @PARAMETERS entries are expected. The user provided time function is an arbitrary function of time involving the input parameters. The user provided function must be coded as a routine to be added to the code.

Example 1

The following example defines a user defined time function.

@USER_FUNCTION_DEFINITION {
@USER_FUNCTION_NAME {UsrFunName} {
@FUNCTION_1D_TYPE {RECTILINEAR_DAMPER}
@USER_FUNCTION_ID {2}
@PARAMETERS { 1.0, 2.0, 3.0}
}
}

Assuming that a routine is written implementing the following formula f = 1.0 + 2.0 t + 3.0 t2, where t is time, this user provided time function implements a parabolic function of time.