Groups
Groups
Sign in
Groups
Groups
sympy
Conversations
About
Send feedback
Help
Use of Eq
39 views
Skip to first unread message
amsympy
unread,
Oct 28, 2017, 1:20:34 PM
10/28/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Hi
I write the following code to display a matrix named P equal to A.T*A.
---------------------------------------------
from sympy import *
a, b, c, d = symbols('a, b, c, d')
P = Symbol('P')
A = Matrix( [ [a, b], [c, d] ])
M = A.T*A
Eq(P, M)
----------------------------------------------
but sympy display
False instead the expected result.
Thanks
Aaron Meurer
unread,
Oct 28, 2017, 4:48:28 PM
10/28/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
You need for P to be a MatrixSymbol, like
P = MatrixSymbol('P', 2, 2)
A regular Symbol object is assumed to be a scalar, which is why SymPy
states it cannot be equal to a matrix.
Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sympy+un...@googlegroups.com
.
> To post to this group, send email to
sy...@googlegroups.com
.
> Visit this group at
https://groups.google.com/group/sympy
.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/sympy/fb2087d0-b4fb-42f9-ba8f-433fe4876d0e%40googlegroups.com
.
> For more options, visit
https://groups.google.com/d/optout
.
amsympy
unread,
Oct 28, 2017, 7:43:46 PM
10/28/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Fine
Thanks
Reply all
Reply to author
Forward
0 new messages