Tim Lahey | 31 Jul 06:03 2014
Picon

SymPy vs. Sage Comparison Wiki Page

Hi,

Looking at the SymPy vs. Sage comparison page on the wiki,

https://github.com/sympy/sympy/wiki/SymPy-vs.-Sage

it's outdated at points. Most notably, it references SymPy 0.7.2 as 
upcoming. I also think we should have a ** for Graph Theory and while 
there is no support, one can use NetworkX.

Thoughts,

Tim.

--

-- 
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@...
To post to this group, send email to sympy@...
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/C9CCA964-344D-43CD-9ACD-4628469B2E0B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Meurer | 31 Jul 01:55 2014
Picon

SymPy on the frontpage of Hacker News again

https://news.ycombinator.com/item?id=8109265

Aaron Meurer

--

-- 
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@...
To post to this group, send email to sympy@...
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2BEZRKiiXAApsOU4O6aQk5HKvbQ9JTtBCWZqa1psDr65g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Gaurav Dhingra | 30 Jul 21:13 2014
Picon

newby to Sympy

I want to prepare for SymPy for GSoC could anyone guide me to the write path to be followed for beginning. So i could start some work.. Thank u in advance..

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/5157964e-bce1-414a-823a-8ce12b82999e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Stewart Wadsworth | 30 Jul 17:24 2014
Picon

Default value for Symbol

Hello,

I'm planning to use sympy for a project I'm working on and I have a few questions...

Basically I want to be able to associate a value with a symbol and then be able to evaluate any function using that symbol for the value it's been given. This would allow me to define properties in my classes as symbolic functions but also be able to get the numeric value for the function at the value specified for each symbol.

Question 1: Is there already a built in way to do this without having to call .subs() and .evalf() all over the place? (I'm pretty sure the answer is "no" but I could have overlooked something....)

Question 2: If not does this seem generally useful? Like something worth incorporating into sympy?

Question 3a: If it DOES seem like something worth incorporating: how can I help? (I'm somewhat new to programming and don't have any formal training...should I do a pull request and just do what I think is right?)

Question 3b: If it DOES NOT seem like something worth incorporating: I implemented this functionality by creating my own Symbol class and Monkey patching the Expr class (copied the code below). Am I missing something important here? I don't think this will break sympy... Is there a better way to approach this? I'm a beginner so any feedback would be appreciated!



CODE:

class dSymbol(Symbol):
    """
    Add a default value to Symbols
    """

    def __new__(cls, name, value, **assumptions):
        return super().__new__(cls, name, **assumptions)

    def __init__(self, name, value, **assumptions):
        self.default = value

"""
Monkey patch the Expr class (inherited by Mul, Add,... all the function classes in sympy i'm interested in using)
Add methods:
symvalue
value
"""

def symvalue(self):
    """
    returns the expression evaluated at the default value for each dSymbol
    the result is still symbolic in that pi will be displayed as 'pi' not '3.14159'...
    """
    s = self.atoms(dSymbol)
    for i in s:
        self = self.subs(i, i.default)
    return self

def value(self, *args, **kwargs):
    """
    returns the expression evaluated at the default value for each dSymbol
    the result will be numeric (assuming it doesn't contain any 'Symbol') 
    """
    return self.symvalue().evalf(*args, **kwargs)

Expr.symvalue = symvalue
Expr.value = value

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/b12b7e28-aff2-4168-a3a2-c9f5ee67e1ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sudhanshu Mishra | 29 Jul 04:06 2014
Picon

Missing functions in sympy.physics.vector

This question was asked on the stackoverflow.

http://stackoverflow.com/questions/25006834/missing-functions-in-sympy-physics-vector

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/37c55f74-9c47-492f-a498-efae7b047562%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Peter Chiappini | 29 Jul 02:59 2014
Picon

New to Sympy, want to add some coding theory

Hi everyone,

I am new to git and sympy, but I have read the relevant tutorials and played around with sympy a bit and think I am ready to get started. I noticed a few older topics on here about adding some support for coding theory and was wondering if anything ever came of it. If not I was hoping we could start a discussion about what would be useful to add in regards to coding theory - a lot of the framework is probably already in matrices or combinatorics under a different guise.

Peter

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/655b11ad-3cd1-4608-9d36-3f68ffb93685%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
J. S. Oishi | 28 Jul 23:29 2014
Picon

unexpected behavior with partial derivatives of order greater than one

Hi all,

I'm using sympy 0.7.4.1, and I've come across an issue I don't quite understand. If I do

from sympy import *
x,z,t = symbols('x, z, t')

psi = Function('psi')(x,z)

j1 = Derivative(psi,x) - Derivative(psi,z)

j1.subs(Derivative(psi,x), t)

I get what I expect, t - d psi/dx. However, if I do the same thing with a second derivative with respect to z, I get the following:

j2 = Derivative(psi,x) - Derivative(psi,z,2)

j2.subs(Derivative(psi,x), t)

it returns t - d^2 t/dz^2. I expect it to return t - d^2 psi/dz^2. Can anyone point me to anything I might be doing wrong? I've tried defining t as a Function, rather than as a symbol (t = Function('t')(x,z)), but that does the exact same thing. I've also tried writing the second derivative in j2 as Derivative(psi,z,z), but that also does the same thing (which I would expect).

I've found this behavior both on my computer with Python 3.3.2 and on the sympy live shell on sympy.org, which is currently SymPy 0.7.4.1 (Python 2.7.5).

Any advice you could provide would be very helpful.


thanks,


Jeff

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/34f94587-5656-4868-a6f4-8919d32d5bd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Joshua Kutsko | 24 Jul 22:35 2014

Sympy.solve Variable ordering

Hi,
I am working on a research project that requires us to solve systems of equations. We are using sympy for this, and it works very well, with one problem:
We need to solve for a specific variable (it's always the same variable), but occasionally (appears to depend on the complexity of the equations) sympy will instead return a solution for another variable in terms of the one we want instead. Since it can do this with several equations, we can't just look for the variable in each equation and then solve that. From some experimenting, it seems that the order of the variables in the list of variables to solve for changes the result of solve, but we cant figure out any pattern to when this happens, and how to order variables such that we get the one we want. Is anyone familiar enough with the inner workings of solve that they can explain this, and/or give a suggestion about how to work around it?

Thanks!

Josh Kutsko
Harvey Mudd College
Department of Computer Science

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/27a52996-7798-41aa-b747-087443d61fb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert | 22 Jul 18:56 2014
Picon

core.py file in 0.7.3 vs 0.7.4.1 diff

I notice that there are multiple lines that now create lists and do not use iteritems:


from:
        sequence = filter(None, sequence)
to: 
        sequence = list(filter(None, sequence))


multiple places where .items() is now used instead of .iteritems().

like:
                    _value = lambda expr, result: (value(**dict([ (
                        str(key)[:-1], val) for key, val in result.iteritems()]))
to:
                    _value = lambda expr, result: (value(**dict([ (
                        str(key)[:-1], val) for key, val in result.items()]))



Generally my understanding is that using iterators is preferred to creating a list especially when iterating. Is there a benefit to using items() over iteritems() for iterations?

Thanks,
Rob

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/e2a09072-2827-42bf-b7b0-34c02a573027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert | 22 Jul 18:53 2014
Picon

subs with a string, how to make this work with inheritance? Change from 0.7.3 to 0.7.4.1 ?

Hey everyone,

Let's say I defined my own sympy.Symbol called MySymbol2. For some reason subs using a string doesn't always work, but it works for sympy.Symbol.

This is version 0.7.4.1. I have a 0.7.3 example below that works fine. I see that the function fallback in core.py was changed.

from is not test on line 992 in 0.7.3:
if arg is not args[i]
to not equal test on line 1036 in 0.7.4.1:
if arg != args[i]:


    >>> class MySymbol2(sympy.Symbol): pass
    >>> expr = MySymbol2('A') * (MySymbol2('X') > 5)
    >>> print expr.subs({'X':10})
    A*(X > 5)

    >>> expr = sympy.Symbol('A') * (sympy.Symbol('X') > 5)
    >>> print expr.subs({'X':10})
    A*True


Sometimes the subs work fine. Below X and Y are both substituted for my MySymbol
    >>> expr = sympy.sympify('3*X + Y')
    >>> subsDic2 = {'X': MySymbol2('X'), 'Y': MySymbol2('Y')}
    >>> expr2 = expr.subs(subsDic2)
    >>> print [(i, type(i)) for i in expr2.atoms()]
    [(X, <class 'stats.tests.modelSymbolicTest.MySymbol2'>), (3, <class 'sympy.core.numbers.Integer'>), (Y, <class 'stats.tests.modelSymbolicTest.MySymbol2'>)]



I've tried a fix like:

class MySymbolWithNameEq(sympy.Symbol):
    def __eq__(self, other):
        if isinstance(other, sympy.Symbol):
            return self.name.__eq__(other.name)
        else:
            return sympy.Symbol.__eq__(self, other)


but that causes the subs on 3*X+Y to fail and my A*(X>5) still fails. Notice that not all the atoms are replaced. 

    >>> expr = MySymbolWithNameEq('A') * (MySymbolWithNameEq('X') > 5)
    >>> print expr.subs({'X':10})
    A*(X > 5)

    >>> subsDic3 = {'X': MySymbolWithNameEq('X'), 'Y': MySymbolWithNameEq('Y')}
    >>> expr = sympy.sympify('3*X + Y')
    >>> expr2 = expr.subs(subsDic3)
    >>> print [(i, type(i)) for i in expr2.atoms()]
    [(Y, <class 'stats.tests.modelSymbolicTest.MySymbolWithNameEq'>), (X, <class 'sympy.core.symbol.Symbol'>), (3, <class 'sympy.core.numbers.Integer'>)]

#on 0.7.3 the above works correctly
    >>> expr2 = expr.subs(subsDic3)
    >>> print [(i, type(i)) for i in expr2.atoms()]
    [(X, <class 'stats.tests.modelSymbolicTest.MySymbolWithNameEq'>), (3, <class 'sympy.core.numbers.Integer'>), (Y, <class 'stats.tests.modelSymbolicTest.MySymbolWithNameEq'>)]


Any idea how to inherit from sympy.Symbol while still getting string substitution to work reliably?


thanks,
Rob

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/574d5d01-c0ed-4fd5-97f2-ac1ff7156697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sudhanshu Mishra | 20 Jul 09:39 2014
Picon

Fwd: Science Showcase

SymPy is now under under science section of GitHub showcases! https://github.com/showcases/science

Regards
Sudhanshu Mishra



---------- Forwarded message ----------
From: Ivan Žužak <support-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org>
Date: Sun, Jul 20, 2014 at 12:38 PM
Subject: Re: Science Showcase
To: Sudhanshu Mishra <mrsud94-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


Sure thing -- we just added sympy/sympy to the science showcase. Thanks for the tip!

Cheers,
Ivan

> Hi

I think sympy/sympy makes a strong appeal for the science section of the showcase. If you also think so, please consider adding it.

Thanks!

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAFW_KCRqf%3DETg34ejR8vwQRWKDk4iR_XnJp2BJi_-Anmy%2BKMAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Gmane