Special Functions

GoldSim provides the following specialized mathematical functions:

 

Function

Description

erf(U1)

Gauss error function of U1

erfc(U1)

Complementary Gauss error function of U1

if(C,E,F) or

if(C then E else F)

If C is true then E else F

bess(U1,U2)

Bessel function of U1 of order U2

beta(U1,U2)

Beta function of U1 and U2

gamma(U1)

Gamma function of U1

normprob(U1)

Returns a value representing the cumulative probability level for the specified number of standard deviations (U1) away from the mean for a standard normal distribution. A negative argument represents values to the left of (less than) the mean.

normsds(P)

Returns a value representing the number of standard deviations away from the mean for the specified cumulative probability level (P) for a standard normal distribution. A negative output represents a value to the left of (less than) the mean.

tdist(P,nu)

Student’s t distribution for the specified cumulative probability level (P), with nu degrees of freedom

tprob(X,nu)

Student’s t distribution, returns the cumulative probability for value X, with nu degrees of freedom.

ImpProb(Old,Target,Width)

Used for customized importance sampling for a given target probability and probability width. Takes a probability (Old) and returns a biased probability.

ImpWeight(Prob,Target,Width)

Used for customized importance sampling for a given target probability and probability width. Takes a biased probability (produced by ImpProb) and returns a weight.

ImpOld(Prob,Target,Width)

Used for customized importance sampling for a given target probability and probability width. Takes a biased probability (produced by ImpProb) and returns the unbiased probability.  This is the inverse of ImpProb.

PDF_Value(D, P1)

Returns the value of the distribution at the specified cumulative probability level P1. The output has the same dimensions as the distribution being referenced.

PDF_CumProb(D, V)

Returns the cumulative probability of the distribution at the specified value V. The output is dimensionless.

PDF_Mean(D)

Returns the mean of the distribution. The output has the same dimensions as the distribution being referenced.

PDF_SD(D)

Returns the standard deviation of the distribution. The output has the same dimensions as the distribution being referenced.

PDF_CTE(D, P1)

Returns the conditional tail expectation of cumulative probability P1 (i.e., the expected value of the output given that it lies above a specified cumulative probability P1).  This result represents the mean of the worst 100(1 – P1)% of outcome. The output has the same dimensions as the distribution being referenced.

PDF_DiscreteProb(D, V)

Returns the discrete probability of the distribution at the specified value V. The output is dimensionless. This function returns 0 for continuous distributions (i.e., it should only be applied to discrete distributions).

changed(Z)

Returns a condition. True if the argument has changed since the last update (e.g., timestep). False if the argument has not changed.  See Note below.

occurs(T)

Returns a condition. True if the argument has occurred this update (e.g., timestep). False if the argument has not occurred.

U1,U2: Must be a unitless value. Can be a scalar or an array.
D: A distribution output.
V: A scalar value.
X, Y: A value. Can be a scalar or an array.
E, F: A  value or a condition. Can be a scalar or an array.
C:  Must be a condition. C can be an array or scalar; if it is an array, then the “if” test is done on a term-by-term basis and either E or F (or both) must be an array with the same set of array labels as C. If C is scalar, E and F can be either scalar, arrays of the same order (entire array is then selected), or one can be an array and one can be a scalar (in which case the scalar is treated as an array of identical values).
P: A value between 0 and 1, inclusive. Can be a scalar or an array.
P1, Old, Target: A scalar value between 0 and 1, inclusive.
Width: A scalar value between 10-6 and 0.5, inclusive.
nu: A positive integer. Can be a scalar or an array.
Z: A  value or a condition. Must be a scalar.
T: Must be a discrete event signal.

   Note: If the argument to the changed() function is a Run Property that conceptually cycles (e.g., Hour), and your timestep is such that the actual value remains unchanged (e.g., Changed(Hour), with a 1 day timestep), GoldSim will still consider that the argument has changed (since the fact that it remains unchanged is simply an artifact of timestepping).

   Note: The three importance sampling functions (ImpProb, ImpWeight and ImpOld) are used to carry out customized importance sampling of Stochastic elements.

Related Topics…

Learn more about: