pyHarm.Predictors.ABCPredictor

Classes

ABCPredictor

Abstract class for the predictor: Any added predictor shall be constructed from this class.

Module Contents

class pyHarm.Predictors.ABCPredictor.ABCPredictor(sign_ds, logger: logging.Logger | None = None, **kwargs)

Bases: abc.ABC

Abstract class for the predictor: Any added predictor shall be constructed from this class.

Parameters:

sign_ds (float) – if -1 predict in the direction of decreasing angular frequency, if 1 the opposite direction

flag_print

information are printed during the analysis if True.

Type:

bool

predictor_options

dictionary containing the kwargs and competed using the default options if the keywords are missing.

Type:

dict

property factory_keyword: str
Abstractmethod:

Returns: str: keyword that is used to call the creation of this class in the system factory.

default_options

set of default parameters for the system class if not given in the input argument.

It contains a normalisation parameter using the keyword ‘norm’ that can be set to either ‘norm1’ (default) if the direction is normed to 1 or ‘om’ if the direction is normed to 1 only for the angular frequency. It contains a bifurcation detection using the ‘bifurcation_detect’ keyword that can be set to True (default) if detection is needed. It contains a ‘verbose’ keyword that can be set to True (default) if information about detection of bifurcations is to be displayed during solving.

Type:

dict

logger
sign_ds_init
sign_ds
predictor_options
flag_print
abstractmethod predict(sollist: list[pyHarm.Solver.SystemSolution], ds: float) tuple[numpy.ndarray, pyHarm.Solver.SystemSolution, float]

Predicts the next strating point.

Parameters:
  • sollist (list[SystemSolution]) – list of SystemSolution already solved during the analysis.

  • ds (float) – step size for the prediction.

bifurcation_detect(lstpt: pyHarm.Solver.SystemSolution)

Makes a bifurcation detection analysis computing determinant of jacobian matrix and analysing change of sign.

Parameters:

lstpt (SystemSolution) – previously accepted point in direct link with the actual solved point.

sign_ds

Attribute is modified if a turning point is detected.

Type:

float

getPointerToSolution(sollist: list[pyHarm.Solver.SystemSolution], k_imposed=None) pyHarm.Solver.SystemSolution

Gets the last accepted solution in direct link with the studied point.

Parameters:
  • sollist (list[SystemSolution]) – list of SystemSolution already solved during the analysis.

  • k_imposed (None|int) – if not None then the provided index is used as the last accepted point.

Returns:

last accepted point.

Return type:

SystemSolution

norm_dir(dir: float) float

Normalises the direction according to the choice of norm given in the class attributes.

Parameters:

dir (np.ndarray) – prediction direction.

Returns:

normalized prediction direction.

Return type:

np.ndarray