Math

class pathsim.blocks.math.Math[source]

Bases: Block

Base math block.

Note

This block doesnt implement any functionality itself. Its intended to be used as a base for the elementary math blocks. Its not intended to be used directly!

update(t)[source]

update algebraic component of system equation

Parameters:

t (float) – evaluation time

class pathsim.blocks.math.Sin[source]

Bases: Math

Sine operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \sin(\vec{u})\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Cos[source]

Bases: Math

Cosine operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \cos(\vec{u})\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Sqrt[source]

Bases: Math

Square root operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \sqrt{|\vec{u}|}\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Abs[source]

Bases: Math

Absolute value operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \vert| \vec{u} \vert|\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Pow(exponent=2)[source]

Bases: Math

Raise to power operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \vec{u}^{p}\]
Parameters:

exponent (float, array_like) – exponent to raise the input to the power of

op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.PowProd(exponents=2)[source]

Bases: Math

Power-Product operator block.

This block raises each input to a power and then multiplies all results together:

\[y = \prod_i u_i^{p_i}\]
Parameters:

exponents (float, array_like) – exponent(s) to raise the inputs to the power of. If scalar, applies same exponent to all inputs.

op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Exp[source]

Bases: Math

Exponential operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = e^{\vec{u}}\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Log[source]

Bases: Math

Natural logarithm operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \ln(\vec{u})\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Log10[source]

Bases: Math

Base-10 logarithm operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \log_{10}(\vec{u})\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Tan[source]

Bases: Math

Tangent operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \tan(\vec{u})\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Sinh[source]

Bases: Math

Hyperbolic sine operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \sinh(\vec{u})\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Cosh[source]

Bases: Math

Hyperbolic cosine operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \cosh(\vec{u})\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Tanh[source]

Bases: Math

Hyperbolic tangent operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \tanh(\vec{u})\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Atan[source]

Bases: Math

Arctangent operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \arctan(\vec{u})\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Norm[source]

Bases: Math

Vector norm operator block.

This block computes the Euclidean norm of the input vector:

\[y = \|\vec{u}\|_2 = \sqrt{\sum_i u_i^2}\]
op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Mod(modulus=1.0)[source]

Bases: Math

Modulo operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \vec{u} \bmod m\]

Note

modulo is not differentiable at discontinuities

Parameters:

modulus (float) – modulus value

op_alg

internal algebraic operator

Type:

Operator

class pathsim.blocks.math.Clip(min_val=-1.0, max_val=1.0)[source]

Bases: Math

Clipping/saturation operator block.

This block supports vector inputs. This is the operation it does:

\[\vec{y} = \text{clip}(\vec{u}, u_{min}, u_{max})\]
Parameters:
  • min_val (float, array_like) – minimum clipping value

  • max_val (float, array_like) – maximum clipping value

op_alg

internal algebraic operator

Type:

Operator