Next Page Contents

student::equateMatrix -- build a matrix equation

Introduction

student::equateMatrix(A, vars) returns the matrix equation

A[1..r,1..c-1] * vars = A[1..r,c..c]


Call(s)

student::equateMatrix(A, vars)

Parameters

A - matrix (of category Cat::Matrix) over a Cat::Field
vars - list of indeterminates

Returns

an expression of the domain type DOM_EXPR and of type "equal".

Related Functions

linalg::expr2Matrix, matrix

Details

Example 1

Let us construct the equation A*X=b. First we construct A and b:

>> Ab := matrix( [[1,2,3],[-1,3,0]] )
                              +-          -+
                              |   1, 2, 3  |
                              |            |
                              |  -1, 3, 0  |
                              +-          -+

Here we have A = [[1,2],[-1,3]] and  b = [3,0]. Now we construct the equation A*X=b:

>> student::equateMatrix( Ab,[x1,x2] )
                        +-             -+   +-   -+
                        |   x1 + 2 x2   |   |  3  |
                        |               | = |     |
                        |  - x1 + 3 x2  |   |  0  |
                        +-             -+   +-   -+

Example 2

We should be carefull to use the right dimension of the matrix and the indeterminates:

>> Ab := matrix( [[1,2,3],[-1,3,0]] )
                              +-          -+
                              |   1, 2, 3  |
                              |            |
                              |  -1, 3, 0  |
                              +-          -+
>> student::equateMatrix( Ab,[x1,x2,x3] )
      Error: dimension of matrix and number of vars don't match [stu\
      dent::equateMatrix]

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000