[sympy] Numerical Jacobi Polynomial Evaluation

2014-02-08 Thread Freddie Witherden
Hi all, As I alluded to on my thread regarding polynomial evaluation mpmath appears to have some issues evaluating Jacobi polynomials: In [3]: for i in range(5): ...: for j in range(5): ...: for k in range(5): ...: try: ...: mp.jacobi(i, j, k,

Re: [sympy] Preventing Polynomial Evaluation

2014-02-07 Thread Freddie Witherden
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/02/2014 01:43, Aaron Meurer wrote: We should just change all the special polynomial objects to not evaluate by default. jacobi_normalized actually *is* a class, but it evaluates whenever the degree is an explicit integer. But there's no

[sympy] Preventing Polynomial Evaluation

2014-02-05 Thread Freddie Witherden
Hi all, In SymPy is there any way of stopping orthogonal polynomials from automatically simplifying down to concrete expressions? So for: sy.jacobi_normalized(2, 0, 1, x) to give: sqrt(6)/3*jacobi(2, 0, 1, x) as opposed to: sqrt(6)*(5*x**2/2 - x - 1/2)/2 I have a use-case where it is

[sympy] Floating Point Truncation in integrate

2013-11-09 Thread Freddie Witherden
Hi all, With SymPy 0.7.3 consider the following snippet: import sympy as sy p, q = sy.symbols('p q') p1 = sy.sqrt(2)/2 p2 = 3*q/2 + sy.S(1)/2 p1f = p1.evalf(30) p2f = p2.evalf(30) int1 = sy.integrate(sy.integrate(p1*p2, (q, -1, -p)), (p, -1, 1)) int2 = sy.integrate(sy.integrate(p1f*p2f, (q,

[sympy] sy.Poly Evaluation

2013-07-09 Thread Freddie Witherden
Hi all, Consider the following snippet: import sympy as sy from sympy.abc import x from sympy.mpmath import mp N = 4 mp.dps = 30 # Way 1 Pn1 = sy.legendre_poly(N, x) dPn1 = Pn1.diff() print dPn1.evalf(mp.dps, subs={x: mp.sqrt(2)}) # Way 2 Pn2 = sy.Poly(sy.legendre_poly(N, x)) dPn2 =

Re: [sympy] sy.Poly Evaluation

2013-07-09 Thread Freddie Witherden
On 09/07/13 16:30, Mateusz Paprocki wrote: What version of SymPy do you use? I can't exactly reproduce your results, thought Poly.evalf() is wrong. Here are results for the master branch (as of e06036a2daae4c2f6fc36e443a7516c6d7247df5): This was on 0.7.2. In this

Re: [sympy] Unbundle mpmath

2013-07-09 Thread Freddie Witherden
On 28/06/13 14:42, Sergey Kirpichev wrote: There is a long term issue [1] to make mpmath an external dependency. It was suggested by Aaron (see discussion in PR [2]), that we should discuss this on the mailing list. Perhaps, the main reason to prefer bundled mpmath copy is a mystical

Re: [sympy] Unbundle mpmath

2013-07-09 Thread Freddie Witherden
On 09/07/13 18:55, Ondřej Čertík wrote: I agree with you that removing mpmath brings more cons than benefits overall. However, I just want to understand the root of the particular problem you mentioned. If sympy removes mpmath, then sympy cannot be configured to use its own mpmath. In other

Re: [sympy] Multiplying a SymPy Expression by a mpf

2013-04-20 Thread Freddie Witherden
On 16/04/13 00:14, Aaron Meurer wrote: Both give 0.246913578246913578246913578 for me in sympy master with sympy mpmath. After switching to the SymPy version of mpmath I get the same. Should we perhaps try to warn the user about this scenario (so using the system mpmath when SymPy is using its

[sympy] Multiplying a SymPy Expression by a mpf

2013-04-15 Thread Freddie Witherden
Hi all, Consider: from mpmath import mp import sympy as sy mp.dps = 30 c = mp.mpf('0.123456789123456789123456789') d = 2*sy.Symbol('r') print (c*d).evalf(mp.dps) print 2*c which gives: 0.246913578246913567593168181702*r 0.246913578246913578246913578 from which it appears as if the mp.mpf

Re: [sympy] Normalized Jacobi Polynomials

2013-04-14 Thread Freddie Witherden
On 13/04/13 14:36, someone wrote: I recently had a need for Jacobi polynomials with the property that int(P(i, a, b, x)*P(j, a, b, x)*(1-x)^a*(1+b)^b, (x, -1, 1) = delta_ij with the key element being the normalization factor. Would it be possible to get this upstream (it is a pain to

[sympy] Normalized Jacobi Polynomials

2013-04-13 Thread Freddie Witherden
Hi all, I recently had a need for Jacobi polynomials with the property that int(P(i, a, b, x)*P(j, a, b, x)*(1-x)^a*(1+b)^b, (x, -1, 1) = delta_ij as I could not find these in SymPy I've come up with the following: def norm_jacobi(n, a, b, x): G, F = sy.gamma, sy.factorial N2 =

Re: [sympy] Lambdify with high-prec constants

2012-12-02 Thread Freddie Witherden
On 02/12/12 16:07, Stefan Krastanov wrote: I do not think that the sympy's lambdify function is a good fit here. It is mainly used for translating sympy expressions to something faster but not as precise (python math or numpy). It is strange to use it to translate something from sympy back to

[sympy] Lambdify with high-prec constants

2012-12-01 Thread Freddie Witherden
Hi all, Consider (with mp.dps = 30): f = mp.mpf('0.1234123094834543252345098') q = sy.Symbol('q') x = f*q Now, running lambdastr over the expression we find: 'lambda q: (0.1234123094834543252345098*q)' which is curtailed by the fact that our mpf float will be interpreted as a Python float.

[sympy] sympy.utilities.autowrap and Gentoo

2012-10-18 Thread Freddie Witherden
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, While playing about with the autowrap functionality I have been having some trouble getting autowrap to correctly locate the f2py command. On my Gentoo system I have two copies of f2py; f2py2.7 and f2py3.2 (associated with Python 2 and Python

[sympy] RootOf.evalf() fails for Legendre Polynomials

2012-10-15 Thread Freddie Witherden
Hi all, When attempting to find the roots of a Legendre polynomial: In [3]: from sympy import Poly, legendre_poly In [4]: lp = Poly(legendre_poly(5)) In [5]: [float(r.evalf()) for r in lp.all_roots()] Out[5]: [-0.5384693101056831, -0.5384693101056831, 0.0, 0.5384693101056831,

Re: [sympy] Summations

2010-03-25 Thread Freddie Witherden
Hi all, On 24 Mar 2010, at 18:58, Ondrej Certik wrote: Here is one way (thanks again to Fernando for implementing the symarray!): In [1]: s = 17 In [2]: Bi1 = symarray(s, B) In [3]: Ci1 = symarray(s, C) In [4]: Add(*(Bi1*Ci1**4)) - S(1)/5 Out[4]: 44 4

[sympy] Re: [sage-devel] of Google Groups and spam

2009-11-01 Thread Freddie Witherden
On Sunday 01 November 2009 02:58:21 Ondrej Certik wrote: On Fri, Oct 30, 2009 at 3:09 AM, Minh Nguyen nguyenmi...@gmail.com wrote: Hi folks, Just in case you're wondering why spam mails got through occasionally, here are some stories that present the moderator's side:

[sympy] Re: sympy gamma: technology preview

2009-10-25 Thread Freddie Witherden
Hi all, As for showing steps for integration and so on, does anyone know if there are any general purpose algorithms for this? It might make a good Google Summer of Code project Funny you should mention that. A few years ago now I made a post to a Yacas mailing list (which I will try to

[sympy] Re: sympy gamma: technology preview

2009-10-22 Thread Freddie Witherden
On Thursday 22 October 2009 01:34:24 Ondrej Certik wrote: I would like SymPy Gamma to be a really easy way to start playing with sympy, first by typing some expression, get lots of info about it (e.g. some nice input cells ready to be modified), with links to documentation and possibly other

[sympy] Re: SciPy 09 sympy tutorial video

2009-08-19 Thread Freddie Witherden
Hi, On 19 Aug 2009, at 15:39, Ondrej Certik wrote: here is a video of the sympy tutorial that I gave yesterday: http://www.archive.org/details/scipy09_advancedTutorialDay1_4 It's one 1h42min. Do you know if the output from the laptop was captured at all? As it would be good if that could

[sympy] Re: sympy.latex() questions

2009-07-28 Thread Freddie Witherden
Hi, I may be a tad out of touch with recent sympy developments, but here goes. (And I am sure someone will correct me if I am wrong on any of these points.) Firstly, if there is a float in the expression I feed to the .latex() function, is there anyway I can set the precision of the

[sympy] Re: sympy.latex() questions

2009-07-28 Thread Freddie Witherden
On 28 Jul 2009, at 16:49, william ratcliff wrote: Is the breqn package/algorithms incorporated into mathtex? Not currently, although it has been requested and so have been looking into it. Determining where to break an equation is quite a complex task but I hope to have a prototype in a

[sympy] Re: MathML

2009-07-05 Thread Freddie Witherden
Hi, I know that sympy can export formulas for MathML but I do not concrete usse of this. I know that Amaya works with MathML : http://www.w3.org/Amaya/ . But is there a way to use in in a web browsne r ? Is the new Firefox which seems to works with SVG is able to read MathML ? There is a

[sympy] LaTeX Printing of Integrals

2009-04-11 Thread Freddie Witherden
Hi all, I have been looking at the printing of integrals in the LaTeX printer and am interested in getting your opinions on the subject. Firstly, we currently always print the 'd' (as in dx, dy, etc) in italics. However, some books print it as a Roman (upright) character. Mathematica

[sympy] Re: A new concept of flying. How can that be?

2009-04-07 Thread Freddie Witherden
Hi all, Ok, so that yahoo email is answered by the same person as the gmail one and he wrote me that his messages were not meant as spam, that in some countries they are secretly developing a new aircraft with a totally different concept and he was curious how many people know about it. A

[sympy] Symbols from Sympify

2009-04-04 Thread Freddie Witherden
Hi all, I am wondering if it is possible to change the real=True|False property of the symbols used by sympify/S created when parsing an expression. E.g., S('sqrt(x^2)'), how can I then specify that x is real? While I can access the Symbol's using .atoms(Symbol) I can not work out how to

Re: Fixes the A*f(x).diff(x)*A problem (#1327)

2009-03-17 Thread Freddie Witherden
The patch seems fine to me. All tests pass, can confirm that it solves the aforementioned issue. Regards, Freddie. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sympy-patches group. To post to this group, send

[sympy] Re: Splitting Mathtext from Matplotlib

2009-02-26 Thread Freddie Witherden
Hi all, On account of the overwhelming positive support for the idea I will think that it is a worthwhile proposal for GSoC. However, is this a Sympy thing (with Sympy being one of the main benefactors of the project) or a matplotlib one (as the code does belong in matplotlib)? Regards,

[sympy] Splitting Mathtext from Matplotlib

2009-02-25 Thread Freddie Witherden
Hi all, As many of you know I have something of an interest (some would say unhealthy one) in the LaTeX output produced by Sympy. While this is currently at a very high standard (I would go so far as to say that Sympy produces the best LaTeX output of all major CAS software) the problem of

[sympy] Precision Tracking

2009-02-22 Thread Freddie Witherden
Hi all, I am interested if there are currently any plans to add some form of precision tracking for variables, be it through sympy or mpmath. The current implementation will more than happily compute sin(0.50) to 100+ decimal places if asked, even though the argument is only accurate to

[sympy] Re: Precision Tracking

2009-02-22 Thread Freddie Witherden
Hi all, There is no way to make this literally work for sin(0.50), because 0.5, 0.50 and 0.5 are the same to Python. You have to explicitly set the precision for all numbers, as such: sin(Real('0.50', 2)). I think we should adopt the same principle as Mathematica here and

[sympy] LaTeX Printing Proposals

2008-12-24 Thread Freddie Witherden
Hi all, I have been toying around with a couple of ideas which might be worth investigating for the LaTeX printer. First off, different bracket styles depending on the nesting level. So it might go: { [ ( ( ) ) ] }; exactly how to do this I am unsure. It depends on how easy it is to

[sympy] Re: LaTeX Printing Proposals

2008-12-24 Thread Freddie Witherden
Hi, On 24 Dec 2008, at 23:36, Alan Bromborsky wrote: When you say configuration option I assume you mean a global switch so you can turn the option off and on for different parts of the program. I was thinking more along the lines as an optional parameter passed to latex(expr,