Recent changes to 372: scalar/matrix addition inconsistenthttp://sourceforge.net/p/maxima/bugs/372/2003-08-01T22:16:17Zscalar/matrix addition inconsistent2003-08-01T22:16:17Z2003-08-01T22:16:17ZStavros Macrakishttp://sourceforge.net/u/macrakis/http://sourceforge.nete9e9d73b6cc3ee47b7fa55f5cd9a0fcd27ccfe9fI claim that componentwise addition of scalars to
matrices is wrong.
By default, doallmxops=true.
Define m:matrix\(\[a,b\],\[c,d\]\).
Calculate ratsimp\(m.m^^-1+m\). This yields matrix
\(\[a+1,b\],\[c,d+1\]\). Good.
Now calculate subst\(m,n,n.n^^-1+n\). This yields matrix
\(\[a+1,b+1\],\[c+1,d+1\]\). I believe this is wrong.
Note that this happens even when dotident is not equal
to 1. Only if dotexptsimp=false \(which is a pretty radical
restriction\) does the subst case match the non-subst
case.
As far as I can tell, the only sensible thing for
scalar+matrix to mean is scalar\*identitymatrix + matrix.
I do not believe that componentwise addition of scalar
to matrix is ever useful; if it is, you can always write it
as scalar\*allonesmatrix + matrix.
Note that scalar/matrix \*multiplication\* is a completely
different matter -- componentwise is perfectly
meaningful and useful there.
Maxima 5.9.0