Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The problem is this:

sage: getnumerical(phi)
TypeError: unable to simplify to float approximation

Since you are giving this expression as a parameter, you get this error before the integration code ever comes into play. You need to delay the actual evaluation of the numerical integral code until you're actually passing it numerical data. You've already done the required work. This works:

sage: parametric_plot((getnumerical, b*sin(phi)*tan(cut)), (phi, 2*pi, 4*pi), aspect_ratio = 1)

and perhaps not to confuse yourself perhaps this is better written as

The interface for parametric_plot gets confusing because on one hand it requires a symbolic variable specification in its range specification, but the coordinates of the point specification does not need to be symbolic, and in your case is hard to express. What should have worked but doesn't is:

sage: I=integral(func(theta),0,phi,hold=True)
sage: parametric_plot((I, b*sin(phi)*tan(cut)), (phi, 2*pi, 4*pi), aspect_ratio = 1)

The problem is this:

sage: getnumerical(phi)
TypeError: unable to simplify to float approximation

Since you are giving this expression as a parameter, you get this error before the integration code ever comes into play. You need to delay the actual evaluation of the numerical integral code until you're actually passing it numerical data. You've already done the required work. This works:

sage: parametric_plot((getnumerical, b*sin(phi)*tan(cut)), (phi, 2*pi, 4*pi), aspect_ratio = 1)

and perhaps not to confuse yourself perhaps this is better written as

The interface for parametric_plot gets confusing because on one hand it requires a symbolic variable specification in its range specification, but the coordinates of the point specification does not need to be symbolic, and in your case is hard to express. What should have worked but doesn't is:

sage: I=integral(func(theta),0,phi,hold=True)
sage: parametric_plot((I, b*sin(phi)*tan(cut)), (phi, 2*pi, 4*pi), aspect_ratio = 1)