WOLFRAM SYSTEM MODELER

# equalityLeastSquares

Solve a linear equality constrained least squares problem # Wolfram Language

In:= `SystemModel["Modelica.Math.Matrices.equalityLeastSquares"]`
Out:= # Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

#### 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.

# Syntax

x = equalityLeastSquares(A, a, B, b)

# Inputs (4)

A Type: Real[:,:] Description: Minimize |A*x - a|^2 Type: Real[size(A, 1)] Type: Real[:,size(A, 2)] Description: subject to B*x=b Type: Real[size(B, 1)]

# Outputs (1)

x Type: Real[size(A, 2)] Description: solution vector