Functions

Introduction

The available functions are:

  • arithmetic operators
  • usual mathematical functions admitted by Fortran
  • functions for treatment of complex quantities
  • functions for treatment of vector quantities
  • other specific functions (Modulo, Valid, Trapez, …)

Operators

The arithmetic operators are described in the table below.

Operator Description
+ add two values
subtract two values
* multiply two values
/ divide two values
** or ^ raise the left operand to the power specified by the right hand operand

Mathematical functions

The usual mathematical functions are gathered in the tables below.

Square function and absolute value
Sqrt(x) Square root of the expression x
Abs(x) Absolute value of the expression x
Logarithm and exponential functions
Exp(x) Exponential function of the expression x
Log(x) Natural logarithm of the expression x
Log10(x) Common logarithm of the expression x
Other functions
Int(x) Integral part of the expression x
Modulo(x,x1) Remainder of the division of x by x1
Min(x1,x2) Minimum of the expressions x1 and x2
Max(x1,x2) Maximum of the expressions x1 and x2
Sign(x)

Sign of the expression x:

Sign(x)=+1 if x>0; = -1 if x<0; = 0 if x=0

Trigonometry

The usual trigonometric functions are gathered in the tables below.

Trigonometric functions
Sin(x) Sine of the angle x expressed in radians
Cos(x) Cosine of the angle x expressed in radians
Tan(x) Tangent of the angle x expressed in radians
Asin(x) Arcsine in radians of the expression x; x ∈ [-1,1]
Acos(x) Arccosine in radians of the expression x; x ∈ [-1,1]
Atan2(x,y) Arctangent in radians of the expression (x/y)
Sind(x) Sine of the angle x expressed in degrees
Cosd(x) Cosine of the angle x expressed in degrees
Tand(x) Tangent of the angle x expressed in degrees
Asind(x) Arcsine in degrees of the expression x; x ∈ [-1,1]
Acosd(x) Arccosine in degrees of the expression x; x ∈ [-1,1]
Atan2d(x,y) Arctangent in degrees of the expression (x/y)
Sinh(x) Hyperbolic sine of the expression x
Cosh(x) Hyperbolic cosine of the expression x
Tanh(x) Hyperbolic tangent of the expression x
Asinh(x) Arcsine hyperbolic of the expression x; x ∈ [-1, ∝[
Acosh(x) Arccosine hyperbolic of the expression x; x ∈]-∝ , ∝[
Atan2h (x,y) Arctangent hyperbolic of the expression (x/y); x ∈ [-1,1]

Treatment of complex quantities

The functions for treatment of the complex quantities are gathered in the table below.

Functions for treatment of the complex quantities
ModC(z) Complex modulus of the complex expression z
Arg(z) Argument (in radians) of the complex expression z
Inst(z,t) Value at the instant t (in degrees) of the complex expression z
Real(z) Real part of the complex expression z
Imag(z) Imaginary part of the complex expression z
Conj(z) Conjugate of the complex expression z
Cmplx(x,y)

Complex expression built starting from the real expressions

x and y

Vector treatment

The functions for treatment of the vectors are gathered in the table below.

Functions for vector treatment
ModV(v) Vector modulus of the vector expression v
Comp(i,v) Component i of the vector expression v
PVec(v1,v2) Vector product of 2 real vector expressions
Vec2(x,y) 2D vector built starting from the real expressions x and y
Vec3(x,y,z) 3D vector built starting from the real expressions x, y and z
Mod(x) General modulus of the expression x: Mod(x)=ModV(ModC(x))

Modification of the coordinate system

The modification of a coordinate system is obtained with the functions in the table below.

CLCS(r,i)

Component i of coordinates in the local coordinate system

r (i=1, 2 or 3)

VLCS(r,v) Vector v in the local coordinate system r

Other functions

The other functions (or specific functions) are gathered in the table below.

Other functions
Valid(x,x1,x2)

if x1 ≤ x<x2:

else:

Valid(x,x1,x2)= 1

Valid(x,x1,x2)= 0

Trapez(x,x1,x2,x3)

if x1 ≤ x ≤ x1+x2:

if x<0 or x>x1+x2+x3:

Trapez(x,x1,x2,x3)= 1

Trapez(x,x1,x2,x3)= 0

Trapezper(x,x1,x2,x3,x4,x5,x6,x7)

Periodic trapezoidal function

see § Trapezper function