pyHarm.Reductors.KrackPreconditioner ==================================== .. py:module:: pyHarm.Reductors.KrackPreconditioner Classes ------- .. autoapisummary:: pyHarm.Reductors.KrackPreconditioner.KrackPreconditioner Module Contents --------------- .. py:class:: KrackPreconditioner(data: dict, expl_dofs: pandas.DataFrame, *args) Bases: :py:obj:`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. .. py:attribute:: factory_keyword :type: str :value: 'KrackPreconditioner' keyword that is used to call the creation of this class in the factory. :type: str .. py:attribute:: default dictionary containing default parameters. :type: dict .. py:method:: __post_init__(*args) A post init method to be customized if needed when building new class. .. py:method:: update_reductor(xpred, J_f, *args) Computes a preconditionning scaling matrix based on the QR decomposition of the jacobian. :param xpred: point predicted as the new starting point for the next iteration of the analysis process. :type xpred: np.ndarray :param J_f: full jacobian with respect to displacement and angular frequency (contains the correction equation residual). :type J_f: np.ndarray :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 :rtype: np.ndarray .. py:method:: expand(q: numpy.ndarray) -> numpy.ndarray Unscales the displacement vector. :param q: vector of scaled displacement. :type q: np.ndarray :returns: vector of unscaled displacement. :rtype: np.ndarray .. py:method:: reduce_vector_x(x: numpy.ndarray) -> numpy.ndarray Scales the displacement vector. :param x: vector of displacement. :type x: np.ndarray :returns: scaled vector of displacement. :rtype: np.ndarray .. py:method:: reduce_vector(R: numpy.ndarray) -> numpy.ndarray Applies the scaling matrix to the residual vector. :param R: residual vector. :type R: np.ndarray :returns: preconditioned residual vector. :rtype: np.ndarray .. py:method:: reduce_matrix(dJdxom: numpy.ndarray, *args) -> numpy.ndarray From original matrix, performs the transformation to get the preconditioned matrix. :param dJdxom: full size jacobian matrix with respect to displacement and angular frequency. :type dJdxom: np.ndarray :returns: preconditioned jacobian matrix with respect to displacement and angular frequency. :rtype: np.ndarray .. py:method:: _get_output_expl_dofs() Returns the explicit dof list after transformation by the reducer. :returns: reduced explicit dof DataFrame after passing through the reducer. :rtype: pd.DataFrame