Action: BF_CUSTOM
| Module | ves |
|---|---|
| Description | Usage |
| Basis functions given by arbitrary mathematical expressions. |
Details and examples
Basis functions given by arbitrary mathematical expressions.
This allows you to define basis functions using arbitrary mathematical expressions that are parsed using the lepton library. The basis functions are given in mathematical expressions with x as a variable using the numbered FUNC keywords that start from FUNC1. Consistent with other basis functions is defined as the constant. The interval on which the basis functions are defined is given using the MINIMUM and MAXIMUM keywords.
Using the TRANSFORM keyword it is possible to define a function that is used to transform the argument before calculating the basis functions values. The variables min and max can be used to indicate the minimum and the maximum of the interval. By default the arguments are not transformed, i.e. .
For periodic basis functions you should use the PERIODIC flag to indicate that they are periodic.
The basis functions and the transform function need to be well behaved in the interval on which the basis functions are defined, e.g. not result in a not a number (nan) or infinity (inf). The code will not perform checks to make sure that this is the case unless the flag CHECK_NAN_INF is enabled.
Examples
Defining Legendre polynomial basis functions of order 6 using BF_CUSTOM where the appropriate transform function is given by the TRANSFORM keyword. This is just an example of what can be done, in practice you should use BF_LEGENDRE for Legendre polynomial basis functions.
BF_CUSTOMBasis functions given by arbitrary mathematical expressions. More details ... TRANSFORMAn optional function that can be used to transform the argument before calculating the basis function values=(t-(min+max)/2)/((max-min)/2) FUNC1The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=x FUNC2The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=(1/2)*(3*x^2-1) FUNC3The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=(1/2)*(5*x^3-3*x) FUNC4The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=(1/8)*(35*x^4-30*x^2+3) FUNC5The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=(1/8)*(63*x^5-70*x^3+15*x) FUNC6The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=(1/16)*(231*x^6-315*x^4+105*x^2-5) MINIMUMThe minimum of the interval on which the basis functions are defined=-4.0 MAXIMUMThe maximum of the interval on which the basis functions are defined=4.0 LABELa label for the action so that its output can be referenced in the input to other actions=bf1 ... BF_CUSTOM
Defining Fourier basis functions of order 3 using BF_CUSTOM where the periodicity is indicated using the PERIODIC flag. This is just an example of what can be done, in practice you should use BF_FOURIER for Fourier basis functions.
BF_CUSTOMBasis functions given by arbitrary mathematical expressions. More details ... FUNC1The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=cos(x) FUNC2The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=sin(x) FUNC3The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=cos(2*x) FUNC4The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=sin(2*x) FUNC5The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=cos(3*x) FUNC6The basis functions f_i(x) given in mathematical expressions using _x_ as a variable=sin(3*x) MINIMUMThe minimum of the interval on which the basis functions are defined=-pi MAXIMUMThe maximum of the interval on which the basis functions are defined=+pi LABELa label for the action so that its output can be referenced in the input to other actions=bf1 PERIODIC Indicate that the basis functions are periodic ... BF_CUSTOM
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| MINIMUM | compulsory | none | The minimum of the interval on which the basis functions are defined |
| MAXIMUM | compulsory | none | The maximum of the interval on which the basis functions are defined |
| DEBUG_INFOThis keyword do not have examples | optional | false | Print out more detailed information about the basis set |
| FUNC | optional | not used | The basis functions f_i(x) given in mathematical expressions using x as a variable |
| TRANSFORM | optional | not used | An optional function that can be used to transform the argument before calculating the basis function values |
| PERIODIC | optional | false | Indicate that the basis functions are periodic |
| CHECK_NAN_INFThis keyword do not have examples | optional | false | Check that the basis functions do not result in a not a number (nan) or infinity (inf) |