how to override the solver function in sympy?

2016-12-03 Thread Ho Yeung Lee
how to override the solver function in sympy? -- https://mail.python.org/mailman/listinfo/python-list

Re: sympy

2016-03-31 Thread Oscar Benjamin
On 31 March 2016 at 22:33, Poul Riis wrote: > Den onsdag den 30. marts 2016 kl. 13.17.33 UTC+2 skrev Poul Riis: >> Is it possible to transfer results from sympy to 'normal' python. >> >> In the case below I think my intention is clear enough but it does not work

Re: sympy

2016-03-31 Thread Poul Riis
Den onsdag den 30. marts 2016 kl. 13.17.33 UTC+2 skrev Poul Riis: > Is it possible to transfer results from sympy to 'normal' python. > > In the case below I think my intention is clear enough but it does not work > as intended. How can it be done? > > Poul Riis >

Re: sympy

2016-03-31 Thread Oscar Benjamin
On 31 March 2016 at 11:57, Poul Riis wrote: > > ... However, the sympy way seems to be about 70 times slower than using the > derivative calculated 'by hand' (try the example below). > Can it be done in a more efficient way? > > Poul Riis > > > > from

Re: sympy

2016-03-31 Thread Peter Otten
Chris Angelico wrote: > On Fri, Apr 1, 2016 at 1:55 AM, Peter Otten <__pete...@web.de> wrote: >> Hm, the two functions fmsympy() and fm() do not return the same value: >> >> $ python -i sympy_diff.py >> 1 evaluations with sympy : dt1 = 0.7178411483764648 &g

Re: sympy

2016-03-31 Thread Chris Angelico
On Fri, Apr 1, 2016 at 1:55 AM, Peter Otten <__pete...@web.de> wrote: > Hm, the two functions fmsympy() and fm() do not return the same value: > > $ python -i sympy_diff.py > 1 evaluations with sympy : dt1 = 0.7178411483764648 > 1 evaluations without sympy: dt2

Re: sympy

2016-03-31 Thread Peter Otten
Poul Riis wrote: > Den onsdag den 30. marts 2016 kl. 17.59.49 UTC+2 skrev Steven D'Aprano: >> On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: >> >> > What I intend to do is to let sympy find the derivative of some >> > welldefined function and next

Re: sympy

2016-03-31 Thread Poul Riis
Den onsdag den 30. marts 2016 kl. 17.59.49 UTC+2 skrev Steven D'Aprano: > On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: > > > What I intend to do is to let sympy find the derivative of some > > welldefined function and next define the foundation derivative as a normal >

Re: sympy

2016-03-30 Thread Poul Riis
Den torsdag den 31. marts 2016 kl. 06.49.34 UTC+2 skrev Gregory Ewing: > Steven D'Aprano wrote: > > On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: > > > >>What I intend to do is to let sympy find the derivative of some > >>welldefined function and next define

Re: sympy

2016-03-30 Thread Gregory Ewing
Steven D'Aprano wrote: On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: What I intend to do is to let sympy find the derivative of some welldefined function and next define the foundation derivative as a normal function py> ftext.evalf(subs={x:3}) -0.0600 Given all that,

Re: sympy

2016-03-30 Thread Steven D'Aprano
On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote: > What I intend to do is to let sympy find the derivative of some > welldefined function and next define the foundation derivative as a normal > function so that I can calculate numerical values or even make a graph. I'm glad you expl

Re: sympy

2016-03-30 Thread Robert Kern
On 2016-03-30 16:23, Poul Riis wrote: What I intend to do is to let sympy find the derivative of some welldefined function and next define the foundation derivative as a normal function so that I can calculate numerical values or even make a graph. http://docs.sympy.org/dev/modules/utilities

Re: sympy

2016-03-30 Thread Poul Riis
What I intend to do is to let sympy find the derivative of some welldefined function and next define the foundation derivative as a normal function so that I can calculate numerical values or even make a graph. -- https://mail.python.org/mailman/listinfo/python-list

Re: sympy

2016-03-30 Thread Steven D'Aprano
On Wed, 30 Mar 2016 10:17 pm, Poul Riis wrote: > Is it possible to transfer results from sympy to 'normal' python. > > In the case below I think my intention is clear enough but it does not > work as intended. How can it be done? How can what be done? Unfortunately, we&#x

Re: sympy

2016-03-30 Thread Ned Batchelder
On Wednesday, March 30, 2016 at 7:17:33 AM UTC-4, Poul Riis wrote: > Is it possible to transfer results from sympy to 'normal' python. Poul, welcome to the group. > In the case below I think my intention is clear enough but it does not work > as intended. How can it be do

Re: sympy

2016-03-30 Thread Ben Finney
Poul Riis writes: > Is it possible to transfer results from sympy to 'normal' python. Is Sympy not “normal Python”? What transfer are you intending? > In the case below I think my intention is clear enough but it does not > work as intended. How can it be done? First: no

sympy

2016-03-30 Thread Poul Riis
Is it possible to transfer results from sympy to 'normal' python. In the case below I think my intention is clear enough but it does not work as intended. How can it be done? Poul Riis from sympy import * x=Symbol('x') ftext=diff(1/(x**2+1),x) def f(t): return ftex

Re: Error after sympy lambdify function update using vector() dot.class

2014-07-11 Thread Chris Angelico
On Sat, Jul 12, 2014 at 3:33 AM, Niklas Troedsson wrote: > I am new to the forum and programming Python. > > Recently I updated both Canopy and its packages, I am now using Canopy > 1.4.1.1975 and sympy 0.7.5-1. > This is a general Python list, not Canopy or Sympy specific. If

Error after sympy lambdify function update using vector() dot.class

2014-07-11 Thread Niklas Troedsson
I am new to the forum and programming Python. Recently I updated both Canopy and its packages, I am now using Canopy 1.4.1.1975 and sympy 0.7.5-1. In an earlier version my code to solve algebra and substitute a lot of constants and transfer functions with more than 1001 frequency points worked

Re: Debug (sympy-Function; lambdify)

2013-10-10 Thread Marco Buttu
On 10/11/2013 08:28 AM, Surbhi Gupta wrote: This is the code I m trying to run: from sympy import * import numpy as np from sympy import symbols def deriv(x,t): a = array(x) for i in range(0,len(x)): temp = x[i] a[i] = temp[0].diff(t) return a def matrixmult

Debug (sympy-Function; lambdify)

2013-10-10 Thread Surbhi Gupta
This is the code I m trying to run: from sympy import * import numpy as np from sympy import symbols def deriv(x,t): a = array(x) for i in range(0,len(x)): temp = x[i] a[i] = temp[0].diff(t) return a def matrixmult (A, B): C = [[0 for row in range(len(A))] for

Re: sympy returns a dictionary sometimes, and sometimes a list of tuples...why?

2009-09-30 Thread Robert Kern
Brian Blais wrote: Hello, I wrote a very simple script using sympy, and things were working fine, except for one problem. So I have: You will probably want to ask on the sympy mailing list: http://groups.google.com/group/sympy from sympy import * x, y = symbols('x',&#x

sympy returns a dictionary sometimes, and sometimes a list of tuples...why?

2009-09-30 Thread Brian Blais
Hello, I wrote a very simple script using sympy, and things were working fine, except for one problem. So I have: from sympy import * x, y = symbols('x','y',real=True) alpha,beta,gamma=symbols('alpha','beta','gamma',real=True) alpha_p,

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-22 Thread Terry Reedy
Fredrik Lundh wrote: Robert Kern wrote: (if someone wants to submit this to bugs.python.org, be my guest) http://bugs.python.org/issue3936 -- http://mail.python.org/mailman/listinfo/python-list

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-22 Thread Fredrik Lundh
Robert Kern wrote: No warnings show up when importing the offending module: Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from sympy.mpmath import specfun >>>

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-22 Thread Robert Kern
Fredrik Lundh wrote: Mensanator wrote: I'm not the one who wrote sympy, so I guess I'm not the only one who didn't notice it. If it's a well known problem, then sorry I wasted your time. Given that 2.5 explicitly warns about this specific change: >>> as = 1 :1

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-21 Thread Mensanator
On Sep 21, 4:37 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > I'm not the one who wrote sympy, so I guess I'm not > > the only one who didn't notice it. > > > If it's a well known problem, then sorry I wasted > > y

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-21 Thread Fredrik Lundh
Mensanator wrote: I'm not the one who wrote sympy, so I guess I'm not the only one who didn't notice it. If it's a well known problem, then sorry I wasted your time. Given that 2.5 explicitly warns about this specific change: >>> as = 1 :1: Warning: 'as&

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-20 Thread Mensanator
ou CAN use "as" for a variable: "for as in xrange(10): print > > as" > > works just fine, although it shouldn't. > > > Python 2.6 fixes this discrepency and now gives you a syntax error if > > you > > use "as" for a variable name. &g

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-20 Thread Guilherme Polo
h it shouldn't. > > Python 2.6 fixes this discrepency and now gives you a syntax error if > you > use "as" for a variable name. You should have noticed the warning you received in python 2.5 when using "as" as a name. > > The upshot is code (such as sympy) w

Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-20 Thread Mensanator
names or you'll get a syntax error. Ah, but you CAN use "as" for a variable: "for as in xrange(10): print as" works just fine, although it shouldn't. Python 2.6 fixes this discrepency and now gives you a syntax error if you use "as" for a variable name. The

Re: sympy: what's wrong with this picture?

2008-03-05 Thread Nanjundi
od whose outcome can be > > affected by changing the random seed value. * > > But that doesn't give it the right to mess with the state > of the random number generator _I'm_ using. Had I actually > known what was happening, I could have saved the state of > my random

Re: sympy: what's wrong with this picture?

2008-03-05 Thread Mensanator
lo method whose outcome can be > affected by changing the random seed value.  * But that doesn't give it the right to mess with the state of the random number generator _I'm_ using. Had I actually known what was happening, I could have saved the state of my random number generator s

Re: sympy: what's wrong with this picture?

2008-03-05 Thread Nanjundi
On Mar 4, 3:13 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 4, 12:32 pm, Nanjundi <[EMAIL PROTECTED]> wrote: > > > > Does seeding ( random.seed ) random with time fix this? It should. > > I suppose that depends on how long it takes factorint() to > process a number. If the seed is reset befor

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 4:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 4, 3:00 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > > > On Mar 4, 3:13 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > But what if _I_ wanted to make a repeatable sequence for test > > > purposes? Wouldn't factorint() destroy my

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 3:00 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Mar 4, 3:13 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > But what if _I_ wanted to make a repeatable sequence for test > > purposes? Wouldn't factorint() destroy my attempt by reseeding > > on every call? > > Would it? I don't kno

Re: sympy: what's wrong with this picture?

2008-03-04 Thread bearophileHUGS
apatheticagnostic: > I swear, this is one of the most polite-oriented groups I've ever > seen. > Not that that's a bad thing or anything, it's nice to be nice. Yep, and with lot more work it may even become a bit fit for women/ females too. Bye, bearophile -- http://mail.python.org/mailman/listi

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Istvan Albert
On Mar 4, 3:13 pm, Mensanator <[EMAIL PROTECTED]> wrote: > But what if _I_ wanted to make a repeatable sequence for test > purposes? Wouldn't factorint() destroy my attempt by reseeding > on every call? Would it? It may just be that you are now itching to see a problem even where there isn't one

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 12:32 pm, Nanjundi <[EMAIL PROTECTED]> wrote: > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > Notice anything funny about the "random" choices? > > > import sympy > > import time > > import random

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 10:50 am, Lie <[EMAIL PROTECTED]> wrote: > On Mar 4, 1:12 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > > > Mensanator wrote: > > > > While we're on the subject of English, the word "worthless" > > > > means "ha

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 2:44 am, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > >> Mensanator wrote: > >>> I'm not hard to please at all. > >> No, of course not, since logically you must think all software is useless. > > > So

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Nanjundi
On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > Notice anything funny about the "random" choices? > > import sympy > import time > import random > > f = [i for i in sympy.primerange(1000,1)] > > for i in xrange(10): > f1 = random.ch

Re: sympy: what's wrong with this picture?

2008-03-04 Thread castironpi
On Mar 4, 10:50 am, Lie <[EMAIL PROTECTED]> wrote: > On Mar 4, 1:12 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > > > Mensanator wrote: > > > > While we're on the subject of English, the word "worthless" > > > > means "ha

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Lie
On Mar 4, 1:12 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > > Mensanator wrote: > > > While we're on the subject of English, the word "worthless" > > > means "has no value". So, a program that doesn't work would > > > generally be "

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Erik Max Francis
Mensanator wrote: > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: >> Mensanator wrote: >>> I'm not hard to please at all. >> No, of course not, since logically you must think all software is useless. > > Somehow, I expected better logic from people who call themselves > programm

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > While we're on the subject of English, the word "worthless" > > means "has no value". So, a program that doesn't work would > > generally be "worthless". One that not only doesn't work but > > creates side effec

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 8:31 pm, [EMAIL PROTECTED] wrote: > > All software has bugs. > > Good software has bugs. > > Therefore, good software is software. > > > This makes sympy worse than worthless, as it f***s up other modules. > > What is it still good for? Lots. The probl

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Erik Max Francis
Mensanator wrote: > While we're on the subject of English, the word "worthless" > means "has no value". So, a program that doesn't work would > generally be "worthless". One that not only doesn't work but > creates side effects that cause other programs to not work > (which don't have bugs) would

Re: sympy: what's wrong with this picture?

2008-03-03 Thread castironpi
> All software has bugs. > Good software has bugs. Therefore, good software is software. > This makes sympy worse than worthless, as it f***s up other modules. What is it still good for? -- http://mail.python.org/mailman/listinfo/python-list

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
ing? Aren't I doing my part? Should I just > > uninstall it and forget it? > > Finding the issue and reporting it to the sympy bug tracker is commendable. > > Coming here and "un-recommending" sympy before the issue was resolved is not. Bad choice of words I guess

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 6:21 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Mar 3, 4:08 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Mensanator wrote: > >>> On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > >>>> I

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Robert Kern
nk to > such a program that he's recommending going and trying it out. That > is why they're making it available, isn't it? For people to try out > so they can get free testing? Aren't I doing my part? Should I just > uninstall it and forget it? Finding the issue a

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Carl Banks
wrote: > > > > > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > Notice anything funny about the "random" choices? > > > > > > import sympy > > > > > import time > > > > > import r

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
TECTED]> wrote: > > > > > Notice anything funny about the "random" choices? > > > > > import sympy > > > > import time > > > > import random > > > > > f = [i for i in sympy.primerange(1000,1)] > > >

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Robert Kern
Mensanator wrote: > On Mar 3, 4:08 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Mensanator wrote: >>> On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: >>>> It's just a bug--probably sympy is messing with the internals of the >>

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 4:08 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > >> It's just a bug--probably sympy is messing with the internals of the > >> random number generator.  It woul

Re: sympy: what's wrong with this picture?

2008-03-03 Thread apatheticagnostic
I swear, this is one of the most polite-oriented groups I've ever seen. Not that that's a bad thing or anything, it's nice to be nice. (This has been Captain Universal Truth, over and out) -- http://mail.python.org/mailman/listinfo/python-list

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Carl Banks
On Mar 3, 4:47 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > Notice anything funny about the "random" ch

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Robert Kern
Mensanator wrote: > On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: >> It's just a bug--probably sympy is messing with the internals of the >> random number generator. It would be a simple fix. Instead of >> bing about it, file a bug report.

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > Notice anything funny about the "random" choices? > > > import sympy > > import time > > import ran

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Carl Banks
On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > Notice anything funny about the "random" choices? > > import sympy > import time > import random > > f = [i for i in sympy.primerange(1000,1)] > > for i in xrange(10): > f1 = random.ch

sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
Notice anything funny about the "random" choices? import sympy import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10): f1 = random.choice(f) print f1, f2 = random.choice(f) print f2, C = f1*f2 ff = None ff = sympy.factorint(C)

sympy: nifty, but... (was: How about adding rational fraction to Python?)

2008-03-02 Thread Mensanator
On Mar 1, 12:29 pm, "Anand Patil" <[EMAIL PROTECTED]> wrote: > Not sure if this is common knowledge yet but > Sympy,http://code.google.com/p/sympy, has a rational type. I hadn't heard of this before, thanks for the link. Very nifty, lots of goodies not found in gmpy (

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
At 05:33 PM 11/18/2007, Fredrik Johansson wrote: >On Nov 19, 2007 2:23 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > > OK, I tried mpmath again, and to my surprise, it went well! > > > > === > > #!/usr/bin/env python > > #coding=utf-8 > > from mpmath import * > > mpf.

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
. You could use the exp function in > > >sympy.numerics.functions instead to compute e**x. > > > > Thanks, Fredrik, but I get the same error using either exp or power: > > > > from __future__ import division > > from sympy import * > >

Re: Help with sympy, please

2007-11-18 Thread Fredrik Johansson
On Nov 19, 2007 2:23 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > OK, I tried mpmath again, and to my surprise, it went well! > > === > #!/usr/bin/env python > #coding=utf-8 > from mpmath import * > mpf.dps = 50 > n = 1 > k = 0 > prod = mpf(1) > while k < 10: >

Re: Help with sympy, please

2007-11-18 Thread Fredrik Johansson
On Nov 19, 2007 2:09 AM, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 18 Nov 2007 16:05:15 -0800, Dick Moores <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > TypeError: unsupported operand type(s) for /: 'float' and 'Float' > > > > > What restrict

Re: Help with sympy, please

2007-11-18 Thread Fredrik Johansson
; > Thanks, Fredrik, but I get the same error using either exp or power: > ==== > from __future__ import division > from sympy import * > from sympy import Rational as R > from sympy.numerics import * > from sympy.numerics.functions import power, exp > >

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
At 04:26 PM 11/18/2007, Fredrik Johansson wrote: >Basically, sympy.numerics is an old version of mpmath. The >sympy.numerics module is not very well integrated in SymPy, slower >than mpmath, and has a couple bugs that have subsequently been fixed >in mpmath. In sympycore (http://code.

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
>because the Float type in sympy.numerics does not implement ** for >fractional numbers. You could use the exp function in >sympy.numerics.functions instead to compute e**x. Thanks, Fredrik, but I get the same error using either exp or power: from __future__ impor

Re: Help with sympy, please

2007-11-18 Thread Fredrik Johansson
math. Your code still won't work if you convert the numbers to Floats because the Float type in sympy.numerics does not implement ** for fractional numbers. You could use the exp function in sympy.numerics.functions instead to compute e**x. Basically, sympy.numerics is an old version of mpmat

Re: Help with sympy, please

2007-11-18 Thread Dick Moores
At 03:42 PM 11/18/2007, Dennis Lee Bieber wrote: >On Sun, 18 Nov 2007 13:02:01 -0800, Dick Moores <[EMAIL PROTECTED]> >declaimed the following in comp.lang.python: > > > > > This gets: > > Traceback (most recent call last): > >File "E:\PythonWork\Untitled 5.py", line 20, in > > term = (e*

Help with sympy, please

2007-11-18 Thread Dick Moores
from __future__ import division Here's what I'm trying to do, but using sympy: = from math import e n = 1 prod = 1 k = 0 while k < 1000: k += 1 term = (e**(1.0/n))/(e**(1.0/(n+1))) prod *= term n += 2 pri