functionequalityLeastSquares
Solve a linear equality constrained least squares problem
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
x = Matrices.equalityLeastSquares(A,a,B,b);
Description
This function returns the solution x of the linear equality-constrained least squares problem:
min|A*x - a|^2 over x, subject to B*x = b
It is required that the dimensions of A and B fulfill the following relationship:
size(B,1) ≤ size(A,2) ≤ size(A,1) + size(B,1)
Note, the solution is computed with the LAPACK function "dgglse" using the generalized RQ factorization under the assumptions that B has full row rank (= size(B,1)) and the matrix [A;B] has full column rank (= size(A,2)). In this case, the problem has a unique solution.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,:] | A | Minimize |A*x - a|^2 | |
| Real[size(A, 1)] | a | ||
| Real[:,size(A, 2)] | B | Subject to B*x=b | |
| Real[size(B, 1)] | b |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[size(A, 2)] | x | Solution vector |