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:
- 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
str
Name of the vector used to store the
values (see a-COMP_notes below). This argument is optional.- val2
str
Name of the dense matrix used to store the
output matrix (see a-COMP_notes below). This argument is optional.
- matrix
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
andVal2
are additional input used only for the SVD algorithm:val1 : str
- Name of the vector used to store the values (see a-COMP_notes below). This argument is optional.val2 : str
- Name of the dense matrix used to store the 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
is a factorization of the form:Here, the
matrix is replaced by the 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.