Math blocks

Math blocks allow to perform a wide variety of mathematical operations.

../../../_images/math_blocks.png

Math blocks

f(x)

Math blocks with 1 input and 1 output.

All f(x) math blocks have the same input and output:

  • Input

    real : Input value, real variable or constant.

  • Output

    real : Output value.

Warning

All these blocks express the output value in radians.

Users will find the following blocks:

  • -x: Change of sign.

  • 1/x: Inverse of the input (1/x).

  • [-0.5,0.5] Wrap: Wrapping to the range [-0.5, 0.5].

  • [-pi,pi] Unwrap: Angle unwrap from [-pi, pi] limits. This block converts an angle signal in the range [-pi, pi] to a continuous signal in the range [-inf, +inf] assuming the smallest angle change between execution steps.

  • [-pi,pi] Wrap: Angle wrapping to the range [-pi, pi] radians.

  • [0,1] Wrap: Wrapping to the range [0, 1].

  • [0,2pi] Wrap: Angle wrapping to the range [0, 2*pi] radians.

  • Arccos(x): Arccos function.

  • Arcsin(x): Arcsin function.

  • Arctan(x): Arctangent function.

  • Ceil(x): Closest intger rounding towards plus infinity.

  • Cos(x): Cosine function.

  • Exp(x): Natural exponent (e number to the power of the input of the block).

  • Floor(x): Closest integer rounding towards minus infinity.

  • Log(x): Natural logarithm.

  • Round(x): Rounding to closest integer.

  • Sign(x): Sign of the input. It returns ‘1’ if the input is positive or zero and ‘-1’ if negative.

  • Sin(x): Sine function.

  • Sqrt(x): Square root.

  • Tan(x): Tangent function.

  • x^2: Square of the input.

  • |x|: Absolute value.

f(x,y)

Math blocks with 2 inputs and 1 output.

All f(x,y) math blocks have the same inputs and output:

  • Inputs

    real : Input value, real variable or constant.

    real : Input value, real variable or constant.

  • Output

    real : Output value.

Users will find the following blocks:

  • Atan2(y,x): Calculates one unique arc tangent value, where the signs of both arguments are used to determine the quadrant of the result.

  • Max(x,y): Returns the maximum value of the two inputs.

  • Min(x,y): Returns the minimum value of the two inputs.

  • Remainder(x/y): Remainder block computes the remainder of the division with the first input as numerator and second input as denominator.

  • x*y: Mulitplier block.

  • x+y: Adder block.

  • x-y: Subtract block computes the subtraction of the first input minuts the second input.

  • x/y: Divider block computes the division with the first input as numerator and second input as denominator.

  • x^y: Computes the first input raised to the power of the second input.

Polynomial

This block performs a polynomial evaluation, it returns the value of the polynomial defined by the coefficients for the value of x.

../../../_images/polynomial_block.png

Polynomial block

  • Inputs

    real coef: Array of polynomial coefficients. The order is in increasing order of powers, that is first element is the independent term, second term is the proportional term, third the quadratic term, etc.

    real x: Value of evaluation of the polynomial.

  • Output

    real : Result of the polynomial evaluation.

Vectors

These are blocks that perform operations with vectors.

  • Add: Adds two vectors together.

  • Add Elements: Adds all the element of the input vector.

  • azeld -> xyz: Conversion from azimuth, elevation and distance to NED (North, East, Down).

    ../../../_images/az_xyz.png

    azeld -> xyz block

    • Inputs

      real az: Azimuth in radians.

      real el: Elevation in radians.

      real d: Distance in meters.

    • Output

      real xyz: NED (North, East, Down) vector in meters.

  • Body to NED: Rotates a vector from the Body frame of reference to North, East, Down.

    ../../../_images/body_ned.png

    Body to NED block

    • Input

      real i0: Vector in Body frame.

    • Output

      real o0: Vector in NED frame.

  • Bundle: Returns a vector whose components are the inputs of the block. In its configuration, the user can set the number of inputs.

    ../../../_images/bundle.png

    Bundle block

  • Dot Product: Returns the dot product of the input vectors.

  • Linear Transformation: Returns the input vector multiplied by the transformation matrix. In order to edit the transformation matrix, double click on the block.

    ../../../_images/linear_transformation.png

    Linear Transformation block

  • Max: Returns the value and position (integer integer output) of the highest component of the input vector.

  • Min: Returns the value and position (integer integer output) of the lowest component of the input vector.

  • Multiply Elements: Returns the product of the components of the input vector.

  • NED to Body: Rotates a vector from the North, East, Down frame of reference to Body.

    ../../../_images/ned_body.png

    Body to NED block

    • Input

      real i0: Vector in Body frame.

    • Output

      real o0: Vector in NED frame.

  • Norm: Computes the norm of the input vector.

  • Scale: Multiply the input vector (vIN) by a scalar value (k).

  • Split Bool: Splits a vector of booleans into singular boolean variables. In its configuration, the user can set the number of outputs.

  • Split Real: Splits a vector of real variables into singular real variables. In its configuration, the user can set the number of outputs.

  • xyz -> azeld: Conversion from NED (North, East, Down) to azimuth, elevation and distance.

    ../../../_images/xyz_az.png

    xyz -> azeld block

    • Input

      real xyz: NED (North, East, Down) vector in meters.

    • Outputs

      real az: Azimuth in radians.

      real el: Elevation in radians.

      real d: Distance in meters.