Hi!
I'm trying to get a matrix over SR to be callable, much like vectors
are. My code consists of the following:
"
(theta,beta,gamma)=var('theta,beta,gamma')
R_theta=matrix(SR,[[cos(theta),sin(theta),0],[-sin(theta),cos(theta),
0],[0,0,1]])
R_beta=matrix(SR,3,3,[cos(beta),0,-sin(beta),0,1,0,sin(beta),
0,cos(beta)])
"
Defining the matrices with a place for the variables yields an error
with mutiplication:
"
R_theta(theta)=matrix(SR,[[cos(theta),sin(theta),0],[-
sin(theta),cos(theta),0],[0,0,1]])
R_beta(beta)=matrix(SR,3,3,[cos(beta),0,-sin(beta),0,1,0,sin(beta),
0,cos(beta)])
R_theta*T_beta
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_89.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding:
utf-8 -*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("Ul90aGV0YSpSX2JldGE="),globals())
+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/private/var/folders/bM/bMOEaVgXE3CHfi1Ua6Udb++++TI/-Tmp-/
tmpNfeDiM/___code___.py", line 2, in <module>
exec compile(u'R_theta*R_beta
File "", line 1, in <module>
File "element.pyx", line 1459, in
sage.structure.element.RingElement.__mul__ (sage/structure/element.c:
12096)
File "coerce.pyx", line 714, in
sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/
coerce.c:6436)
File "element.pyx", line 1454, in
sage.structure.element.RingElement.__mul__ (sage/structure/element.c:
12005)
File "expression.pyx", line 2216, in
sage.symbolic.expression.Expression._mul_ (sage/symbolic/
expression.cpp:11504)
ArithmeticError: Number_T::hash() python function (__hash__) raised
exception
"
In either case, I can't get sage to substitue the variable in the
matrix. (I can define the variables before defining the matrix, but
that is redundant) Any ideas?
Thanks a lot!
Thanks a lot!
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org