Ask Your Question

Aditya's profile - activity

2017-09-18 20:57:45 +0200 received badge  Famous Question (source)
2016-06-01 20:16:07 +0200 received badge  Notable Question (source)
2015-12-29 17:31:04 +0200 received badge  Popular Question (source)
2015-10-07 15:37:46 +0200 received badge  Student (source)
2015-10-05 01:02:02 +0200 commented answer How do I plot the magnitude of a complex-valued function?

Thanks for the reply! You're right, I don't want v to be complex, but I thought that might force the eigenvalues to be interpreted as complex, or something. What I need is - how the magnitude of the eigenvalue behaves w.r.t. v, irrespective of whether the eigenvalue is real or complex.

2015-10-04 20:41:41 +0200 received badge  Editor (source)
2015-10-04 20:41:07 +0200 asked a question How do I plot the magnitude of a complex-valued function?

My script is like this

v = var('v')

assume(v,'complex')

G = matrix([[0,1,0,0],[-v,1-v,0,0],[0,-v,1-v,0],[0,0,1,0]])

eigs = G.eigenvalues()

f1(v) = abs(eigs[0])

plot(f1,(-1,7))

The first eigenvalue is complex in a certain region and real elsewhere. But it does not plot those portions of the plot where the eigenvalue becomes complex. What gives?

My plot is broken where the eigenvalue is complex, with the error:

verbose 0 (2717: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 140 points. verbose 0 (2717: plot.py, generate_plot_points) Last error message: 'math domain error'

What I want to do is observe the behavior of the magnitude of the eigenvalue with respect to v, irrespective of whether the eigenvalue is real or complex.

If I try G = matrix(CC, [[0,1,0,0],[-v,1-v,0,0],[0,-v,1-v,0],[0,0,1,0]]) , I get an error.