pNeuma_simulator.utils.utils module

pNeuma_simulator.utils.utils.direction(theta_i: float) tuple[source]

Calculate the current direction vector and the normal vector to the current direction.

Parameters:

theta_i (float) – The angle in radians representing the current direction.

Returns:

A tuple containing the current direction vector (e_i) and the normal vector to the current direction (e_i_n).

Return type:

tuple

pNeuma_simulator.utils.utils.projection(e_i_n, e_i_j, s_i_j: float) float[source]

Calculates the projection of vector e_i_j onto vector e_i_n.

Parameters:
  • e_i_n (array-like) – The vector onto which the projection is made.

  • e_i_j (array-like) – The vector being projected.

  • s_i_j (float) – The magnitude of vector e_i_j.

Returns:

The projection of vector e_i_j onto vector e_i_n.

Return type:

float

pNeuma_simulator.utils.utils.tangent_dist(theta_i: float, theta_j: float, a_i: float, b_i: float) float[source]

Calculate the tangent distance between two angles.

Parameters:
  • theta_i (float) – The first angle in radians.

  • theta_j (float) – The second angle in radians.

  • a_i (float) – The value of a_i.

  • b_i (float) – The value of b_i.

Returns:

The tangent distance between theta_i and theta_j.

Return type:

k_prime (float)

pNeuma_simulator.utils.utils.truncated_rvs(rng, size: int, dist, x_min: float, x_max: float, k, s: float, loc: float, scale: float)[source]

Generate truncated random variables.

Parameters:
  • rng (object) – Random number generator.

  • size (int) – Number of random variables to generate.

  • dist (object) – Probability distribution object.

  • x_min (float) – Minimum value for truncation.

  • x_max (float) – Maximum value for truncation.

  • k (float) – First shape parameter for the distribution.

  • s (float) – Second shape parameter for the distribution.

  • loc (float) – Location parameter for the distribution.

  • scale (float) – Scale parameter for the distribution.

Returns:

Array of truncated random variables.

Return type:

numpy.ndarray