pyHarm.Reductors.NLdofsReductor =============================== .. py:module:: pyHarm.Reductors.NLdofsReductor Classes ------- .. autoapisummary:: pyHarm.Reductors.NLdofsReductor.NLdofsReductor Module Contents --------------- .. py:class:: NLdofsReductor(data: dict, expl_dofs: pandas.DataFrame, *args) Bases: :py:obj:`pyHarm.Reductors.ABCReductor.ABCReductor` The nonlinear dofs reductor is a reductor aiming at reducing the system to the nonlinear dofs only while using a linear solver to obtain the solution for the linear dofs. The reduction method is inspired by the PhD of Colaitis but adapted to the closure equation included in pyHarm before the reduction layer. - Expansion solve the linear problem associated in order to return the solutions for the linear dofs based on the values of the nonlinear dofs - Jacobian matrix is completed with the contribution of linear dofs for the closure equation and the rest of the Jacobian by solving two linear problems Attributes : factory_keyword (str): name to use as input when willing to create an instance of this object. solve (Callable): solve from scipy.linalg module. lu_factor (Callable): lu_factor from scipy.linalg module. lu_solve (Callable): lu_solve from scipy.linalg module. .. py:attribute:: factory_keyword :type: str :value: 'NLdofs' 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__() A post init method to be customized if needed when building new class. .. py:method:: update_reductor(xpred, J_f, expl_dofs, system, *args) Updates the reducer for the new point. :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 :param expl_dofs: explicit dof DataFrame created by the ABCSystem studied. :type expl_dofs: pd.DataFrame :param system: System studied. :type system: ABCSystem .. attribute:: J_add Updated jacobian to add onto the non-linear dofs. :type: np.ndarray :returns: same displacement vector given as input after passing through the reductor np.ndarray: same jacobian matrix given as input after passing through the reductor pd.DataFrame: same explicit dof DataFrame after passing through the reductor :rtype: np.ndarray .. py:method:: expand(q: numpy.ndarray) -> numpy.ndarray Makes a linear solve onto the linear part of the residual and jacobian in order to give the necessary displacement on the linear dofs. :param q: vector of reduced displacement. :type q: np.ndarray :returns: vector of original displacement with the linear dof being exact solution. :rtype: np.ndarray .. py:method:: _extract_blocks(J, i, j) Extracts blocks of the jacobian matrix. :param J: vector of displacement. :type J: np.ndarray :param i: vector of index. :type i: np.ndarray :param j: vector of index. :type j: np.ndarray :returns: jacobian block restrained to the meshgrid of indexes i,i. np.ndarray: jacobian block restrained to the meshgrid of indexes i,j. np.ndarray: jacobian block restrained to the meshgrid of indexes j,i. :rtype: np.ndarray .. py:method:: reduce_vector(x: numpy.ndarray) -> numpy.ndarray Transforms the displacement vector. :param x: vector of displacement. :type x: np.ndarray :returns: vector of reduced displacement. :rtype: np.ndarray .. py:method:: reduce_matrix(dJdxom: numpy.ndarray, *args) -> numpy.ndarray From original jacobian, performs the transformation to get the reduced matrix while adding the linear influence. :param dJdxom: full size jacobian matrix with respect to displacement and angular frequency. :type dJdxom: np.ndarray :returns: reduced jacobian matrix with respect to displacement and angular frequency. :rtype: np.ndarray .. py:method:: _update_J_add(dJdxom) Updates the jacobian block to add corresponding to the linear influence. :param dJdxom: full size jacobian matrix with respect to displacement and angular frequency. :type dJdxom: np.ndarray :returns: jacobian to add corresponding to the linear influence. :rtype: np.ndarray .. py:method:: _get_AijAiim1(Aii, Aij) Obtains the linear solution to Aii.T,Aij.T and transposes the results. :param Aii: square matrix block of the jacobian. :type Aii: np.ndarray :param Aij: rectangle matrix block of the jacobian. :type Aij: np.ndarray :returns: linear solution to Aii.T,Aij.T and transpose the results. :rtype: np.ndarray .. py:method:: _get_AijAiim1LU(AiiTLU, Aij) Obtains the linear solution to Aii.T,Aij.T and transposes the results but uses the LU decomposition of Aii. :param AiiTLU: LU matrix decomposition of a square transpose block of the jacobian. :type AiiTLU: np.ndarray :param Aij: rectangle matrix block of the jacobian. :type Aij: np.ndarray :returns: linear solution to AiiTLU,Aij.T and transpose the results. :rtype: np.ndarray .. py:method:: _get_mshg(lines, columns) Obtains the meshgrid for getting the block of matrix. :param lines: indexes of lines. :type lines: np.ndarray :param columns: indexes of columns. :type columns: np.ndarray :returns: meshgrid of the block. :rtype: tuple[np.ndarray,np.ndarray] .. py:method:: _add_omega(J, Jom, Cn, Cw) Constructs a matrix by blocks. :param J: jacobian with respect to displacement. :type J: np.ndarray :param Jom: jacobian with respect to angular frequency. :type Jom: np.ndarray :param Cn: correction jacobian with respect to displacement. :type Cn: np.ndarray :param Cw: correction jacobian with respect to angular frequency. :type Cw: np.array :returns: matrix built with the provided blocks. :rtype: np.ndarray .. py:method:: _add_omega_vec(R) Extends a residual vector by adding a 0 at the end. :param R: residual vector. :type R: np.ndarray :param Cw: correction jacobian with respect to angular frequency. :type Cw: np.array :returns: residual vector augmented with a component of 0 at the end. :rtype: np.ndarray .. py:method:: _init_dofs(expl_dofs, system) Constructs the phi matrix that suppresses the linear dofs when applied. :param expl_dofs: explicit dof DataFrame created by the ABCSystem studied. :type expl_dofs: pd.DataFrame :param system: System studied. :type system: ABCSystem .. attribute:: init_dofs initialisation of the indexes of linear and non-linear dof done. :type: bool .. attribute:: phi_reduce transformation matrix that cuts the linear dofs. :type: np.ndarray .. py:method:: _get_output_expl_dofs() Obtains the modified explicit dof DataFrame after passing through the reducer. :returns: Modified explicit dof DataFrame after passing through the reducer. :rtype: np.ndarray