Is there a workaround for this?
I have a python2 application that depends on Sympy and I'm trying to
upgrade the dependency to 0.7.3.
I've tried a few things but nothing successful yet. (Either the package
isn't found or it tries (and consequently) fails to install the python3
version.)
sympy
Hi All,
I am trying to implement the solutions for cubic Thue equation and to do
that
I have to solve cubic equations. I use `solve()` to do this. But I am
having a little
trouble filtering out real solutions from the solution list returned by
`solve()`.
I tried the following.
In [5]: from sy
The solutions are correct but the real solution is not written in a simple
form
>>> solutions = solve(2*x**3 - 3*x**2 - 3*x - 1)
>>> solutions[1].n()
2.26116669667966 - 0.e-23*I
>>> solutions = [s.expand(complex=True) for s in solutions]
>>> solutions[1]
1/2 + 3**(1/3)/2 + 3**(2/3)/2
On Wednes
I found a workaround: install Sympy from the git repo. For example:
pip install git+https://github.com/sympy/sympy.git@sympy-0.7.3
On Wednesday, 11 September 2013 20:04:47 UTC+10, Angus Griffith wrote:
>
> Is there a workaround for this?
>
> I have a python2 application that depends on Sympy and
Hi Mario,
Thank you for the reply.
`solutions = [s.expand(complex=True) for s in solutions]` worked for me,
now `im()`
and `is_real()` return the correct results.
Of course the solutions were correct, the problem was with `im()` and
`is_real()` not being
able to calculate the correct results. Ma
Consider
(F1) sqrt(1+x^3)/x
(F2) sqrt(1+1/x^3)*sqrt(x)
According to Mathematica's online integrator
(I1) integral F1 dx = (2/3)*(sqrt(x^3+1)-arctanh(sqrt(x^3+1)))
(I2) integral F2 dx =
(2*sqrt(1/x^3+1)*x^(3/2)*(sqrt(x^3+1)-arctanh(sqrt(x^3+1/(3*sqrt(x^3+1))
SymPy Live computes (I1) as
(
Hello SymPy users,
Suppose I have a = b**2, and I want to pprint:
2
a = b
How can I do it? The closest I can get is:
#!/usr/bin/python
from sympy import *
var("a b")
a = b**2
pprint({"a": a)
But it
- prints : instead of = and also
- prints ugly {} around equality (or assignme
Why this
d2bdy2 = b_i.diff(y_i, 2)exec("pprint({{'{0}': {0}}})".format("d2bdy2"))
is not equivalent to
def assign_and_pprint(Name, Expr):
exec("{Name} = {Expr}".format(Name=Name, Expr=Expr))
exec("pprint({{'{Name}': {Name}}})".format(Name=Name))
assign_and_pprint("d2bdy2", b_i.diff(
On Wed, Sep 11, 2013 at 4:04 AM, Angus Griffith <16sn...@gmail.com> wrote:
> Is there a workaround for this?
>
> I have a python2 application that depends on Sympy and I'm trying to upgrade
> the dependency to 0.7.3.
>
> I've tried a few things but nothing successful yet. (Either the package
> isn'
Hi Peter!
On Wed, Sep 11, 2013 at 7:19 AM, Peter Luschny wrote:
> Consider
>
> (F1) sqrt(1+x^3)/x
> (F2) sqrt(1+1/x^3)*sqrt(x)
>
> According to Mathematica's online integrator
>
> (I1) integral F1 dx = (2/3)*(sqrt(x^3+1)-arctanh(sqrt(x^3+1)))
> (I2) integral F2 dx =
> (2*sqrt(1/x^3+1)*x^(3/2)*(sq
On Wed, Sep 11, 2013 at 10:37 AM, Ondřej Čertík wrote:
> Hi Peter!
>
> On Wed, Sep 11, 2013 at 7:19 AM, Peter Luschny
> wrote:
>> Consider
>>
>> (F1) sqrt(1+x^3)/x
>> (F2) sqrt(1+1/x^3)*sqrt(x)
>>
>> According to Mathematica's online integrator
>>
>> (I1) integral F1 dx = (2/3)*(sqrt(x^3+1)-arct
It's because the string form of the expression contains division of
numeric literals, which exec evaluates to floats. If you want to avoid
this, you should use sympify(), or use the srepr() form of the
expression instead of the str() form.
Aaron Meurer
On Wed, Sep 11, 2013 at 7:51 AM, Boris Kheyf
Use Eq(), like Eq(a, b**2).
Aaron Meurer
On Wed, Sep 11, 2013 at 7:24 AM, Boris Kheyfets wrote:
> Hello SymPy users,
>
> Suppose I have a = b**2, and I want to pprint:
>
> 2
> a = b
>
> How can I do it? The closest I can get is:
>
> #!/usr/bin/python
>
> from sympy import *
>
> var("a b")
>
On Wed, Sep 11, 2013 at 11:23 AM, Aaron Meurer wrote:
> On Wed, Sep 11, 2013 at 10:37 AM, Ondřej Čertík
> wrote:
>> Hi Peter!
>>
>> On Wed, Sep 11, 2013 at 7:19 AM, Peter Luschny
>> wrote:
>>> Consider
>>>
>>> (F1) sqrt(1+x^3)/x
>>> (F2) sqrt(1+1/x^3)*sqrt(x)
>>>
>>> According to Mathematica's
is_real should return the right thing regardless of the form of the
expression. See also
https://code.google.com/p/sympy/issues/detail?id=4011.
I would avoid expanding unless that's the only way to tell. Also note
that in general, the real solution from a cubic cannot be written
without a nested I
With your example, it matters what order you substitute the variables.
If you substitute vx=0 first, you get 0/sqrt(vy**2 + vz**2) == 0. If
you substitute vy=vz=0, you get vx/sqrt(vx**2), which should simplify
to sqrt(vx) for vx >= 0 (which it is, since vx=0). Can you assume
nonnegative for these v
At https://github.com/sympy/sympy/pull/2128 the algorithms are
implemented to simplify this, namely
In [1]: a = integrate(sqrt(1 + x**3)/x)
In [2]: minpoly(a.diff(x) - sqrt(1 + x**3)/x)
Out[2]: x
This means that the input satisfies the polynomial x=0, i.e., it is
identically 0.
This hasn't been
I think a really common example that came up in mechanics was with trig
expressions. Here's a simple example (simple relative to actual mechanics
expressions):
sin(q1(t))*sin(q2(t))*cos(q1(t)) / (sin(q1(t))*sin(q2(t)) +
sin(q1(t))*cos(q2(t)))
When I substitute in q1(t) = 0, q2(t) = 0, I get nan.
Thanks Aaron. The main assumption that we can make for our package is that
these variables are real numbers, so that will still leave us with divide
by zero issues. Maybe once I have a list of expressions that are common to
our problems, we can figure out how to deal with that subset.
Jason
moore
Thanks for a reply. I tried it, but:
exec("{Name} = sympify({Expr})".format(Name=Name, Expr=Expr))
gives the same, and
exec(sympify("{Name} = {Expr}".format(Name=Name, Expr=sympify(Expr
gives an error...
On Wed, Sep 11, 2013 at 9:29 PM, Aaron Meurer wrote:
> It's because the string f
Cool thanks.
On Wed, Sep 11, 2013 at 9:30 PM, Aaron Meurer wrote:
> Use Eq(), like Eq(a, b**2).
>
> Aaron Meurer
>
> On Wed, Sep 11, 2013 at 7:24 AM, Boris Kheyfets
> wrote:
> > Hello SymPy users,
> >
> > Suppose I have a = b**2, and I want to pprint:
> >
> > 2
> > a = b
> >
> > How can I
It should only evaluate to zero if the limit of the expression with respect
to the evaulated variables goes to zero. 1/x, for example, would not be one
that should evaluate to zero. But it would certainly be interesting to know
if our operations plus dervitives in mechanics, only ended up with
expr
On Wed, Sep 11, 2013 at 3:55 PM, F. B. wrote:
> OK, now I have come to the generalized case. As of now we have two
> algorithms in SymPy's master:
>
> Kahane's algorithm
> gamma trace algorithm for simplified expressions (simplified = no Lorentz
> contractions)
Excellent!
>
> There are some limi
I'm not sure what's causing this, but solve seems to want to call small
constants zero:
In [1]: from sympy import *
In [2]: E,m,c=symbols('E,m,c')
In [3]: Energy=Eq(E,m*c**2)
In [4]: solve(Energy,E)
Out[4]: [c**2*m]
In [5]: E2=Energy.subs(c,3e8)
In [6]: solve(E2,E)
Out[6]: [9.0e+16*m]
In [7]:
OK, now I have come to the generalized case. As of now we have two
algorithms in SymPy's master:
1. Kahane's algorithm
2. gamma trace algorithm for simplified expressions (simplified = no
Lorentz contractions)
There are some limitations, namely:
1. in dimensional regularization,
This appears to have been introduced in 0.7.3. I reverted to 0.7.2 and get
the expected results.
On Wednesday, September 11, 2013 3:27:22 PM UTC-7, G B wrote:
>
> I'm not sure what's causing this, but solve seems to want to call small
> constants zero:
>
> In [1]: from sympy import *
> In [2]:
Hello,
Due to an up coming conference and a need to get my code in a working
state, I have taken a brute force approach which seems to be working pretty
well (I am in the middle of testing it). I am very much interested in
working with Matt's advice on building up the ODE function from Theano
v
Hello!
Here is a CGI script:
#!/usr/bin/python
# Import modules for CGI handling
import cgi, cgitb
# from __future__ import division
# from sympy import init_printing integrate Symbol exp cos erf
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
first_name
Hi!
I'm trying to run sympy from a Python cgi script.
This is what I have:
#!/usr/bin/python
# Import modules for CGI handling
import cgi, cgitb
# from __future__ import division
# from sympy import init_printing integrate Symbol exp cos erf
# Create instance of FieldStorage
form = cgi.Fiel
On Wed, Sep 11, 2013 at 4:04 PM, wrote:
> Today's Topic Summary
>
> Group: http://groups.google.com/group/sympy/topics
>
>- pip install broken for python 3.3 <#1410c95d4814c66b_group_thread_0>[1
> Update]
>- PyDy Visualization Milestone <#1410c95d4814c66b_group_thread_1> [1
>Update
You're right. For some reason (lack of sleep?) I assumed setuptools used
pip (but actually it uses easy_install).
The actual problem is with setuptools (maybe this is a known problem?).
I repeated the steps in the gist (virtualenv etc) with a basic setup.py and
it still happens: http://pastebin
Yes, unfortunately, it doesn't seem to be possible to make separate
Python 2/3 tarballs work with easy_install. This will be fixed in the
next version because we have moved to a single codebase for the two,
so there will no longer be separate tarballs.
Aaron Meurer
On Wed, Sep 11, 2013 at 10:58 P
32 matches
Mail list logo