Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arbitrary size matrices in maxima

I want to do some calculations with matrices of arbitrary size. Simple example - take two matrices NxM and MxK, with arbitrary elements, and see element of product as sum.

But i cant find a way to do such symbolic calculations without specifying matrix size as integer.

matrix() want integer, makelist() want integer.

Is there a way to do things like this in maxima? Or any CAS?

like image 693
Mikhail Cheshkov Avatar asked Nov 12 '22 05:11

Mikhail Cheshkov


1 Answers

Unfortunately, Maxima does not know about arbitrary-size matrices, and I don't see an easy way to implement it.

The only way that I see is to define a new kind of expression, and provide simplification rules for operations on them. E.g. (and this is just a sketch of a possible solution): use defstruct to define a structure comprising size and a formula for a typical element, and define a simplification rule for "." (noncommutative multiplication) which creates a new expression with a typical element which is a summation.

like image 94
Robert Dodier Avatar answered Dec 23 '22 14:12

Robert Dodier