how to override the solver function in sympy?
--
https://mail.python.org/mailman/listinfo/python-list
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
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
>
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
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
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
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
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
>
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
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,
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
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
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
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
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
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
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
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
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
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
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
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',
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,
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
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
>>>
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
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
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&
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 "
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
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
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
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
> 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
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
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
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
wrote:
>
> > > > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote:
>
> > > > > Notice anything funny about the "random" choices?
>
> > > > > import sympy
> > > > > import time
> > > > > import r
TECTED]> wrote:
>
> > > > Notice anything funny about the "random" choices?
>
> > > > import sympy
> > > > import time
> > > > import random
>
> > > > f = [i for i in sympy.primerange(1000,1)]
>
> >
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
>>
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
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
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
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.
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
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
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)
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 (
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.
. 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 *
> >
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:
>
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
;
> 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
>
>
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.
>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
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
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*
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
73 matches
Mail list logo