.Modelica.Math.Matrices

Information

Library content

This library provides functions operating on matrices. Below, the functions are ordered according to categories and a typical call of the respective function is shown. Most functions are solely an interface to the external LAPACK library.

Note: A' is a short hand notation of transpose(A):

Basic Information

Linear Equations

Matrix Factorizations

Matrix Properties

Matrix Exponentials

Matrix Equations

Matrix Manipulation

See also

Vectors

Contents

NameDescription
 ExamplesExamples demonstrating the usage of the Math.Matrices functions
 toStringConvert a matrix into its string representation
 isEqualCompare whether two Real matrices are identical
 solveSolve real system of linear equations A*x=b with a b vector (Gaussian elimination with partial pivoting)
 solve2Solve real system of linear equations A*X=B with a B matrix (Gaussian elimination with partial pivoting)
 leastSquaresSolve linear equation A*x = b (exactly if possible, or otherwise in a least square sense; A may be non-square and may be rank deficient)
 leastSquares2Solve linear equation A*X = B (exactly if possible, or otherwise in a least square sense; A may be non-square and may be rank deficient)
 equalityLeastSquaresSolve a linear equality constrained least squares problem
 LULU decomposition of square or rectangular matrix
 LU_solveSolve real system of linear equations P*L*U*x=b with a b vector and an LU decomposition (from LU(..))
 LU_solve2Solve real system of linear equations P*L*U*X=B with a B matrix and an LU decomposition (from LU(..))
 eigenValuesReturn eigenvalues and eigenvectors for a real, nonsymmetric matrix in a Real representation
 eigenValueMatrixReturn real valued block diagonal matrix J of eigenvalues of matrix A (A=V*J*Vinv)
 singularValuesReturn singular values and left and right singular vectors
 QRReturn the QR decomposition of a square matrix with optional column pivoting (A(:,p) = Q*R)
 hessenbergReturn upper Hessenberg form of a matrix
 realSchurReturn the real Schur form (rsf) S of a square matrix A, A=QZ*S*QZ'
 choleskyReturn the Cholesky factorization of a symmetric positive definite matrix
 balanceReturn a balanced form of matrix A to improve the condition of A
 balanceABCReturn a balanced form of a system [A,B;C,0] to improve its condition by a state transformation
 traceReturn the trace of matrix A, i.e., the sum of the diagonal elements
 detReturn determinant of a matrix (computed by LU decomposition; try to avoid det(..))
 invReturn inverse of a matrix (try to avoid inv(..))
 rankReturn rank of a rectangular matrix (computed with singular values)
 conditionNumberReturn the condition number norm(A)*norm(inv(A)) of a matrix A
 rcondReturn the reciprocal condition number of a matrix
 normReturn the p-norm of a matrix
 frobeniusNormReturn the Frobenius norm of a matrix
 nullSpaceReturn the orthonormal nullspace of a matrix
 expReturn the exponential of a matrix by adaptive Taylor series expansion with scaling and balancing
 integralExpReturn the exponential and the integral of the exponential of a matrix
 integralExpTReturn the exponential, the integral of the exponential, and time-weighted integral of the exponential of a matrix
 continuousLyapunovReturn solution X of the continuous-time Lyapunov equation X*A + A'*X = C
 continuousSylvesterReturn solution X of the continuous-time Sylvester equation A*X + X*B = C
 continuousRiccatiReturn solution X of the continuous-time algebraic Riccati equation A'*X + X*A - X*B*inv(R)*B'*X + Q = 0 (care)
 discreteLyapunovReturn solution X of the discrete-time Lyapunov equation A'*X*A + sgn*X = C
 discreteSylvesterReturn solution of the discrete-time Sylvester equation A*X*B + sgn*X = C
 discreteRiccatiReturn solution of discrete-time algebraic Riccati equation A'*X*A - X - A'*X*B*inv(R + B'*X*B)*B'*X*A + Q = 0 (dare)
 sortSort the rows or columns of a matrix in ascending or descending order
 flipLeftRightFlip the columns of a matrix in left/right direction
 flipUpDownFlip the rows of a matrix in up/down direction
 LAPACKInterface to LAPACK library (should usually not directly be used but only indirectly via Modelica.Math.Matrices)
 UtilitiesUtility functions that should not be directly utilized by the user

Generated at 2024-12-26T19:25:54Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos