package
LinearAlgebra
Dimension-generic numerical linear algebra for estimation and control
Choose an operation
Dimension-generic functions accept arrays whose extents follow their inputs. Use matrix products and solves instead of forming explicit inverses.
| Task | Function |
|---|---|
| General square system | solve |
| Positive-definite system | solveSPD |
| Covariance correction | josephUpdate |
| Covariance coordinate change | transformCovariance |
| Factor from noise-factor columns | covarianceRoot |
Example
With Real solution[2,1] and Boolean accepted, this
algorithm fragment solves two diagonal equations:
(solution, accepted) := LinearAlgebra.solveSPD([2,0;0,4], [2;8]);
The accepted result is {1,2} as a column. Always check the returned acceptance flag before using a solve. Positive semidefinite and positive definite are separate contracts; a rank-deficient covariance is not an invertible system. Numerical acceptance depends on the precision executing the generated code.
Members
| Name | Kind | Description |
|---|---|---|
| symmetrize | function | Average a square matrix with its transpose |
| quadraticForm | function | Dimension-generic quadratic form x' P x |
| quadraticFormDerivative | function | Time derivative of x' P x for supplied x_dot and P_dot |
| contractionResidual | function | Matrix residual M_dot + A' M + M A + 2 rate M for contraction certificates |
| solve | function | Dimension-generic dense linear solve with partial pivoting |
| solveSPD | function | Solve A*X=B for symmetric positive-definite A using Cholesky |
| josephUpdate | function | Dimension-generic Joseph-form covariance correction |
| transformCovariance | function | Covariance under a linear map |
| covarianceRoot | function | Lower triangular covariance root from factor columns |
| factorPSD | function | Lower factor of a positive semidefinite covariance |
| solveLower | function | Forward substitution through a lower triangular factor |
| solveCovarianceRoot | function | Solve L*L'*X=B without forming L*L' |
| SPD6Solve | model |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
package LinearAlgebra
"Dimension-generic numerical linear algebra for estimation and control"
annotation(Documentation(info = "<html>
<h4>Choose an operation</h4>
<p>Dimension-generic functions accept arrays whose extents follow their inputs.
Use matrix products and solves instead of forming explicit inverses.</p>
<table>
<tr><th>Task</th><th>Function</th></tr>
<tr><td>General square system</td><td><a href=\"modelica://LinearAlgebra.solve\">solve</a></td></tr>
<tr><td>Positive-definite system</td><td><a href=\"modelica://LinearAlgebra.solveSPD\">solveSPD</a></td></tr>
<tr><td>Covariance correction</td><td><a href=\"modelica://LinearAlgebra.josephUpdate\">josephUpdate</a></td></tr>
<tr><td>Covariance coordinate change</td><td><a href=\"modelica://LinearAlgebra.transformCovariance\">transformCovariance</a></td></tr>
<tr><td>Factor from noise-factor columns</td><td><a href=\"modelica://LinearAlgebra.covarianceRoot\">covarianceRoot</a></td></tr>
</table>
<h4>Example</h4>
<p>With <code>Real solution[2,1]</code> and <code>Boolean accepted</code>, this
algorithm fragment solves two diagonal equations:</p>
<pre>(solution, accepted) := LinearAlgebra.solveSPD([2,0;0,4], [2;8]);</pre>
<p>The accepted result is {1,2} as a column. Always check the returned acceptance
flag before using a solve. Positive semidefinite and positive definite are
separate contracts; a rank-deficient covariance is not an invertible system.
Numerical acceptance depends on the precision executing the generated code.</p>
</html>"));
end LinearAlgebra;