Continuation Stepping Strategies

The stepping module provides concrete implementations of stepping strategies used in continuation algorithms.

Base Step Interface

_ContinuationStepBase()

Define the protocol for continuation stepping strategies.

class hiten.algorithms.continuation.stepping._ContinuationStepBase[source]

Bases: ABC

Define the protocol for continuation stepping strategies.

This protocol specifies the required interface for all stepping strategies used in continuation algorithms. Stepping strategies are responsible for predicting the next solution representation and potentially adapting the step size based on the current solution state.

__call__(last_solution, step)[source]

Predict next solution and adapt step size.

This method performs the core stepping operation: generating a prediction for the next solution in the continuation sequence and potentially adapting the step size based on local conditions.

Parameters:
  • last_solution (object) – Current solution object (e.g., periodic orbit, equilibrium) from which to predict the next solution.

  • step (ndarray) – Current step size(s) for continuation parameters. Shape should match the parameter dimension.

Returns:

  • prediction (ndarray) – Numerical representation of the predicted next solution. This will be passed to the continuation engine’s instantiation method to create a domain object for correction.

  • adapted_step (ndarray) – Potentially modified step size for the next continuation step. Should have the same shape as the input step array.

Return type:

tuple[ndarray, ndarray]

Plain Stepping

_ContinuationPlainStep()

Implement a simple stepping strategy using a provided predictor function.

class hiten.algorithms.continuation.stepping._ContinuationPlainStep(predictor)[source]

Bases: _ContinuationStepBase

Implement a simple stepping strategy using a provided predictor function.

The plain step strategy delegates prediction to a user-provided function and returns the step size unchanged, making it suitable for cases where step adaptation is handled elsewhere or not needed.

Parameters:

predictor (callable) – Function that generates solution predictions. Should take a solution object and step array, returning a numerical representation of the predicted next solution.

__call__(last_solution, step)[source]

Predict next solution using the provided predictor function.

Parameters:
  • last_solution (object) – Current solution object for prediction.

  • step (ndarray) – Current step size array.

Returns:

  • prediction (ndarray) – Result of the predictor function.

  • step (ndarray) – Unchanged step size (no adaptation).

Notes

This implementation simply delegates to the predictor function and returns the step size unchanged. No step adaptation or error handling is performed.

Natural Parameter Stepping

_NaturalParameterStep()

Implement a natural parameter stepping strategy with user-supplied predictor.

class hiten.algorithms.continuation.stepping._NaturalParameterStep(predictor)[source]

Bases: _ContinuationStepBase

Implement a natural parameter stepping strategy with user-supplied predictor.

This class implements a simple stepping strategy for natural parameter continuation. It delegates prediction to a user-supplied function and keeps the step size unchanged, making it suitable for straightforward continuation scenarios without complex step adaptation requirements.

All domain-specific logic (state component selection, amplitude manipulations, parameter scaling, etc.) is encapsulated in the predictor function, keeping the stepping strategy generic and reusable.

Parameters:

predictor (callable) – Function that generates solution predictions. Should have signature: predictor(solution: object, step: np.ndarray) -> np.ndarray Returns numerical representation of the predicted next solution.

Examples

>>> # Define prediction function
>>> def predict_orbit_state(orbit, step):
...     new_state = orbit.initial_state.copy()
...     new_state[2] += step[0]  # Increment z-component
...     return new_state
>>>
>>> # Create stepping strategy
>>> stepper = _NaturalParameterStep(predict_orbit_state)
>>>
>>> # Use in continuation algorithm
>>> prediction, new_step = stepper(current_orbit, np.array([0.01]))

See also

_SecantStep

More sophisticated stepping with tangent vector maintenance.

_ContinuationStepBase

Base class that this class implements.

__call__(last_solution, step)[source]

Generate prediction using the supplied predictor function.

Parameters:
  • last_solution (object) – Current solution object for prediction.

  • step (np.ndarray) – Current step size array.

Returns:

  • prediction (np.ndarray) – Result of the predictor function.

  • step (np.ndarray) – Unchanged step size (no adaptation).

Notes

This method simply delegates to the predictor function and returns the step size unchanged. No internal state is modified.

Secant Stepping

_SecantStep()

Stateless secant step using an external tangent provider.

class hiten.algorithms.continuation.stepping._SecantStep(representation_fn, tangent_provider)[source]

Bases: _ContinuationStepBase

Stateless secant step using an external tangent provider.

The backend owns history and tangent computation. This stepper simply uses the provided tangent to form a prediction and returns the step hint unchanged.

Parameters:
  • representation_fn (callable) – Maps a solution object to its numerical representation.

  • tangent_provider (callable) – Returns the current unit tangent vector in representation space. Should return np.ndarray with shape matching the representation.

__call__(last_solution, step)[source]

Generate prediction using the supplied representation function and tangent provider.

Parameters:

last_solution (object)

Return type:

tuple[ndarray, ndarray]

Factory Functions

make_natural_stepper()

Factory for a natural-parameter stepper.

hiten.algorithms.continuation.stepping.make_natural_stepper(predict_fn)[source]

Factory for a natural-parameter stepper.

Returns a callable implementing (last, step) -> (prediction, step_hint).

make_secant_stepper()

Factory for a secant stepper using an external tangent provider.

hiten.algorithms.continuation.stepping.make_secant_stepper(representation_fn, tangent_provider)[source]

Factory for a secant stepper using an external tangent provider.