pyHarm.Reductors.KrackPreconditioner

Classes

KrackPreconditioner

This Reductor is a preconditioner that does not reduce the system size but preconditions the system to make it easier to solve for the solvers.

Module Contents

class pyHarm.Reductors.KrackPreconditioner.KrackPreconditioner(data: dict, expl_dofs: pandas.DataFrame, *args)

Bases: pyHarm.Reductors.ABCReductor.ABCReductor

This Reductor is a preconditioner that does not reduce the system size but preconditions the system to make it easier to solve for the solvers.

This reductor is based on the preconditioning proposal made in Krack et al. book named :
  • Harmonic Balance for Nonlinear Vibration Problems

It uses displacement vector and tries to normalise the values to 1. as long as the values remains under a certain threshold.

Attributes :

data (dict): input dictionary + default parameters when not provided as input cut_off (float): value of the displacement where the scaling to 1e0 displacement is no more made to avoid numerical errors.

factory_keyword: str = 'KrackPreconditioner'

keyword that is used to call the creation of this class in the factory.

Type:

str

default

dictionary containing default parameters.

Type:

dict

__post_init__(*args)

A post init method to be customized if needed when building new class.

update_reductor(xpred, J_f, *args)

Computes a preconditionning scaling matrix based on the QR decomposition of the jacobian.

Parameters:
  • xpred (np.ndarray) – point predicted as the new starting point for the next iteration of the analysis process.

  • J_f (np.ndarray) – full jacobian with respect to displacement and angular frequency (contains the correction equation residual).

Returns:

modified displacement vector given as input after passing through the reductor np.ndarray: modified jacobian matrix given as input after passing through the reductor pd.DataFrame: modified explicit dof DataFrame after passing through the reductor

Return type:

np.ndarray

expand(q: numpy.ndarray) numpy.ndarray

Unscales the displacement vector.

Parameters:

q (np.ndarray) – vector of scaled displacement.

Returns:

vector of unscaled displacement.

Return type:

np.ndarray

reduce_vector_x(x: numpy.ndarray) numpy.ndarray

Scales the displacement vector.

Parameters:

x (np.ndarray) – vector of displacement.

Returns:

scaled vector of displacement.

Return type:

np.ndarray

reduce_vector(R: numpy.ndarray) numpy.ndarray

Applies the scaling matrix to the residual vector.

Parameters:

R (np.ndarray) – residual vector.

Returns:

preconditioned residual vector.

Return type:

np.ndarray

reduce_matrix(dJdxom: numpy.ndarray, *args) numpy.ndarray

From original matrix, performs the transformation to get the preconditioned matrix.

Parameters:

dJdxom (np.ndarray) – full size jacobian matrix with respect to displacement and angular frequency.

Returns:

preconditioned jacobian matrix with respect to displacement and angular frequency.

Return type:

np.ndarray

_get_output_expl_dofs()

Returns the explicit dof list after transformation by the reducer.

Returns:

reduced explicit dof DataFrame after passing through the reducer.

Return type:

pd.DataFrame