Poincare Utilities

The utils module provides utility functions for interpolation and numerical methods used in Poincare map computation.

Functions

hiten.algorithms.poincare.utils._interp_linear()[source]

Linear interpolation between two points.

Parameters:
  • t0 (float) – Start time (nondimensional units).

  • x0 (ndarray) – Start state vector (nondimensional units).

  • t1 (float) – End time (nondimensional units).

  • x1 (ndarray) – End state vector (nondimensional units).

  • t (float) – Interpolation time (nondimensional units).

Returns:

Interpolated state vector at time t.

Return type:

ndarray

Notes

This function performs linear interpolation between two points in time and state space. It computes the interpolation parameter s = (t - t0) / (t1 - t0) and uses it to linearly interpolate between the start and end states.

The function is optimized with Numba JIT compilation for high performance in numerical computations.

All time units are in nondimensional units.

hiten.algorithms.poincare.utils._hermite_scalar()[source]

Cubic Hermite interpolation for scalar values.

Parameters:
  • s (float) – Interpolation parameter in [0, 1].

  • y0 (float) – Function value at s=0 (nondimensional units).

  • y1 (float) – Function value at s=1 (nondimensional units).

  • dy0 (float) – Derivative at s=0 (nondimensional units per time).

  • dy1 (float) – Derivative at s=1 (nondimensional units per time).

  • dt (float) – Time step (nondimensional units).

Returns:

Interpolated function value at parameter s.

Return type:

float

Notes

This function implements cubic Hermite interpolation for scalar functions. It uses the standard Hermite basis functions: - h00(s) = (1 + 2s)(1 - s)^2 - h10(s) = s(1 - s)^2 - h01(s) = s^2(3 - 2s) - h11(s) = s^2(s - 1)

The interpolation formula is:

H(s) = h00(s)*y0 + h10(s)*dy0*dt + h01(s)*y1 + h11(s)*dy1*dt

This provides C1 continuity and high accuracy for smooth functions.

All units are in nondimensional units.

hiten.algorithms.poincare.utils._hermite_der()[source]

Derivative of cubic Hermite interpolation for scalar values.

Parameters:
  • s (float) – Interpolation parameter in [0, 1].

  • y0 (float) – Function value at s=0 (nondimensional units).

  • y1 (float) – Function value at s=1 (nondimensional units).

  • dy0 (float) – Derivative at s=0 (nondimensional units per time).

  • dy1 (float) – Derivative at s=1 (nondimensional units per time).

  • dt_seg (float) – Time step (nondimensional units).

Returns:

Derivative of the interpolated function at parameter s.

Return type:

float

Notes

This function computes the analytical derivative of the cubic Hermite interpolation polynomial. It uses the derivatives of the Hermite basis functions: - dh00(s) = 6s(s-1) + (1-s)^2*2 - 2(1-s)(1+2s) - dh10(s) = (1-s)^2 + s*2(s-1) - dh01(s) = 6s(1-s) - 2s(3-2s) - dh11(s) = 2s(s-1) + s^2

The derivative formula is:

dH/ds = dh00(s)*y0 + dh10(s)*dy0*dt + dh01(s)*y1 + dh11(s)*dy1*dt

This is used in Newton’s method for root finding in Poincare section detection and refinement.

All units are in nondimensional units.