ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 19 Mar 2019 20:44:52 +0100Solve symbolic matrix cellhttps://ask.sagemath.org/question/45841/solve-symbolic-matrix-cell/I'm trying to take a cell from a matrix and solve for a variable symbolically. When I run this, I get the error:
TypeError: The first argument must be a symbolic expression or a list of symbolic expressions.
This is the code I am trying to execute:
var('a','b','c','x','y','z')
Rz = matrix([[cos(a),-sin(a),0,0],[sin(a),cos(a),0,0],[0,0,1,0],[0,0,0,1]])
Ry = matrix([[cos(b),0,sin(b),0],[0,1,0,0],[-sin(b),0,cos(b),0],[0,0,0,1]])
Rx = matrix([[1,0,0,0],[0,cos(c),-sin(c),0],[0,sin(c),cos(c),0],[0,0,0,1]])
P = matrix([[x],[y],[z],[1]])
Rzyxp = Rz * Ry * Rx * P
show(Rzyxp)
eqn2 = Rzyxp[2]
show(eqn2)
result1 = solve(eqn2==0, b)
show(result1)
Any help would be appreciatedMickey_PhippsTue, 19 Mar 2019 20:44:52 +0100https://ask.sagemath.org/question/45841/Characteristic polynomial wont be used in solvehttps://ask.sagemath.org/question/39746/characteristic-polynomial-wont-be-used-in-solve/ When I try to find roots in a characteristic polynomial it gives me errors:
sage: #Diagonalmatrix
....:
....:
....: A=matrix([[1,-1,2],
....: [-1,1,2],
....: [2,2,-2]])
....: var('x')
....: poly=A.characteristic_polynomial()
....: eq1=solve(poly==0,x)
....:
x
--------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-86-fee7a7de2ea1> in <module>()
7 var('x')
8 poly=A.characteristic_polynomial()
----> 9 eq1=solve(poly==Integer(0),x)
/usr/lib/python2.7/site-packages/sage/symbolic/relation.pyc in solve(f, *args, **kwds)
816
817 if not isinstance(f, (list, tuple)):
--> 818 raise TypeError("The first argument must be a symbolic expression or a list of symbolic expressions.")
819
820 if len(f)==1:
TypeError: The first argument must be a symbolic expression or a list of symbolic expressions.
sage:
What can I do in order to use the polynomial in an equation I wish to solve?PoetastropheThu, 23 Nov 2017 18:18:11 +0100https://ask.sagemath.org/question/39746/solve with many variableshttps://ask.sagemath.org/question/37574/solve-with-many-variables/hi
please i have a problem
i have a MATRIX contains many variables, and i want to find the eigenvalues of this matrix in function of this variables i let you my matrix here and my code
x,a,b,c,s1,s2,s3,s4,s5,s6=var('x a b c s1 s2 s3 s4 s5 s6')
k=matrix([[-3*a-b+c*s1,a,a,0,a,0],
[a,-2*a-b+c*s2,a,0,0,0],
[a,a,-4*a-b+c*s3,a,a,0],
[0,0,a,-2*a-b+c*s4,a,0],
[a,0,a,a,-4*a-b+c*s5,a],
[0,0,0,0,a,-a-b+c*s6]]
)
B=matrix(k- x*matrix.identity(6))
eq(a,b,c,s1,s2,s3,s4,s5,s6)=det(B)
solve(eq==0,x)
but i can get the solution but if i give to the variable c=0 or b=0 i get the solution so please can you help mesimo1993Thu, 11 May 2017 10:51:34 +0200https://ask.sagemath.org/question/37574/