use dot for multiplication of vectors and matrices - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Error Message Guide : use dot for multiplication of vectors and matrices

Error, (in rtable/Product) use *~ for elementwise multiplication of Vectors or Matrices; use . (dot) for Vector/Matrix multiplication

 

Description

Examples

See Also

Description

An expression involving the multiplication of Vectors and/or Matrices (possibly and/or Arrays) has been constructed using the standard multiplication operator, `⋅`, which is ambiguous.

Examples

 This will happen if Vectors and/or Matrices are multiplied using a commutative multiplication operator, `⋅`:

A  a__11a__12a__21a__22

A:=a__11a__12a__21a__22

(2.1)

v  v__1v__2

v:=v__1v__2

(2.2)

Av

Error, (in rtable/Product) use *~ for elementwise multiplication of Vectors or Matrices; use . (dot) for Vector/Matrix multiplication

W  Array1..2,1..2,a,b,c,d;

W:=abcd

(2.3)

A W

Error, (in rtable/Product) use *~ for elementwise multiplication of Vectors or Matrices; use . (dot) for Vector/Matrix multiplication

 

Solution:

To multiply Vectors and/or Matrices together using the standard Linear Algebra multiplication operation, use the non-commutative multiplication operator, `.` (dot):

A . A

a__112+a__12a__21a__11a__12+a__12a__22a__11a__21+a__21a__22a__12a__21+a__222

(2.4)

A . v

a__11,a__11v__1,v__1+a__12,a__12v__2,v__2a__21,a__21v__1,v__1+a__22,a__22v__2,v__2

(2.5)

v . v

v__1,v__1&conjugate0;v__1,v__1+v__2,v__2&conjugate0;v__2,v__2

(2.6)

To multiply Vectors and/or Matrices and/or Arrays together using elementwise multiplication, use the standard multiplication operator, `⋅` followed by the "elementwise" operator, `~`:

A ~ A

a__112a__122a__212a__222

(2.7)

A ~ W

a__11aa__12ba__21ca__22d

(2.8)

Note that when multiplying Arrays together (not with Vectors or Matrices), the standard multiplication operator will result in the elementwise product, so the `~` is not necessary:

W . W

a2b2c2d2

(2.9)

Note also that implicit multiplication is interpreted based on the operands: For Vector/Matrix operands this will be interpreted as the `.` (dot - non-commutative) multiplication operator, while for Array operands this will be interpreted as the elementwise operator:

A v

a__11v__1+a__12v__2a__21v__1+a__22v__2

(2.10)

W W

a2b2c2d2

(2.11)

 

See Also

  Array, binary operators, dot, LinearAlgebra, Matrix, Vector