This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
function [2019/11/18 13:34] 127.0.0.1 external edit |
function [2023/02/16 14:54] (current) daria |
||
---|---|---|---|
Line 4: | Line 4: | ||
It is also possible to create custom functions, written in [[http:// | It is also possible to create custom functions, written in [[http:// | ||
+ | |||
+ | All listed functions may be used bu using [[constants_editing_tool]|Constant editing tool]]. | ||
Here follows a short description of functions included in the [[Expression_editing_tool|Expression editing tool]]. | Here follows a short description of functions included in the [[Expression_editing_tool|Expression editing tool]]. | ||
|==== Constant ==== | | | |==== Constant ==== | | | ||
- | |end_time | + | |**end_time** |**The simulation end time, as specified in [[Simulation_settings|simulation settings]]. ** |
- | |eps |the distance from 1.0 to the next larger double precision number, that is EPS=2-52. | + | |**eps** |**the distance from 1.0 to the next larger double precision number, that is EPS=2-52.** | |
- | |iteration | + | |**iteration |
- | |pi |4×atan(1) = imag(log(-1)) = 3.1415926535897.... | + | |**pi ** |**4×atan(1) = imag(log(-1)) = 3.1415926535897....** | |
- | |start_time | + | |**start_time** |**The simulation start time, as specified in [[Simulation_settings|simulation settings]].** | |
- | |time |the current simulation time-point | + | |**time** |**the current simulation time-point. ** | |
|==== Trigonometric ==== | |==== Trigonometric ==== | ||
- | |acos(X) | + | |**acos(X)** |**the arccosine of the elements of X.** | |
- | |asin(X) | + | |**asin(X)** |**the arcsine of the elements of X.** | |
- | |atan(X) | + | |**atan(X)** |**the arctangent of the elements of X. ** | |
- | |atan2(Y, | + | |**atan2(Y,X)** |**the four quadrant arctangent of the real parts of the elements of X and Y. -pi <= ATAN2(Y,X) <= pi.** | |
- | |cos(X) | + | |**cos(X)** |**the cosine of the elements of X.** | |
- | |cosh(X) | + | |**cosh(X)** |**the hyperbolic cosine of the elements of X.** | |
- | |sin(X) | + | |**sin(X)** |**the sine of the elements of X.** | |
- | |sinh(X) | + | |**sinh(X)** |**the hyperbolic sine of the elements of X.** | |
- | |tan(X) | + | |**tan(X)** |**the tangent of the elements of X.** | |
- | |tanh(X) | + | |**tanh(X)** |**the hyperbolic tangent of the elements of X.** | |
|==== Exponential ==== | |==== Exponential ==== | ||
- | |exp(X) | + | |**exp(X)** |**the exponential of the elements of X, e to the X.** | |
- | |hypot(A, | + | |**hypot(A,B)** |**returns SQRT(ABS(A)2+ABS(B)2) carefully computed to avoid underflow and overflow.** | |
- | |log(X) | + | |**log(X)** |**the natural logarithm of the elements of X.** | |
- | |log10(X) | + | |**log10(X)** |**the base 10 logarithm of the elements of X.** | |
- | |log2(X) | + | |**log2(X)** |**the base 2 logarithm of the elements of X.** | |
- | |power(X, | + | |**power(X,Y)** |**the value of the first argument raised to the power of the second argument. Note: you can use the ^ operator in place of the power() function.** | |
- | |sqrt(X) | + | |**sqrt(X)** |**the square root of the elements of X.** | |
|==== Rounding and Remainder ==== | | | |==== Rounding and Remainder ==== | | | ||
- | |ceil(X) | + | |**ceil(X)** |**rounds the elements of X to the nearest integers towards infinity.** | |
- | |fix(X) | + | |**fix(X)** |**rounds the elements of X to the nearest integers towards zero.** | |
- | |floor(X) | + | |**floor(X)** |**rounds the elements of X to the nearest integers towards minus infinity.** | |
- | |mod(x, | + | |**mod(x,y)** |**is x - n×y where n = floor(x/y) if y <> 0. If y is not an integer and the quotient x/y is within roundoff error of an integer, then n is that integer.**| |
- | |rem(x, | + | |**rem(x,y)** |**is x - n×y where n = fix(x/y) if y <> 0. If y is not an integer and the quotient x/y is within roundoff error of an integer, then n is that integer.** | |
- | |round(X) | + | |**round(X)** |**rounds the elements of X to the nearest integers.** | |
|==== General ==== | |==== General ==== | ||
- | |abs(X) | + | |**abs(X)** |**the absolute value of the elements of X.** | |
- | |erf(X) | + | |**erf(X)** |**the error function for X.** | |
- | |erfc(X) | + | |**erfc(X)** |**the complementary error function for X.** | |
- | |max(X,..., N) | + | |**max(X,..., N)** |**returns the highest value of the given arguments.** | |
- | |mean(X, | + | |**mean(X, |
- | |min(X, | + | |**min(X, |
- | |prod(X, | + | |**prod(X, |
- | |sign(X) | + | |**sign(X)** |**For each element of X, SIGN(X) returns 1 if the element is greater than zero, 0 if it equals zero and -1 if it is less than zero.** | |
- | |sum(X, | + | |**sum(X, |
|==== Logical ==== | |==== Logical ==== | ||
- | |and(X, | + | |**and(X,Y)** |**bitwise and of X and Y.** | |
- | |if(X, | + | |**if(X, |
- | |not(X) | + | |**not(X)** |**the bitwise inverse of X.** | |
- | |or(X, | + | |**or(X,Y)** |**bitwise or of X and Y.** | |
|==== Table lookup ==== | | | |==== Table lookup ==== | | | ||
- | |interpolationExtrapolation(XI, | + | |**interpolationExtrapolation(XI, |
- | |interpolationUseEndValues(XI, | + | |**interpolationUseEndValues(XI, |
- | |useInputAbove(XI, | + | |**useInputAbove(XI, |
- | |useInputBelow(XI, | + | |**useInputBelow(XI, |
- | |useInputNearest(XI, | + | |**useInputNearest(XI, |
|==== Arithmetic ==== | | | |==== Arithmetic ==== | | | ||
- | |binomial(N, | + | |**binomial(N, |
- | |factorial(N) | + | |**factorial(N)** |**the product of all the integers from 1 to N.** | |
===== See also ===== | ===== See also ===== | ||
Line 69: | Line 71: | ||
* [[Creating_custom_functions|Creating custom functions]] | * [[Creating_custom_functions|Creating custom functions]] | ||
* [[Expression_editing_tool|Expression editing tool]] | * [[Expression_editing_tool|Expression editing tool]] | ||
+ | * [[constants_editing_tool|Constant editing tool]] | ||
+ | |||