PyCoBi.utility
Module that contains utility functions for results extraction from parameter continuation objects.
- pycobi.utility.fractal_dimension(lyapunov_exponents: list) float [source]
Calculates the fractal or information dimension of an attractor of a dynamical system from its lyapunov epxonents, according to the Kaplan-Yorke formula (Kaplan and Yorke, 1979).
- Parameters:
lyapunov_exponents – List containing the lyapunov spectrum of a solution of a dynamical system.
- Returns:
Fractal dimension of the attractor of the system.
- Return type:
float
- pycobi.utility.get_branch_info(branch: Any) tuple [source]
Extract the relevant data from a solution branch object.
- Parameters:
branch – Solution branch as returned by auto.
- Returns:
Branch data, continuation parameter.
- Return type:
tuple
- pycobi.utility.get_lyapunov_exponents(eigenvals, period) list [source]
Calculate Lyapunov exponents from eigenvalues/floquet multipliers.
- Parameters:
eigenvals – Eigenvalue or floquet multiplier spectrum.
period – Period of the periodic solution, if eigenvals is a Floquet multiplier spectrum of a periodic solution.
- Returns:
Local Lyapunov exponent spectrum.
- Return type:
list
- pycobi.utility.get_point_idx(diag: list, point: int) int [source]
Extract list idx of correct diagnostics string for continuation point with index point.
- Parameters:
diag – Diagnostics as stored by auto on solution objects.
point – Index of the solution of interest on the branch.
- Returns:
Point index for diag.
- Return type:
int
- pycobi.utility.get_solution_eigenvalues(solution: Any, branch: int, point: int) list [source]
Extracts eigenvalue spectrum from a solution point on a branch of solutions.
- Parameters:
solution – Solution object as returned by auto.
branch – Branch ID as assigned by auto.
point – Index of the solution on the branch.
- Returns:
List of eigenvalues. If solution is periodic, the list contains floquet multipliers instead of eigenvalues.
- Return type:
list
- pycobi.utility.get_solution_keys(branch: Any) List[str] [source]
Extract the names of all solutions on a branch.
- Parameters:
branch – Solution branch object as returned by auto.
- Returns:
List with solution names.
- Return type:
List[str]
- pycobi.utility.get_solution_params(solution: Any, params: list) list [source]
Extract parameter values from a solution object.
- Parameters:
solution – Solution object as returned by auto.
params – Keys of the parameters to be extracted.
- Returns:
List of parameter values.
- Return type:
list
- pycobi.utility.get_solution_stability(branch: Any, solution: Any, point: int) bool [source]
Return stability of a solution.
- Parameters:
branch – Solution branch object as returned by auto.
solution – Solution object on the branch.
point – Index of the solution on the branch.
- Returns:
True, if the solution is stable.
- Return type:
bool
- pycobi.utility.get_solution_variables(solution: Any, variables: list, extract_time: bool = False) list [source]
Extract state variable values (time series) from a steady-state (periodic) solution object.
- Parameters:
solution – Solution object as returned by auto.
variables – Keys of the state variables to be extracted.
extract_time – If true, attempt to extract a time vector as well.
- Returns:
List of variable values/time series of the provided solution.
- Return type:
list