.Modelica_LinearSystems2.Math.Matrices.nullspace

Information

Syntax

           Z = Matrices.nullspace(A);
(Z, nullity) = Matrices.nullspace(A);

Description

This function calculates an orthonormal basis Z=[z_1, z_2, ...] of the nullspace of a matrix A, i.e. A*z_i=0. The nullspace is obtained by svd method. That is, matrix A is decomposed into the matrices S, U, V:

A = USVT

with the orthonormal matrices U and V and the matrix S with

S = [S1, 0] S1 = [diag(s); 0]

with the singular values s={s1, s2, ..., sr} of A and r=rank(A). Note, that S has the same size as A. Since U and V are orthonormal, we may write

UT*A*V = [S1, 0].

Matrix S1 obviously has full column rank and therefore, the left n-r rows (n is the number of columns of A or S) of matrix V span a nullspace of A.

The nullity of matrix A is the dimension of the nullspace of A. In view of the above, it becomes clear that nullity holds

nullity = n - r

with

n = number of columns of matrix A and
r = rank(A).

Example

  A = [1, 2,  3, 1;
       3, 4,  5, 2;
      -1, 2, -3, 3];
  (Z, nullity) = nullspace(A);

  results in:

  Z=[0.1715;
    -0.686;
     0.1715;
     0.686]

  nullity = 1

See also

Matrices.singularValues

Interface

function nullspace
  extends Modelica.Icons.Function;
  input Real A[:, :] "Input matrix";
  output Real Z[size(A, 2), :] "Orthonormal nullspace of matrix A";
  output Integer nullity "Nullity, i.e. the dimension of the nullspace";
end nullspace;

Revisions

Date Author Comment
2010-05-31 Marcus Baur, DLR-RM Realization

Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos