Blocks#

Every block of this toolkit, from its catalog.

math#

Block

Type

What it does

Absolute

absolute

Computes the absolute value of u.

Angle Diff

angle_diff

Computes the shortest signed difference (a - b) normalized to [-pi, pi].

Arithmetic

arithmetic

Applies an arithmetic operator to a and b.

Atan2

atan2

Computes the 2-argument arctangent atan2(y, x) in radians.

Bessel

bessel

The Bessel function of u, of the chosen kind and order (Boost.Math).

Clamp

clamp

Restricts u between min and max.

Deadband

deadband

Suppresses signals within [-width, +width].

Deg to Rad

deg_to_rad

Converts an angle from degrees to radians.

Determinant

determinant

The determinant of a square matrix.

Distribution

distribution

The pdf, cdf or quantile of a normal, uniform or exponential distribution (Boost.Math).

Error Function

erf

The error function of u (Boost.Math).

Gain

gain

Multiplies its input by k.

Gamma

gamma

The gamma, log-gamma or digamma function of u (Boost.Math).

Hypot

hypot

Computes the Euclidean distance hypot(a, b) = sqrt(a*a + b*b).

Identity

identity

The n × n identity matrix: ones on the diagonal, zeros elsewhere.

Inverse

inverse

The inverse of a square, non-singular matrix (A⁻¹).

Lerp

lerp

Linearly interpolates between a and b by factor t.

Map Range

map_range

Maps u linearly from [in_min, in_max] to [out_min, out_max].

Matrix

matrix_constant

A matrix from its rows: “1 2; 3 4” (commas, newlines and brackets are welcome).

Min / Max

min_max

Selects the minimum or maximum among inputs.

Matrix multiply

multiply

The matrix product A·B; the inner dimensions must agree.

Rad to Deg

rad_to_deg

Converts an angle from radians to degrees.

Random Boolean

random_boolean

Generates random booleans with probability p.

Random Number

random_number

Generates random numbers between min and max.

Round

round

Rounds u to an integer using the chosen mode.

Saturation

saturation

Keeps its input between a minimum and a maximum.

Scale matrix

scale

Multiplies every element of a matrix by k.

Size

size

The shape of a matrix: how many rows and columns it has.

Solve

solve

Solves A·x = B for x (MATLAB’s A \ B); A must be square and non-singular.

Sum

sum

Adds a and b.

Threshold

threshold

1 above a level, else 0.

Transpose

transpose

The transpose of a matrix: rows become columns.

Wrap Angle

wrap_angle

Wraps an angle in radians into the range [-pi, pi].

group#

Block

Type

What it does

In

inport

An input of the subsystem or story it is in: a port on the group’s block outside, named by name, and its value here.

Out

outport

An output of the subsystem or story it is in: what is wired to it leaves by a port on the group’s block outside, named by name.