var('t1,t2,u,w,k')
T = 1
m = 100
E = 1
v = 0
y=1
O = 1
integral(integral(integral(
integral(integral(
e^(-t1^2/T^2)*e^(-t2^2/T^2)*e^(I*O*t1)*
e^(-I*O*t2)*e^(-I*E*y^2*(1 - v)*t1^2/2)*
e^(-I*E*y^2*(1 - v)*t2^2/2)*e^(-I*k*y*(1 - u)*t1)*
e^(I*k*y*(1 - v)*t2)*
e^((1 + I)*(sqrt(E)*y*w*t1 + w*k/sqrt(E)))*
e^((1 - I)*(sqrt(E)*y*u*t2 + u*k/sqrt(E)))*
e^(-w^2/2)*e^(-u^2/2)*w^(-1/2 + I*m^2/(2*E))*
u^(-1/2 - I*m^2/(2*E)), (u, 0, Infinity)), (w, 0,
Infinity)), (t2, -Infinity, Infinity)), (t1, -Infinity,
Infinity)), (k, -Infinity, Infinity))
numerical_integral(x*y,(x,0,1),(y,0,1))
numerical_integral(numerical_integral(x*y,(x,0,1)),(y,0,1))
var('t1,t2,u,w,k')
T = 1
m = 100
E = 1
v = 0
y=1
O = 1
integral(integral(integral(
integral(integral(
e^(-t1^2/T^2)*e^(-t2^2/T^2)*e^(I*O*t1)*
e^(-I*O*t2)*e^(-I*E*y^2*(1 - v)*t1^2/2)*
e^(-I*E*y^2*(1 - v)*t2^2/2)*e^(-I*k*y*(1 - u)*t1)*
e^(I*k*y*(1 - v)*t2)*
e^((1 + I)*(sqrt(E)*y*w*t1 + w*k/sqrt(E)))*
e^((1 - I)*(sqrt(E)*y*u*t2 + u*k/sqrt(E)))*
e^(-w^2/2)*e^(-u^2/2)*w^(-1/2 + I*m^2/(2*E))*
u^(-1/2 - I*m^2/(2*E)), (u, 0, 10)), (w, 0,
10)), (t2, -10, 10)), (t1, -10,
10)), (k, -10, 10))
RuntimeError: An error occurred running a Giac command:
INPUT:
sage20
OUTPUT:
:1: syntax error line 1 col 31 at " in sage20:=int(sage16,sage17"Done",sage18w,sage190):;
:1: syntax error line 1 col 31 at " in sage20:=int(sage16,sage17"Done",sage18w,sage190):;
"Done"
To unsubscribe from this group and stop receiving emails from it, send an email to sage-s...@googlegroups.com.
Hi Emmanuel,
On 2020-02-29, Emmanuel Charpentier <emanuel.c...@gmail.com> wrote:
> This question would have been more properly posed on ask.sagemath.org...
Why?
and would never post a question or an answer there.
It is of course a matter of taste. But it is certainly not appropriate to discourage people using sage-support, IMHO.
Best regards,
Simon
(Repost, as the first message seems to have ended up in the wrong thread.)
-- ============================================================= Fernando Q. Gouvea http://www.colby.edu/~fqgouvea Carter Professor of Mathematics Dept. of Mathematics and Statistics Colby College 5836 Mayflower Hill Waterville, ME 04901 Why is the alphabet in that order? Is it because of that song?
Some years ago in a book review, David Roberts had the idea of plotting an algebraic curve using the transformation (u,v) = (x,y)/(r2 + x2 + y2)1/2, which transforms the plane into a circle and makes it easy to visualize the projective completion of the curve.
You can see some of his plots at https://www.maa.org/press/maa-reviews/rational-algebraic-curves-a-computer-algebra-approach
I’d love to do this kind of plot for my students. Can anyone offer help on how to do it with Sage? (Of course the dream scenario would be to add this option to the plot method for curves...)I’ve been using implicit_plot for most of my examples, which seems to be equivalent of using C.plot() when C is a curve.Thanks,Fernando--==================================================================
Fernando Q. Gouvea Editor, MAA Reviews
Dept of Mathematics and Statistics http://www.colby.edu/~fqgouvea
Colby College http://www.maa.org/press/maa-reviews
Mayflower Hill 5836
Waterville, ME 04901
A training in mathematics is a prerequisite today for work in almost
any scientific field, but even for those who are not going to become
scientists, it is essential because, if it is only through speech that
we can understand what freedom means, only through mathematics
can we understand what necessity means.
-- W. H. Auden
--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAPON7s8KPbT-cLo_4FHJN-WqoqHi82%3DmgS1HBAD8SJqDxqkFDg%40mail.gmail.com.
Parametric plots won't work for general algebraic curves.
But I'm also not sure how to implement the transformation into a circle. I'll look at the documentation for plots.
Fernando
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAEQuuAUukezRFvtNBmhb6VPfkT0AjvbbGE55%2BM7xj90ZhLk2Lw%40mail.gmail.com.
-- ============================================================= Fernando Q. Gouvea http://www.colby.edu/~fqgouvea
Carter Professor of Mathematics Dept. of Mathematics and Statistics Colby College 5836 Mayflower Hill Waterville, ME 04901 There is nothing mysterious, as some have tried to maintain, about the applicability of mathematics. What we get by abstraction from something can be returned. -- R. L. Wilder, Introduction to the Foundations of Mathematics.
Here's what I ended up trying, with r=3:
var('x y u v')
x=u*sqrt(9/(1-u^2-v^2))
y=v*sqrt(9/(1-u^2-v^2))
implicit_plot(y^2-x^3+x==0,(u,-1,1),(v,-1,1))
That gives an error:
/opt/sagemath-8.9/local/lib/python2.7/site-packages/sage/ext/interpreters/wrapper_rdf.pyx in sage.ext.interpreters.wrapper_rdf.Wrapper_rdf.__call__ (build/cythonized/sage/ext/interpreters/wrapper_rdf.c:2237)() 74 for i from 0 <= i < len(args): 75 self._args[i] = args[i] ---> 76 return self._domain(interp_rdf(c_args 77 , self._constants 78 , self._py_constants ValueError: negative number to a fractional power not real
-- ============================================================= Fernando Q. Gouvea http://www.colby.edu/~fqgouvea
Carter Professor of Mathematics Dept. of Mathematics and Statistics Colby College 5836 Mayflower Hill Waterville, ME 04901 If little else, the brain is an educational toy. -- Tom Robbins
The whole point of this is to show the behavior of the curve near infinity, so changing the limits is not an option.
Fernando
>> ValueError: negative number to a fractional power not real
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAAWYfq1gnU%2BH55XmFEueQvPe8JTaiRSJ7G9k0cc8hSbdY2S9Zw%40mail.gmail.com.
But no, it doesn't work, since it gives a rectangular plot instead of one in polar coordinates. But maybe we are closer.
I still think implicit_plot should be smarter about values that do not make sense.
Fernando
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/b1b0c01c-7dfd-0e17-a3d4-61012ab66d8b%40colby.edu.
>
> --
> =============================================================
> Fernando Q. Gouvea http://www.colby.edu/~fqgouvea
> Carter Professor of Mathematics
> Dept. of Mathematics and Statistics
> Colby College
> 5836 Mayflower Hill
> Waterville, ME 04901
>
> If little else, the brain is an educational toy.
> -- Tom Robbins
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/6117cc36-6771-179c-2887-38c05305fd58%40colby.edu.
>
> --
> =============================================================
> Fernando Q. Gouvea http://www.colby.edu/~fqgouvea
> Carter Professor of Mathematics
> Dept. of Mathematics and Statistics
> Colby College
> 5836 Mayflower Hill
> Waterville, ME 04901
>
> If little else, the brain is an educational toy.
> -- Tom Robbins
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscribe@googlegroups.com.
This works, in the sense that there's no error. One does get a
bunch of extraneous points near the boundary of the disk. It's as
if plot_points were trying to connect the point at (0,1) and the
point at (0,-1) along the circle, even though f_uv is 1 on the
circle.
Strangely, they occur only on the right hand side (i.e., positive u, not negative u). I tried setting plot_points to be 500, but the bad points don't go away. Changing the curve to y^2-x^3+x-1=0 doesn't make them go away either.
Fernando
The easiest way is to use Python functions rather than symbolic ones;
define a function that is 1 outside the unit disk, and implicitly plot it.
sage: def f_uv(u,v):
....: if u^2+v^2>=1:
....: return 1
....: else:
....: x=u*sqrt(9/(1-u^2-v^2))
....: y=v*sqrt(9/(1-u^2-v^2))
....: return y^2-x^3+x
....: implicit_plot(f_uv,(u,-1,1),(v,-1,1))
>
> On Tue, Mar 3, 2020 at 8:20 PM Fernando Gouvea <fqgo...@colby.edu> wrote:
-- ============================================================= Fernando Q. Gouvea http://www.colby.edu/~fqgouvea Carter Professor of Mathematics Dept. of Mathematics and Statistics Colby College 5836 Mayflower Hill Waterville, ME 04901 We now face a choice between Christ and nothing, because Christ has claimed everything so that renouncing him can only be nihilism. -- Peter Leithart
Yes, and I should have thought of that!
Fernando