Re: [sage-devel] problems with Bessel functions

2009-12-09 Thread Burcin Erocal
On Tue, 8 Dec 2009 21:57:30 -0800 Robert Bradshaw rober...@math.washington.edu wrote: snip On Wed, Dec 9, 2009 at 12:44 PM, Nick Alexander ncalexan...@gmail.com wrote: snip You need to subclass sage.symbolic.function.SFunction. I don't see many examples, so here is a minimal one:

[sage-devel] Re: problems with Bessel functions

2009-12-09 Thread Jason Grout
Robert Bradshaw wrote: @sage.symbolic.function.symbolic def my_func(x, n): if x 0: return 0 else: return exp(-1/x^n) How about exposing the many other properties too: @sage.symbolic.function.symbolic(latex_name=\phi,...) def my_func(x,n): ... which translates to: def

[sage-devel] Re: problems with Bessel functions

2009-12-09 Thread Jason Grout
Nick Alexander wrote: Implementing a particular symbolic function is not outlandishly difficult, thanks to the tireless work of Burcin Erocal and Mike Hansen. (Apologies to any contributers I have forgotten.) You need to subclass sage.symbolic.function.SFunction. I don't see many

[sage-devel] Re: problems with Bessel functions

2009-12-09 Thread Nathann Cohen
Would it be possible, using this, to define a symbolic Sum ? Something like Sum(Set([1,2,3,4,5,6]))...This would be extremely useful in LP !!! Nathann On Dec 9, 12:48 pm, Jason Grout jason-s...@creativetrax.com wrote: Nick Alexander wrote: Implementing a particular symbolic function is not

Re: [sage-devel] Re: problems with Bessel functions

2009-12-09 Thread Mike Hansen
On Wed, Dec 9, 2009 at 7:01 PM, Nathann Cohen nathann.co...@gmail.com wrote: Would it be possible, using this, to define a symbolic Sum ? Something like Sum(Set([1,2,3,4,5,6]))...This would be extremely useful in What would the output of that be? There is

[sage-devel] high precision numerical integration

2009-12-09 Thread Alex Ghitza
Dear sage-devel, I am in the process of translating some lecture notes on experimental mathematics from Mathematica to Sage, and I'm running into some issues that I'll eventually ask about here after they've been brewing in my head for some time. Here's the first installment: suppose we want to

[sage-devel] Re: high precision numerical integration

2009-12-09 Thread Harald Schilly
On Dec 9, 1:34 pm, Alex Ghitza aghi...@gmail.com wrote: Any other ideas?   Yes, mpmath. It focuses on numerical evaluation and all special functions. Try this: http://mpmath.googlecode.com/svn/trunk/doc/build/calculus/integration.html - i.e. quad, quadosc H -- To post to this group, send an

Re: [sage-devel] Re: high precision numerical integration

2009-12-09 Thread Dan Drake
On Wed, 09 Dec 2009 at 04:51AM -0800, Harald Schilly wrote: On Dec 9, 1:34 pm, Alex Ghitza aghi...@gmail.com wrote: Any other ideas?   Yes, mpmath. It focuses on numerical evaluation and all special functions. Try this:

Re: [sage-devel] Re: problems with Bessel functions

2009-12-09 Thread Pablo De Napoli
Many thanks to everybody for your help. some questions/remarks: 1) ¿Does every function needs to have two versions: a symbolic one and a numerical one? 2) the current implementation treats f(x)=sin(x) as a symbolic expression sage: f(x)=sin(x) sage: f x |-- sin(x) sage: type(f) type

[sage-devel] A strang bug with Piecewise/integral/plot

2009-12-09 Thread Philippe Saade
Hello Folks, This works == var('x') f1(x) = 2 f2(x) = 4-x f3(x) = exp(x)/10 f4(x) = sin(2*x) f = Piecewise([[(0,1),f1],[(1,2),f2],[(2,3),f3],[(3,10),f4]]) F = f.integral() F.plot() This does not (f1 changed, nothing else) var('x') f1(x) = 1 f2(x) = 4-x f3(x) =

[sage-devel] Re: problems with Bessel functions

2009-12-09 Thread Jason Grout
Pablo De Napoli wrote: 2) the current implementation treats f(x)=sin(x) as a symbolic expression sage: f(x)=sin(x) sage: f x |-- sin(x) sage: type(f) type 'sage.symbolic.expression.Expression' However, mathematically a function is something different: for instance it has a domain and

Re: [sage-devel] A strang bug with Piecewise/integral/plot

2009-12-09 Thread David Joyner
I don't know. I think Paul Butler wrote that function. Maybe he knows? On Wed, Dec 9, 2009 at 9:20 AM, Philippe Saade psa...@gmail.com wrote: Hello Folks, This works == var('x') f1(x) = 2 f2(x) = 4-x f3(x) = exp(x)/10 f4(x) = sin(2*x) f =

[sage-devel] new book by Brent-Zimmerman

2009-12-09 Thread William Stein
Hi Sage-Devel, Have you ever wondered about the mathematics behind how MPFR, GMP, MPIR, etc., work under the hood? Fortunately, Paul Zimmerman and Richard Brent just published a new very-accessible book about exactly this, and has the foresight to release their book under a Creative Commons

Re: [sage-devel] Build failure on Mac OS X 10.5.8

2009-12-09 Thread David Kirkby
2009/12/8 Harald Hanche-Olsen han...@math.ntnu.no: Trying to build sage 4.2.1 on Mac OS X 10.5.8 ended in this error message: SNIP I might have tred to debug this myself, but I don't find files that should have been built weren't terribly informative. And the reference to running ldconfig

[sage-devel] Re: new book by Brent-Zimmerman

2009-12-09 Thread Bill Hart
I refer to this book regularly, as it is a good introductory reference and contains plenty of literature citations. Some of the more recent algorithms are yet to be described in it, but having it available is invaluable for the field. Sadly, I cannot use this as an excuse to bring out the old

[sage-devel] piecewise bug

2009-12-09 Thread Hassan
if you use a constant as a piece in Piecewise: sage: f = Piecewise([[(-1,0),0],[(0,pi),sin(x)]]) then you can do anything with this function: sage: f.default_variable() ... /home/hassan/Apps/sage-4.2.1/local/lib/python2.6/site-packages/sage/ functions/piecewise.py in default_variable(self) 669

[sage-devel] Re: Error building sage 4.2.1

2009-12-09 Thread VictorMiller
More details: gcc --version gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Here are some more

[sage-devel] Re: Implementation of Graphs, c_graphs, and NetworkX

2009-12-09 Thread Robert Miller
Responding to a comment from trac: One problem IMHO with `c_graph` is that as is (correct me if I'm wrong) we won't be able to have a fast `in_neighbors`. This is certainly true, if you're using a SparseGraph to represent a DiGraph. In this case, I think there should actually be two

[sage-devel] simplify (sqrt(6)-sqrt(5))^-1

2009-12-09 Thread Harald Schilly
Hi, i got a report a problem comment about how simplify/full_simplify works. I think this could be sent to maxima upstream? Well, here is the (rather educational) example: sage: a=(sqrt(6)-sqrt(5))^-1 sage: a -1/(sqrt(5) - sqrt(6)) sage: a.full_simplify() 1/(sqrt(2)*sqrt(3) - sqrt(5)) sage:

Re: [sage-devel] Re: problems with Bessel functions

2009-12-09 Thread Robert Bradshaw
On Dec 9, 2009, at 5:40 AM, Pablo De Napoli wrote: Many thanks to everybody for your help. some questions/remarks: 1) ¿Does every function needs to have two versions: a symbolic one and a numerical one? Somewhat. The situation arises because one often only defines the function

[sage-devel] bug in simplifying expressions

2009-12-09 Thread mhampton
I was trying to simplify a somewhat complicated expression involving two square roots, and seem to have found bugs in how sage parses things from sympy and maxima. At least, Ondrej checked and sympy handles things fine, the answer gets corrupted somehow in sage. I suspect the same is true for

[sage-devel] 'set -e' used inappropriately in python-2.6.2.p4

2009-12-09 Thread Dr. David Kirkby
The following problem, which is ticket http://trac.sagemath.org/sage_trac/ticket/7645 is one more example of where trying to build Sage on an uncommon platform (HP-UX) discovers bugs which affect *all* platforms. This is yet one more justification of why it is desirable to write POSIX

Re: [sage-devel] graph theory tickets needing review

2009-12-09 Thread Pat LeSmithe
On 12/08/2009 04:56 PM, William Stein wrote: theory component, which has an *enormous* number (=19) of tickets that need review.Is there any plan to get this under review? If it's not too much trouble, could you please set up Rado's graph editor

[sage-devel] Re: simplify (sqrt(6)-sqrt(5))^-1

2009-12-09 Thread kcrisman
On Dec 9, 5:07 pm, Harald Schilly harald.schi...@gmail.com wrote: Hi, i got a report a problem comment about how simplify/full_simplify works. I think this could be sent to maxima upstream? Well, here is the (rather educational) example: sage: a=(sqrt(6)-sqrt(5))^-1 sage: a -1/(sqrt(5)

[sage-devel] Re: simplify (sqrt(6)-sqrt(5))^-1

2009-12-09 Thread ma...@mendelu.cz
sage: a=(sqrt(6)-sqrt(5))^-1 sage: maxima(a).trigrat() sqrt(6)+sqrt(5) Now the question is, how to include trigrat function into Sage. I attempted to do something similar for logarithms and logcontract, logexpand in http://trac.sagemath.org/sage_trac/ticket/7334 - see the related dicussion on

[sage-devel] Re: Implementation of Graphs, c_graphs, and NetworkX

2009-12-09 Thread Nathann Cohen
Well, in my use of directed graphs I can swear I need to talk about out-neighbors at least as often as I need to talk about out- neighbors Storing them two time would not be a waste in opinion, and anyway we can not afford to have only the out-neighbors available... I have not read the

[sage-devel] Re: Implementation of Graphs, c_graphs, and NetworkX

2009-12-09 Thread Nathann Cohen
Just a random thought : wouldn't it be way more efficient to write the definitions of a Graph ( and perhaps the basic functions too ) directly in C, then to wrap them through Cython ? Nathann -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group,

Re: [sage-devel] Re: Implementation of Graphs, c_graphs, and NetworkX

2009-12-09 Thread Robert Miller
OK, these are both tickets now: http://trac.sagemath.org/sage_trac/ticket/7640 http://trac.sagemath.org/sage_trac/ticket/7651 These will need to be dealt with before we can switch. I'm optimistic, given that this is still a pretty short list. I hope everyone reading this will try out the patch

[sage-devel] Re: simplify (sqrt(6)-sqrt(5))^-1

2009-12-09 Thread andrejv
On Dec 10, 6:21 am, kcrisman kcris...@gmail.com wrote: On Dec 9, 5:07 pm, Harald Schilly harald.schi...@gmail.com wrote: Hi, i got a report a problem comment about how simplify/full_simplify works. I think this could be sent to maxima upstream? Well, here is the (rather educational)

[sage-devel] Re: bug in simplifying expressions

2009-12-09 Thread ma...@mendelu.cz
Seems that this comes from Maxima. Look at this sage: fu=maxima(k6).fullratsimp().sage();fu -12*(3*(28960879780288*sqrt(2) + 49414857768735)*sqrt(3) - 150485145634059*sqrt(2) - 256767132912716)/(3*(40774373203317*sqrt(2) - 90564557902141)*sqrt(3) - 211869858104760*sqrt(2) + 470587246954565) sage:

Re: [sage-devel] Re: Implementation of Graphs, c_graphs, and NetworkX

2009-12-09 Thread Robert Miller
On Wed, Dec 9, 2009 at 10:23 PM, Nathann Cohen nathann.co...@gmail.com wrote: Just a random thought : wouldn't it be way more efficient to write the definitions of a Graph ( and perhaps the basic functions too ) directly in C, then to wrap them through Cython ? Nathann Re: Cython vs C, there

[sage-devel] Re: bug in simplifying expressions

2009-12-09 Thread ma...@mendelu.cz
O.K. so the magic is Maxima flag algebraic=true, as explained in http://groups.google.cz/group/sage-devel/t/4928c36765ff6972 On 10 pro, 07:38, ma...@mendelu.cz ma...@mendelu.cz wrote: Seems that this comes from Maxima. Look at this -- To post to this group, send an email to

[sage-devel] Easy question in Python/Sage...

2009-12-09 Thread Nathann Cohen
Hello everybody !!! I recently had to write two very easy lines of python, and I wondered if there was ( there is ) a better way to write them. The problem is easy : I have a list A, a list B whose elements all belong to A, and I want to return A-B. I wrote [v for v in A if v not in B] which may