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.Sun, 01 Nov 2015 04:16:09 +0100Error in computation of eigenvalues in Sagehttps://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/Dear all,
I am trying to compute the eigenvalues of the following matrix
J = matrix
([[-Q1,0,0,0,omega,0,0,0,0,-A1],[0,-Q2,0,0,0,omega,0,0,0,A1],[0,gamma,Q3,0,0,0,omega,0,0,0],[0,0,sigma,-Q1,0,0,0,omega,0,0],[A2,0,0,0,-Q4,0,0,0,0,0],[0,A2,0,0,0,-Q4,0,0,0,0],[0,0,A2,0,0,0,-Q4,0,0,0],[0,0,0,A2,0,0,0,-Q4,0,0],[0,0,-A3,0,0,0,0,0,-mu_v,0],[0,0,A3,0,0,0,0,0,0,-mu_v]])
J
J.eigenvalues()
Unfortunately am getting the following error.
*#0:
eigenvalues(mat=matrix([-_SAGE_VAR_Q1,0,0,0,_SAGE_VAR_omega,0,0,0,0,-_SA\
GE_VAR_A1],[0,-_SAGE_VAR_Q2,0,0,0,_SAGE_VAR_...)
Traceback (click to the left of this block for traceback)
...
TypeError: ECL says: Error executing code in Maxima: part: fell off the
end.*
When I try with numerical values however, I get eigenvalues. My problem
involves a matrix with characters and I want to know the nature of the
eigenvalues so that I may draw certain conclusions. What should I do in
order to compute my eigenvalues without an error. Thank you for support.
Mon, 10 Aug 2015 11:04:26 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/Comment by vdelecroix for <p>Dear all,</p>
<p>I am trying to compute the eigenvalues of the following matrix</p>
<pre><code>J = matrix
([[-Q1,0,0,0,omega,0,0,0,0,-A1],[0,-Q2,0,0,0,omega,0,0,0,A1],[0,gamma,Q3,0,0,0,omega,0,0,0],[0,0,sigma,-Q1,0,0,0,omega,0,0],[A2,0,0,0,-Q4,0,0,0,0,0],[0,A2,0,0,0,-Q4,0,0,0,0],[0,0,A2,0,0,0,-Q4,0,0,0],[0,0,0,A2,0,0,0,-Q4,0,0],[0,0,-A3,0,0,0,0,0,-mu_v,0],[0,0,A3,0,0,0,0,0,0,-mu_v]])
J
J.eigenvalues()
</code></pre>
<p>Unfortunately am getting the following error.</p>
<pre><code>*#0:
eigenvalues(mat=matrix([-_SAGE_VAR_Q1,0,0,0,_SAGE_VAR_omega,0,0,0,0,-_SA\
GE_VAR_A1],[0,-_SAGE_VAR_Q2,0,0,0,_SAGE_VAR_...)
Traceback (click to the left of this block for traceback)
...
TypeError: ECL says: Error executing code in Maxima: part: fell off the
end.*
</code></pre>
<p>When I try with numerical values however, I get eigenvalues. My problem
involves a matrix with characters and I want to know the nature of the
eigenvalues so that I may draw certain conclusions. What should I do in
order to compute my eigenvalues without an error. Thank you for support.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28804#post-id-28804What are `Q1`, `omega`, `A1`, etc...? If you do not give full information about your code we can surely not help you.Mon, 10 Aug 2015 13:57:22 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28804#post-id-28804Comment by komondie for <p>Dear all,</p>
<p>I am trying to compute the eigenvalues of the following matrix</p>
<pre><code>J = matrix
([[-Q1,0,0,0,omega,0,0,0,0,-A1],[0,-Q2,0,0,0,omega,0,0,0,A1],[0,gamma,Q3,0,0,0,omega,0,0,0],[0,0,sigma,-Q1,0,0,0,omega,0,0],[A2,0,0,0,-Q4,0,0,0,0,0],[0,A2,0,0,0,-Q4,0,0,0,0],[0,0,A2,0,0,0,-Q4,0,0,0],[0,0,0,A2,0,0,0,-Q4,0,0],[0,0,-A3,0,0,0,0,0,-mu_v,0],[0,0,A3,0,0,0,0,0,0,-mu_v]])
J
J.eigenvalues()
</code></pre>
<p>Unfortunately am getting the following error.</p>
<pre><code>*#0:
eigenvalues(mat=matrix([-_SAGE_VAR_Q1,0,0,0,_SAGE_VAR_omega,0,0,0,0,-_SA\
GE_VAR_A1],[0,-_SAGE_VAR_Q2,0,0,0,_SAGE_VAR_...)
Traceback (click to the left of this block for traceback)
...
TypeError: ECL says: Error executing code in Maxima: part: fell off the
end.*
</code></pre>
<p>When I try with numerical values however, I get eigenvalues. My problem
involves a matrix with characters and I want to know the nature of the
eigenvalues so that I may draw certain conclusions. What should I do in
order to compute my eigenvalues without an error. Thank you for support.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28805#post-id-28805Q1 to Q4, omega,sigma,A1 to A3 and mu_v are characters in the matrix and the rest of the columns are zeros. and they are declared as follows
var('sigma,omega,Q1,Q2,Q3,Q4,A1,A2,A3,mu_v')Mon, 10 Aug 2015 16:54:52 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28805#post-id-28805Comment by vdelecroix for <p>Dear all,</p>
<p>I am trying to compute the eigenvalues of the following matrix</p>
<pre><code>J = matrix
([[-Q1,0,0,0,omega,0,0,0,0,-A1],[0,-Q2,0,0,0,omega,0,0,0,A1],[0,gamma,Q3,0,0,0,omega,0,0,0],[0,0,sigma,-Q1,0,0,0,omega,0,0],[A2,0,0,0,-Q4,0,0,0,0,0],[0,A2,0,0,0,-Q4,0,0,0,0],[0,0,A2,0,0,0,-Q4,0,0,0],[0,0,0,A2,0,0,0,-Q4,0,0],[0,0,-A3,0,0,0,0,0,-mu_v,0],[0,0,A3,0,0,0,0,0,0,-mu_v]])
J
J.eigenvalues()
</code></pre>
<p>Unfortunately am getting the following error.</p>
<pre><code>*#0:
eigenvalues(mat=matrix([-_SAGE_VAR_Q1,0,0,0,_SAGE_VAR_omega,0,0,0,0,-_SA\
GE_VAR_A1],[0,-_SAGE_VAR_Q2,0,0,0,_SAGE_VAR_...)
Traceback (click to the left of this block for traceback)
...
TypeError: ECL says: Error executing code in Maxima: part: fell off the
end.*
</code></pre>
<p>When I try with numerical values however, I get eigenvalues. My problem
involves a matrix with characters and I want to know the nature of the
eigenvalues so that I may draw certain conclusions. What should I do in
order to compute my eigenvalues without an error. Thank you for support.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28807#post-id-28807you forgot gamma ;-)Mon, 10 Aug 2015 18:05:43 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28807#post-id-28807Comment by komondie for <p>Dear all,</p>
<p>I am trying to compute the eigenvalues of the following matrix</p>
<pre><code>J = matrix
([[-Q1,0,0,0,omega,0,0,0,0,-A1],[0,-Q2,0,0,0,omega,0,0,0,A1],[0,gamma,Q3,0,0,0,omega,0,0,0],[0,0,sigma,-Q1,0,0,0,omega,0,0],[A2,0,0,0,-Q4,0,0,0,0,0],[0,A2,0,0,0,-Q4,0,0,0,0],[0,0,A2,0,0,0,-Q4,0,0,0],[0,0,0,A2,0,0,0,-Q4,0,0],[0,0,-A3,0,0,0,0,0,-mu_v,0],[0,0,A3,0,0,0,0,0,0,-mu_v]])
J
J.eigenvalues()
</code></pre>
<p>Unfortunately am getting the following error.</p>
<pre><code>*#0:
eigenvalues(mat=matrix([-_SAGE_VAR_Q1,0,0,0,_SAGE_VAR_omega,0,0,0,0,-_SA\
GE_VAR_A1],[0,-_SAGE_VAR_Q2,0,0,0,_SAGE_VAR_...)
Traceback (click to the left of this block for traceback)
...
TypeError: ECL says: Error executing code in Maxima: part: fell off the
end.*
</code></pre>
<p>When I try with numerical values however, I get eigenvalues. My problem
involves a matrix with characters and I want to know the nature of the
eigenvalues so that I may draw certain conclusions. What should I do in
order to compute my eigenvalues without an error. Thank you for support.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28810#post-id-28810Am sorry..omega is in the variable,,,,I forgot. I am sorry for the typo error.Mon, 10 Aug 2015 18:57:24 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28810#post-id-28810Answer by vdelecroix for <p>Dear all,</p>
<p>I am trying to compute the eigenvalues of the following matrix</p>
<pre><code>J = matrix
([[-Q1,0,0,0,omega,0,0,0,0,-A1],[0,-Q2,0,0,0,omega,0,0,0,A1],[0,gamma,Q3,0,0,0,omega,0,0,0],[0,0,sigma,-Q1,0,0,0,omega,0,0],[A2,0,0,0,-Q4,0,0,0,0,0],[0,A2,0,0,0,-Q4,0,0,0,0],[0,0,A2,0,0,0,-Q4,0,0,0],[0,0,0,A2,0,0,0,-Q4,0,0],[0,0,-A3,0,0,0,0,0,-mu_v,0],[0,0,A3,0,0,0,0,0,0,-mu_v]])
J
J.eigenvalues()
</code></pre>
<p>Unfortunately am getting the following error.</p>
<pre><code>*#0:
eigenvalues(mat=matrix([-_SAGE_VAR_Q1,0,0,0,_SAGE_VAR_omega,0,0,0,0,-_SA\
GE_VAR_A1],[0,-_SAGE_VAR_Q2,0,0,0,_SAGE_VAR_...)
Traceback (click to the left of this block for traceback)
...
TypeError: ECL says: Error executing code in Maxima: part: fell off the
end.*
</code></pre>
<p>When I try with numerical values however, I get eigenvalues. My problem
involves a matrix with characters and I want to know the nature of the
eigenvalues so that I may draw certain conclusions. What should I do in
order to compute my eigenvalues without an error. Thank you for support.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?answer=28808#post-id-28808Hello,
It seems that Sage is not able to solve your equation symbolically. However, you can compute the characteristic polynomial and try to analyze it
R = ZZ['x,sigma,gamma,omega,Q1,Q2,Q3,Q4,A1,A2,A3,mu_v']
R.inject_variables()
J = matrix(R,[[-Q1,0,0,0,omega,0,0,0,0,-A1],
[0,-Q2,0,0,0,omega,0,0,0,A1],
[0,gamma,Q3,0,0,0,omega,0,0,0],
[0,0,sigma,-Q1,0,0,0,omega,0,0],
[A2,0,0,0,-Q4,0,0,0,0,0],
[0,A2,0,0,0,-Q4,0,0,0,0],
[0,0,A2,0,0,0,-Q4,0,0,0],
[0,0,0,A2,0,0,0,-Q4,0,0],
[0,0,-A3,0,0,0,0,0,-mu_v,0],
[0,0,A3,0,0,0,0,0,0,-mu_v]])
p = J.charpoly().subs(R('x'))
p.factor()
As you can notice I did not use symbolic variables but polynomial variables that are more powerful (and more predictable). In particular, the factorization with **p.factor()** takes place in Z[x,sigma,gamma,Q1,...]`.
The answer of the above code shows two small factors
x + mu_v
(-x^2 - x*Q1 - x*Q4 - Q1*Q4 + omega*A2)^2
and a big factor of degree 5. The small factors give you already three eigenvalues (five if counted with multiplicity). The big factor is quite complicated and I doubt there would be any formula.
VincentMon, 10 Aug 2015 18:16:29 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?answer=28808#post-id-28808Comment by komondie for <p>Hello,</p>
<p>It seems that Sage is not able to solve your equation symbolically. However, you can compute the characteristic polynomial and try to analyze it</p>
<pre><code>R = ZZ['x,sigma,gamma,omega,Q1,Q2,Q3,Q4,A1,A2,A3,mu_v']
R.inject_variables()
J = matrix(R,[[-Q1,0,0,0,omega,0,0,0,0,-A1],
[0,-Q2,0,0,0,omega,0,0,0,A1],
[0,gamma,Q3,0,0,0,omega,0,0,0],
[0,0,sigma,-Q1,0,0,0,omega,0,0],
[A2,0,0,0,-Q4,0,0,0,0,0],
[0,A2,0,0,0,-Q4,0,0,0,0],
[0,0,A2,0,0,0,-Q4,0,0,0],
[0,0,0,A2,0,0,0,-Q4,0,0],
[0,0,-A3,0,0,0,0,0,-mu_v,0],
[0,0,A3,0,0,0,0,0,0,-mu_v]])
p = J.charpoly().subs(R('x'))
p.factor()
</code></pre>
<p>As you can notice I did not use symbolic variables but polynomial variables that are more powerful (and more predictable). In particular, the factorization with <strong>p.factor()</strong> takes place in Z[x,sigma,gamma,Q1,...]`.</p>
<p>The answer of the above code shows two small factors</p>
<pre><code>x + mu_v
(-x^2 - x*Q1 - x*Q4 - Q1*Q4 + omega*A2)^2
</code></pre>
<p>and a big factor of degree 5. The small factors give you already three eigenvalues (five if counted with multiplicity). The big factor is quite complicated and I doubt there would be any formula.</p>
<p>Vincent</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28816#post-id-28816Thank you so much. This one is working except for the p.factor and is giving the following error
p.factor()
Traceback (click to the left of this block for traceback)
...
NotImplementedError: Factorization of multivariate polynomials over
non-fields is not implemented.
How do I correct the error please. Thank youTue, 11 Aug 2015 12:13:02 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28816#post-id-28816Comment by FrédéricC for <p>Hello,</p>
<p>It seems that Sage is not able to solve your equation symbolically. However, you can compute the characteristic polynomial and try to analyze it</p>
<pre><code>R = ZZ['x,sigma,gamma,omega,Q1,Q2,Q3,Q4,A1,A2,A3,mu_v']
R.inject_variables()
J = matrix(R,[[-Q1,0,0,0,omega,0,0,0,0,-A1],
[0,-Q2,0,0,0,omega,0,0,0,A1],
[0,gamma,Q3,0,0,0,omega,0,0,0],
[0,0,sigma,-Q1,0,0,0,omega,0,0],
[A2,0,0,0,-Q4,0,0,0,0,0],
[0,A2,0,0,0,-Q4,0,0,0,0],
[0,0,A2,0,0,0,-Q4,0,0,0],
[0,0,0,A2,0,0,0,-Q4,0,0],
[0,0,-A3,0,0,0,0,0,-mu_v,0],
[0,0,A3,0,0,0,0,0,0,-mu_v]])
p = J.charpoly().subs(R('x'))
p.factor()
</code></pre>
<p>As you can notice I did not use symbolic variables but polynomial variables that are more powerful (and more predictable). In particular, the factorization with <strong>p.factor()</strong> takes place in Z[x,sigma,gamma,Q1,...]`.</p>
<p>The answer of the above code shows two small factors</p>
<pre><code>x + mu_v
(-x^2 - x*Q1 - x*Q4 - Q1*Q4 + omega*A2)^2
</code></pre>
<p>and a big factor of degree 5. The small factors give you already three eigenvalues (five if counted with multiplicity). The big factor is quite complicated and I doubt there would be any formula.</p>
<p>Vincent</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28819#post-id-28819replace ZZ by QQ in R = ZZ['x,sigma,gamma,omega,Q1,Q2,Q3,Q4,A1,A2,A3,mu_v'] to be able to factor polynomials in several variableTue, 11 Aug 2015 18:50:38 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28819#post-id-28819Answer by nbruin for <p>Dear all,</p>
<p>I am trying to compute the eigenvalues of the following matrix</p>
<pre><code>J = matrix
([[-Q1,0,0,0,omega,0,0,0,0,-A1],[0,-Q2,0,0,0,omega,0,0,0,A1],[0,gamma,Q3,0,0,0,omega,0,0,0],[0,0,sigma,-Q1,0,0,0,omega,0,0],[A2,0,0,0,-Q4,0,0,0,0,0],[0,A2,0,0,0,-Q4,0,0,0,0],[0,0,A2,0,0,0,-Q4,0,0,0],[0,0,0,A2,0,0,0,-Q4,0,0],[0,0,-A3,0,0,0,0,0,-mu_v,0],[0,0,A3,0,0,0,0,0,0,-mu_v]])
J
J.eigenvalues()
</code></pre>
<p>Unfortunately am getting the following error.</p>
<pre><code>*#0:
eigenvalues(mat=matrix([-_SAGE_VAR_Q1,0,0,0,_SAGE_VAR_omega,0,0,0,0,-_SA\
GE_VAR_A1],[0,-_SAGE_VAR_Q2,0,0,0,_SAGE_VAR_...)
Traceback (click to the left of this block for traceback)
...
TypeError: ECL says: Error executing code in Maxima: part: fell off the
end.*
</code></pre>
<p>When I try with numerical values however, I get eigenvalues. My problem
involves a matrix with characters and I want to know the nature of the
eigenvalues so that I may draw certain conclusions. What should I do in
order to compute my eigenvalues without an error. Thank you for support.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?answer=28809#post-id-28809This seems to be a bug in maxima, which should be reported. A little googling shows this error has happened before but not with a very clear input matrix. This script in maxima leads straight to a (hopefully debuggable) error:
M: matrix([-d, 0, 0, 0, v, 0, 0, 0, 0, -a], [0, -e, 0, 0, 0, v, 0, 0, 0, a], [0, w, f, 0, 0, 0, v, 0, 0, 0], [0, 0, t, -d, 0, 0, 0, v, 0, 0], [b, 0, 0, 0, -g, 0, 0, 0, 0, 0], [0, b, 0, 0, 0, -g, 0, 0, 0, 0], [0, 0, b, 0, 0, 0, -g, 0, 0, 0], [0, 0, 0, b, 0, 0, 0, -g, 0, 0], [0, 0, -c, 0, 0, 0, 0, 0, -u, 0], [0, 0, c, 0, 0, 0, 0, 0, 0, -u]);
eigenvalues(M);
As a workaround, you can use:
sage: maxima_calculus(M.charpoly()).factor()
which shows you that the characteristic polynomial is of the form linear*quadratic^2*quintic
sage: M.charpoly().roots()
[(-1/2*Q1 - 1/2*Q4 - 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-1/2*Q1 - 1/2*Q4 + 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-mu_v, 1)]
gives you 3 eigenvalues. The eigenvalue corresponding to the quintic factor is not reported here, likely because maxima (which is used for this if I'm not mistaken) doesn't have access to the means to express that eigenvalue properly.
Mon, 10 Aug 2015 18:26:47 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?answer=28809#post-id-28809Comment by vdelecroix for <p>This seems to be a bug in maxima, which should be reported. A little googling shows this error has happened before but not with a very clear input matrix. This script in maxima leads straight to a (hopefully debuggable) error:</p>
<pre><code>M: matrix([-d, 0, 0, 0, v, 0, 0, 0, 0, -a], [0, -e, 0, 0, 0, v, 0, 0, 0, a], [0, w, f, 0, 0, 0, v, 0, 0, 0], [0, 0, t, -d, 0, 0, 0, v, 0, 0], [b, 0, 0, 0, -g, 0, 0, 0, 0, 0], [0, b, 0, 0, 0, -g, 0, 0, 0, 0], [0, 0, b, 0, 0, 0, -g, 0, 0, 0], [0, 0, 0, b, 0, 0, 0, -g, 0, 0], [0, 0, -c, 0, 0, 0, 0, 0, -u, 0], [0, 0, c, 0, 0, 0, 0, 0, 0, -u]);
eigenvalues(M);
</code></pre>
<p>As a workaround, you can use:</p>
<pre><code>sage: maxima_calculus(M.charpoly()).factor()
</code></pre>
<p>which shows you that the characteristic polynomial is of the form linear<em>quadratic^2</em>quintic</p>
<pre><code>sage: M.charpoly().roots()
[(-1/2*Q1 - 1/2*Q4 - 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-1/2*Q1 - 1/2*Q4 + 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-mu_v, 1)]
</code></pre>
<p>gives you 3 eigenvalues. The eigenvalue corresponding to the quintic factor is not reported here, likely because maxima (which is used for this if I'm not mistaken) doesn't have access to the means to express that eigenvalue properly.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28811#post-id-28811@nbruin did you report the error?Mon, 10 Aug 2015 19:48:45 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28811#post-id-28811Comment by nbruin for <p>This seems to be a bug in maxima, which should be reported. A little googling shows this error has happened before but not with a very clear input matrix. This script in maxima leads straight to a (hopefully debuggable) error:</p>
<pre><code>M: matrix([-d, 0, 0, 0, v, 0, 0, 0, 0, -a], [0, -e, 0, 0, 0, v, 0, 0, 0, a], [0, w, f, 0, 0, 0, v, 0, 0, 0], [0, 0, t, -d, 0, 0, 0, v, 0, 0], [b, 0, 0, 0, -g, 0, 0, 0, 0, 0], [0, b, 0, 0, 0, -g, 0, 0, 0, 0], [0, 0, b, 0, 0, 0, -g, 0, 0, 0], [0, 0, 0, b, 0, 0, 0, -g, 0, 0], [0, 0, -c, 0, 0, 0, 0, 0, -u, 0], [0, 0, c, 0, 0, 0, 0, 0, 0, -u]);
eigenvalues(M);
</code></pre>
<p>As a workaround, you can use:</p>
<pre><code>sage: maxima_calculus(M.charpoly()).factor()
</code></pre>
<p>which shows you that the characteristic polynomial is of the form linear<em>quadratic^2</em>quintic</p>
<pre><code>sage: M.charpoly().roots()
[(-1/2*Q1 - 1/2*Q4 - 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-1/2*Q1 - 1/2*Q4 + 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-mu_v, 1)]
</code></pre>
<p>gives you 3 eigenvalues. The eigenvalue corresponding to the quintic factor is not reported here, likely because maxima (which is used for this if I'm not mistaken) doesn't have access to the means to express that eigenvalue properly.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28812#post-id-28812I think the bug was already found and reported with an earlier example: [https://sourceforge.net/p/maxima/bugs/2183/]Mon, 10 Aug 2015 21:16:42 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28812#post-id-28812Comment by komondie for <p>This seems to be a bug in maxima, which should be reported. A little googling shows this error has happened before but not with a very clear input matrix. This script in maxima leads straight to a (hopefully debuggable) error:</p>
<pre><code>M: matrix([-d, 0, 0, 0, v, 0, 0, 0, 0, -a], [0, -e, 0, 0, 0, v, 0, 0, 0, a], [0, w, f, 0, 0, 0, v, 0, 0, 0], [0, 0, t, -d, 0, 0, 0, v, 0, 0], [b, 0, 0, 0, -g, 0, 0, 0, 0, 0], [0, b, 0, 0, 0, -g, 0, 0, 0, 0], [0, 0, b, 0, 0, 0, -g, 0, 0, 0], [0, 0, 0, b, 0, 0, 0, -g, 0, 0], [0, 0, -c, 0, 0, 0, 0, 0, -u, 0], [0, 0, c, 0, 0, 0, 0, 0, 0, -u]);
eigenvalues(M);
</code></pre>
<p>As a workaround, you can use:</p>
<pre><code>sage: maxima_calculus(M.charpoly()).factor()
</code></pre>
<p>which shows you that the characteristic polynomial is of the form linear<em>quadratic^2</em>quintic</p>
<pre><code>sage: M.charpoly().roots()
[(-1/2*Q1 - 1/2*Q4 - 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-1/2*Q1 - 1/2*Q4 + 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-mu_v, 1)]
</code></pre>
<p>gives you 3 eigenvalues. The eigenvalue corresponding to the quintic factor is not reported here, likely because maxima (which is used for this if I'm not mistaken) doesn't have access to the means to express that eigenvalue properly.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28815#post-id-28815I did report the error but unfortunately I have not received any response.Tue, 11 Aug 2015 12:05:38 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28815#post-id-28815Comment by nbruin for <p>This seems to be a bug in maxima, which should be reported. A little googling shows this error has happened before but not with a very clear input matrix. This script in maxima leads straight to a (hopefully debuggable) error:</p>
<pre><code>M: matrix([-d, 0, 0, 0, v, 0, 0, 0, 0, -a], [0, -e, 0, 0, 0, v, 0, 0, 0, a], [0, w, f, 0, 0, 0, v, 0, 0, 0], [0, 0, t, -d, 0, 0, 0, v, 0, 0], [b, 0, 0, 0, -g, 0, 0, 0, 0, 0], [0, b, 0, 0, 0, -g, 0, 0, 0, 0], [0, 0, b, 0, 0, 0, -g, 0, 0, 0], [0, 0, 0, b, 0, 0, 0, -g, 0, 0], [0, 0, -c, 0, 0, 0, 0, 0, -u, 0], [0, 0, c, 0, 0, 0, 0, 0, 0, -u]);
eigenvalues(M);
</code></pre>
<p>As a workaround, you can use:</p>
<pre><code>sage: maxima_calculus(M.charpoly()).factor()
</code></pre>
<p>which shows you that the characteristic polynomial is of the form linear<em>quadratic^2</em>quintic</p>
<pre><code>sage: M.charpoly().roots()
[(-1/2*Q1 - 1/2*Q4 - 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-1/2*Q1 - 1/2*Q4 + 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-mu_v, 1)]
</code></pre>
<p>gives you 3 eigenvalues. The eigenvalue corresponding to the quintic factor is not reported here, likely because maxima (which is used for this if I'm not mistaken) doesn't have access to the means to express that eigenvalue properly.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28820#post-id-28820See the bug report. Apparently this issue has been resolved in the current maxima version. Once we upgrade maxima in sage we should be OK (of course, you will still not get all eigenvalues symbolically because maxima's representation for such expressions wouldn't allow a convenient expression for a root of a rather arbitrary degree 5 polynomial)Tue, 11 Aug 2015 19:29:56 +0200https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=28820#post-id-28820Comment by gunterkoenigsmann for <p>This seems to be a bug in maxima, which should be reported. A little googling shows this error has happened before but not with a very clear input matrix. This script in maxima leads straight to a (hopefully debuggable) error:</p>
<pre><code>M: matrix([-d, 0, 0, 0, v, 0, 0, 0, 0, -a], [0, -e, 0, 0, 0, v, 0, 0, 0, a], [0, w, f, 0, 0, 0, v, 0, 0, 0], [0, 0, t, -d, 0, 0, 0, v, 0, 0], [b, 0, 0, 0, -g, 0, 0, 0, 0, 0], [0, b, 0, 0, 0, -g, 0, 0, 0, 0], [0, 0, b, 0, 0, 0, -g, 0, 0, 0], [0, 0, 0, b, 0, 0, 0, -g, 0, 0], [0, 0, -c, 0, 0, 0, 0, 0, -u, 0], [0, 0, c, 0, 0, 0, 0, 0, 0, -u]);
eigenvalues(M);
</code></pre>
<p>As a workaround, you can use:</p>
<pre><code>sage: maxima_calculus(M.charpoly()).factor()
</code></pre>
<p>which shows you that the characteristic polynomial is of the form linear<em>quadratic^2</em>quintic</p>
<pre><code>sage: M.charpoly().roots()
[(-1/2*Q1 - 1/2*Q4 - 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-1/2*Q1 - 1/2*Q4 + 1/2*sqrt(Q1^2 - 2*Q1*Q4 + Q4^2 + 4*A2*omega), 2),
(-mu_v, 1)]
</code></pre>
<p>gives you 3 eigenvalues. The eigenvalue corresponding to the quintic factor is not reported here, likely because maxima (which is used for this if I'm not mistaken) doesn't have access to the means to express that eigenvalue properly.</p>
https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=30383#post-id-30383Did verify with the current version of maxima.
The result is:
"eigenvalues: solve is unable to find some of the roots of the characteristic polynomial."
[[-(sqrt(4*A2*omega+Q4^2-2*Q1*Q4+Q1^2)+Q4+Q1)/2,(sqrt(4*A2*omega+Q4^2-2*Q1*Q4+Q1^2)-Q4-Q1)/2,-mu_v],[2,2,1]]Sun, 01 Nov 2015 04:16:09 +0100https://ask.sagemath.org/question/28802/error-in-computation-of-eigenvalues-in-sage/?comment=30383#post-id-30383