0

I'm trying to set up a list of rules which includes the following:

rules={
X-> {Xx,Xy,Xz},
Y-> {Yx,Yy,Yz},
Z-> {Zx,Zy,Zz},
El-> {Elx,Ely,Elz},
A-> {X,Y,Z},
T-> Cross[E,X],
Tp-> A.Transpose[{T}]
}

However, I get a problem running this because it says T cannot be transposed. T needs to be a column vector for A to operate on it properly, so I do need to transpose it. Outside of the list of rules , if I take Transpose[{{a.b.c}}] then I do indeed get a column vector which a matrix can act on. What am I doing wrong? Any help very much appreciated.

Dan Goldwater
  • 360
  • 1
  • 2
  • 8
  • 1
    Mathematica demands that E is Euler's constant and I doubt you want to find the cross product between that and X. Use upper case names at your own risk. Next. All those rules are going to be evaluated. That means the right hand side is going to be repeatedly processed until it stops changing. That means if T doesn't have the value of a matrix then the evaluation of Transpose[{T}] is going to throw an error. If you only want the evaluation of the right hand side to be done when the rule is applied then you MIGHT try Tp:>A.Transpose[{T}] which will delay the evaluation until rules is applied. – Bill Dec 15 '15 at 18:22
  • 2
    Your mistake is, as Bill rightfully says, your use of the symbol E. Another conceptual mistake you make in your text is your assumption that you would need column vectors. This is not true. While this may be the case in languages such as MATlab this is not so in Mathematica. For an explanation, see for instance this answer. – Sjoerd C. de Vries Dec 15 '15 at 18:42

0 Answers0