Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 9 years ago

Aditya gravatar image

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?

click to hide/show revision 2
No.2 Revision

How do I plot the magnitude of a complex-valued function?

My script is like this

v = var('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?

click to hide/show revision 3
No.3 Revision

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?

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.

click to hide/show revision 4
No.4 Revision

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 looks like this: alt text

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.

click to hide/show revision 5
No.5 Revision

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 looks like this: alt textis 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'

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.

click to hide/show revision 6
No.6 Revision

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'

alt text

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.

click to hide/show revision 7
No.7 Revision

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'

alt text

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.

click to hide/show revision 8
No.8 Revision

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.