Previous Page Next Page Contents

norm -- compute the norm of a matrix, a vector, or a polynomial

Introduction

norm(M, kM) computes the norm of index kM of the matrix M.

norm(v, kv) computes the norm of index kv of the vector v.

norm(p, kp) computes the norm of index kp of the polynomial p.

Call(s)

norm(M <, kM>)
norm(v <, kv>)
norm(p <, kp>)
norm(f <, vars> <, kp>)

Parameters

M - a matrix of domain type Dom::Matrix(...)
kM - the index of the matrix norm: either 1, or Frobenius or Infinity. The default value is Infinity.
v - a vector (a 1-dimensional matrix)
kv - the index of the vector norm: either a positive integer, or Frobenius, or Infinity. The default value is Infinity.
p - a polynomial generated by poly
f - a polynomial expression
vars - a list of identifiers or indexed identifiers, interpreted as the indeterminates of f
kp - the index of the norm of the polynomial: a real number >= 1. If no index is specified, the maximum norm (of index infinity) is computed.

Returns

an arithmetical expression.

Overloadable:

p, f

Related Functions

coeff, float, matrix, poly

Details

Example 1

We compute various norms of a 2 x 3 matrix:

>> M := matrix([[2, 5, 8], [-2, 3, 5]]):
   norm(M) = norm(M, Infinity), norm(M, 1), norm(M, Frobenius)
                                            1/2
                            15 = 15, 13, 131

For matrices, norm produces exact symbolic results:

>> M := matrix([[2/3, 63, PI],[x, y, z]]): norm(M)
                 max(PI + 191/3, abs(x) + abs(y) + abs(z))
>> norm(M, 1)
                max(abs(x) + 2/3, abs(y) + 63, PI + abs(z))
>> norm(M, Frobenius)
                2         2         2         2           1/2
             (PI  + abs(x)  + abs(y)  + abs(z)  + 35725/9)
>> delete M:

Example 2

A column vector col and a row vector row are considered:

>> col := matrix([x1, PI]): row := matrix([[x1, PI]]): col, row
                           +-    -+
                           |  x1  |  +-      -+
                           |      |, | x1, PI |
                           |  PI  |  +-      -+
                           +-    -+
>> norm(col, 2) = norm(row, 2)
                               2 1/2                         2 1/2
         (x1 conjugate(x1) + PI )    = (x1 conjugate(x1) + PI )
>> norm(col, 3) = norm(row, 3)
                    3          3 1/3      3          3 1/3
                 (PI  + abs(x1) )    = (PI  + abs(x1) )

Note that the norms of index 1 and Infinity have exchanged meanings for column and row vectors:

>> norm(col, 1) = norm(row, Infinity)
                        PI + abs(x1) = PI + abs(x1)
>> norm(col, Infinity) = norm(row, 1)
                    max(abs(x1), PI) = max(abs(x1), PI)
>> delete col, row:

Example 3

The norms of some polynomials are computed:

>> p := poly(3*x^3 + 4*x, [x]): norm(p), norm(p, 1)
                                   4, 7

If the coefficients are not integers or rational numbers, automatic conversion to floating point numbers occurs:

>> p := poly(3*x^3 + sqrt(2)*x + PI, [x]): norm(p), norm(p, 1)
                         3.141592654, 7.555806216

Floating point numbers are always produced for indices > 1:

>> p := poly(3*x^3 + 4*x + 1, [x]): 
   norm(p, 1), norm(p, 2), norm(p, 5), norm(p, 10), norm(p)
                8, 5.099019514, 4.174686339, 4.021974513, 4
>> delete p:

Example 4

The norms of some polynomial expressions are computed:

>> norm(x^3 + 1, 1), norm(x^3 + 1, 2), norm(x^3 + PI)
                             2, 1.414213562, 1

The following call yields an error, because the expression is regarded as a polynomial in x. Consequently, symbolic coefficients 6*y and 9*y^2 are found which are not accepted:

>> f := 6*x*y + 9*y^2 + 2: norm(f, [x])
      Error: Illegal argument [norm]

As a bivariate polynomial with the indeterminates x and y, the coefficients are 6, 9, and 2. Now, norms can be computed:

>> norm(f, [x, y], 1), norm(f, [x, y], 2), norm(f, [x, y])
                                17, 11.0, 9
>> delete f:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000