Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

reduce_trig for matrices

I am trying to reduce the trig functions of the following symbolic matrix: [ sin(1/2B)cos(1/2B) Isin(1/2B)^2 - 1/2I] [-Isin(1/2B)^2 + 1/2I -sin(1/2B)cos(1/2B)]

I expect: [1/2sin(B), -1/2Icos(B)] [1/2Icos(B), -1/2sin(B)]

But get: Traceback (click to the left of this block for traceback) ... AttributeError: 'sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense' object has no attribute 'reduce_trig'

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_170.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -- coding: utf-8 --\n" + _support_.preparse_worksheet_cell(base64.b64decode("KFJ4KEIpKkl5KlJ4KC1CKSkucmVkdWNlX3RyaWcoKQ=="),globals())+"\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in <module>

File "/tmp/tmpTc7DZX/___code___.py", line 2, in <module> exec compile(u'(Rx(B)IyRx(-B)).reduce_trig() File "", line 1, in <module>

File "element.pyx", line 306, in sage.structure.element.Element.__getattr__ (sage/structure/element.c:2666) File "parent.pyx", line 272, in sage.structure.parent.getattr_from_other_class (sage/structure/parent.c:2840)

What am I doing wrong?

Thank you for your help.

click to hide/show revision 2
No.2 Revision

reduce_trig for matrices

I am trying to reduce the trig functions of the following symbolic matrix: matrix:

[  sin(1/2B)cos(1/2B) sin(1/2*B)*cos(1/2*B)  Isin(1/2B)^2 I*sin(1/2*B)^2 - 1/2I]
[-Isin(1/2B)^2 1/2*I]
[-I*sin(1/2*B)^2 + 1/2I 1/2*I  -sin(1/2B)cos(1/2B)]

-sin(1/2*B)*cos(1/2*B)]

I expect: [1/2sin(B), -1/2Icos(B)] [1/2Icos(B), -1/2sin(B)]expect:

[1/2*sin(B), -1/2*I*cos(B)]
[1/2*I*cos(B), -1/2*sin(B)]

But get: Traceback (click to the left of this block for traceback) ... AttributeError: 'sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense' object has no attribute 'reduce_trig'

Traceback (most recent call last): last):

  File "<stdin>", line 1, in <module>
  File "_sage_input_170.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -- -*- coding: utf-8 --\n" -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("KFJ4KEIpKkl5KlJ4KC1CKSkucmVkdWNlX3RyaWcoKQ=="),globals())+"\n"); _support_.preparse_worksheet_cell(base64.b64decode("KFJ4KEIpKkl5KlJ4KC1CKSkucmVkdWNlX3RyaWcoKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

<module>

File "/tmp/tmpTc7DZX/___code___.py", line 2, in <module> exec compile(u'(Rx(B)IyRx(-B)).reduce_trig() compile(u'(Rx(B)*Iy*Rx(-B)).reduce_trig() File "", line 1, in <module>

<module>

File "element.pyx", line 306, in sage.structure.element.Element.__getattr__ (sage/structure/element.c:2666) File "parent.pyx", line 272, in sage.structure.parent.getattr_from_other_class (sage/structure/parent.c:2840)

(sage/structure/parent.c:2840)

What am I doing wrong?

Thank you for your help.

click to hide/show revision 3
retagged

reduce_trig for matrices

I am trying to reduce the trig functions of the following symbolic matrix:

[  sin(1/2*B)*cos(1/2*B)  I*sin(1/2*B)^2 - 1/2*I]
[-I*sin(1/2*B)^2 + 1/2*I  -sin(1/2*B)*cos(1/2*B)]

I expect:

[1/2*sin(B), -1/2*I*cos(B)]
[1/2*I*cos(B), -1/2*sin(B)]

But get: Traceback (click to the left of this block for traceback) ... AttributeError: 'sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense' object has no attribute 'reduce_trig'

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>
  File "_sage_input_170.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("KFJ4KEIpKkl5KlJ4KC1CKSkucmVkdWNlX3RyaWcoKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/tmp/tmpTc7DZX/___code___.py", line 2, in <module>
    exec compile(u'(Rx(B)*Iy*Rx(-B)).reduce_trig()
  File "", line 1, in <module>

  File "element.pyx", line 306, in sage.structure.element.Element.__getattr__ (sage/structure/element.c:2666)
  File "parent.pyx", line 272, in sage.structure.parent.getattr_from_other_class (sage/structure/parent.c:2840)

What am I doing wrong?

Thank you for your help.