1

How could I apply the transpose operator after it has returned the nominal expression?

I'm working with some symbolic matrix equations, and I have to deal with the transpose, after that I need to substitute some matrices with real values, the symbolic matrices are symbols declared as nonscalar like this:

declare(A,nonscalar);
declare(B,nonscalar);
declare(a,scalar);
equation:transpose(A*a).B=0
subst([A=transpose(matrix([1,2,3])),B=transpose(matrix([3,2,1]))],equation)

the result is:

(transpose(matrix([1],[2],[3])) . matrix([3],[2],[1]))*a=0

but I'm expecting something like

10*a=0
daaan
  • 47
  • 5

1 Answers1

1

Try ev(%, nouns) after the subst. Also take a look at the various flags which modify . expressions, in particular dotscrules. I think ?? dot and ?? mx will find most or all of those flags.

Robert Dodier
  • 16,905
  • 2
  • 31
  • 48
  • ev(%,nouns) is not working with the transpose, i've checked the flags and I didn't find anything about the transpose – daaan Oct 28 '19 at 17:10
  • Well, what I am seeing is that `equation:transpose(A*a).B=0` creates a noun expression; I can see that via `:lisp $%`, what do you see if you try that? After you get `(transpose(matrix([1],[2],[3])) . matrix([3],[2],[1]))*a=0`, what do you see if you enter `:lisp $%` after that? I am working with the Maxima console interface; it is possible that wxMaxima has set some flags to different values. I suggested the `dot` and `mx` flags is that I was thinking the presence of the scalar `a` was playing a role. PS. The noun form of `transpose` is `%TRANSPOSE` in Lisp output as opposed to `$TRANSPOSE`. – Robert Dodier Oct 28 '19 at 22:54
  • with `equation:transpose(A*a).B=0` I see `((MEQUAL SIMP) ((MTIMES SIMP) $A ((MNCTIMES SIMP) ((%TRANSPOSE SIMP) $a) $b)) 0)` then with `subst([A=transpose(matrix([1,2,3])),B=transpose(matrix([3,2,1]))],equation)` I see `((MEQUAL SIMP) ((MTIMES SIMP) ((MNCTIMES SIMP) ((%TRANSPOSE SIMP) (($MATRIX SIMP) ((MLIST SIMP) 1) ((MLIST SIMP) 2) ((MLIST SIMP) 3))) (($MATRIX SIMP) ((MLIST SIMP) 3) ((MLIST SIMP) 2) ((MLIST SIMP) 1))) $A) 0)` – daaan Oct 31 '19 at 04:59
  • 1
    OK, well, I see `%TRANSPOSE` operators in those expressions. I would expect `ev(, nouns)` to cause the transpose to be applied to its literal matrix operand. – Robert Dodier Oct 31 '19 at 19:30
  • I run ev(,nouns) and failed, but ev(%,nouns) worked nice, thank you – daaan Nov 21 '19 at 23:21