ansys.mapdl.core.Mapdl.comp#

Mapdl.comp(matrix='', algorithm='', threshold='', val1='', val2='', **kwargs)#

Compresses a matrix using a specified algorithm.

Mechanical APDL Command: *COMP

Parameters:
matrixstr

Name of the matrix to compress.

algorithmstr

Algorithm or method to use:

  • SVD - Singular value decomposition algorithm (default).

  • MGS - Modified Gram-Schmidt algorithm.

  • SPARSE - Compress a sparse matrix based on the threshold value.

thresholdstr

Numerical threshold value used to manage the compression. The default value depends on the method of compression: 1E-7 for SVD; 1E-14 for MGS; 1E-16 for SPARSE.

val1str

Name of the vector used to store the equationnotavailable values (see a-COMP_notes below). This argument is optional.

val2str

Name of the dense matrix used to store the equationnotavailable output matrix (see a-COMP_notes below). This argument is optional.

Notes

Warning

This function contains specificities regarding the argument definitions. Please refer to the command documentation for further explanations.

Argument Descriptions

  • matrix : str - Name of the matrix to compress.

  • algorithm : str - Algorithm or method to use:

    • SVD - Singular value decomposition algorithm (default).

    • MGS - Modified Gram-Schmidt algorithm.

    • SPARSE - Compress a sparse matrix based on the threshold value.

  • threshold : str - Numerical threshold value used to manage the compression. The default value depends on the method of compression: 1E-7 for SVD; 1E-14 for MGS; 1E-16 for SPARSE.

Val1 and Val2 are additional input used only for the SVD algorithm:

  • val1 : str - Name of the vector used to store the equationnotavailable values (see a-COMP_notes below). This argument is optional.

  • val2 : str - Name of the dense matrix used to store the equationnotavailable output matrix (see a-COMP_notes below). This argument is optional.

The SVD and MGS algorithms are only applicable to dense matrices that were created using the dmat command. Columns that are linearly dependent on others are removed, leaving the independent or basis vectors. The matrix is resized according to the new size determined by the algorithm.

For the SVD algorithm, the singular value decomposition of an input matrix equationnotavailable is a factorization of the form:

equationnotavailable

Here, the equationnotavailable matrix is replaced by the equationnotavailable matrix, according to the specified threshold.

The SPARSE compression method is only applicable to sparse matrices that were created using the smat command. All terms that have an absolute value below the specified threshold, relative to the maximum value in the matrix, are removed from the original matrix. For example, given a sparse matrix having 100 as the largest term and THRESHOLD = 0.5, all terms having an absolute value below 0.5*100 = 50 are removed.