Re: Issue 3544 in sympy: binomial should not get expanded except when expand(func=True) is called on it

2012-12-01 Thread sympy
Updates: Status: Valid Labels: Simplify Comment #1 on issue 3544 by asmeu...@gmail.com: binomial should not get expanded except when expand(func=True) is called on it http://code.google.com/p/sympy/issues/detail?id=3544 Specifically, things like binomial(n, 5) should not auto

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Shriramana Sharma
On Sun, Nov 18, 2012 at 10:03 PM, Chris Smith smi...@gmail.com wrote: Hey very nice, but I actually want to later on substitute values for lamb0..3, and if lamb is an undefined function as the above, how do I do that? f=Function('f') f(1)+f(2) f(1) + f(2) _.replace(f, lambda x: x**2) Hi

Re: [sympy] Help with using Matrix on x.y pair

2012-12-01 Thread Shriramana Sharma
Hello and returning to this previous thread started by me: On Tue, Nov 13, 2012 at 2:25 AM, Stefan Krastanov krastanov.ste...@gmail.com wrote: But we can address this problem when we get an idea of the rest of what you are trying to do. Square_matrix_of_known_reals * Vector_of_unknown_pairs =

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Chris Smith
eqs=Tuple(*[A(0) + 5*A(1) - 2, -3*A(0) + 6*A(1) - 15]) solve(eqs, eqs.atoms(Function)) {A(0): -3, A(1): 1} -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group,

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Shriramana Sharma
On Sat, Dec 1, 2012 at 5:07 PM, Chris Smith smi...@gmail.com wrote: eqs=Tuple(*[A(0) + 5*A(1) - 2, -3*A(0) + 6*A(1) - 15]) solve(eqs, eqs.atoms(Function)) {A(0): -3, A(1): 1} Hi thanks for this! So does this mean that there is no need for separate support for subscripted symbolic variables in

Re: [sympy] RFC: should Rational accept floats?

2012-12-01 Thread Christophe BAL
Hello, from mathematical point of view, the floats are a kind of approximations. So if someone wants to have a rational form of one float, I think that it could be better that this user must convert first the float to one decimal and then to one rational. Not user friendly but more precise. I

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Chris Smith
Hi thanks for this! So does this mean that there is no need for separate support for subscripted symbolic variables in SymPy? If the functions work, then no. But functions don't carry assumptions. Having you raise questions like this helps to flesh out situations where existing or new

Re: [sympy] RFC: should Rational accept floats?

2012-12-01 Thread Chris Smith
On Sat, Dec 1, 2012 at 5:33 PM, Christophe BAL projet...@gmail.com wrote: Hello, from mathematical point of view, the floats are a kind of approximations. So if someone wants to have a rational form of one float, I think that it could be better that this user must convert first the float to

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Shriramana Sharma
On Sat, Dec 1, 2012 at 5:32 PM, Chris Smith smi...@gmail.com wrote: If the functions work, then no. But functions don't carry assumptions. Can you clarify what you mean by assumptions? And even though it seems (I haven't yet implemented that part of my program yet) that it would be sufficient

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Chris Smith
On Sat, Dec 1, 2012 at 6:42 PM, Shriramana Sharma samj...@gmail.com wrote: On Sat, Dec 1, 2012 at 5:32 PM, Chris Smith smi...@gmail.com wrote: If the functions work, then no. But functions don't carry assumptions. Can you clarify what you mean by assumptions? And even though it seems (I

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Shriramana Sharma
On Sat, Dec 1, 2012 at 6:46 PM, Chris Smith smi...@gmail.com wrote: that's what symbols does for you; just store the result in an array if you want: a=symbols('a:11') a[1] a1 a (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) But I already said that I can't use a Python list because I can't

Re: [sympy] Help with using Matrix on x.y pair

2012-12-01 Thread Matthew Rocklin
Matrices can hold any type that inherits from Basic, the core SymPy type. Matrix operations will often assume that these types have associated + and * operators. Many of the algorithms of matrices assume that the elements of a matrix are SymPy expression objects (scalars). From what you say the

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Matthew Rocklin
I ran into this problem in MatrixExprs. We don't currently have a subscripted symbol. It would be nice though. In the following example In [1]: X = MatrixSymbol('X', n, n) In [2]: X[1, 2] Out[2]: X₁₂ Ideally X[1, 2] is a Symbol that contains separate information for its origin X and its

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Rishabh Dixit
Hi, I tried python lists and every thing seems fine to me- ls=symbols('a:10') ls (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) Now I call a function Sum (it sums up a series in particular, infinite series)- for i in range(10): ... Sum(1/(ls[i]**ls[i]),(ls[i],1,oo)).evalf() ... 1.29128599706266

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Shriramana Sharma
On Sat, Dec 1, 2012 at 8:22 PM, Rishabh Dixit rishabhdixi...@gmail.com wrote: for i in range(10): ... Sum(1/(ls[i]**ls[i]),(ls[i],1,oo)).evalf() ... solve([ls[0]+5*ls[1]-2,-3*ls[0]+6*ls[1]-15]) {a0: -3, a1: 1} Rishabh, basically the difference between what you are saying and I am saying

[sympy] setup.py develop ?

2012-12-01 Thread Rathmann
Hi, On the install page of the documentation http://docs.sympy.org/0.7.2/install.html#git , it talks about If you want to install SymPy, but still want to use the git version, you can run from your repository: $ setup.py develop But, at least when I try it, setup.py it complains of an

Re: [sympy] setup.py develop ?

2012-12-01 Thread Dhia Eddine
try : python setup.py develop On 1 December 2012 09:07, Rathmann pkrathma...@gmail.com wrote: Hi, On the install page of the documentation http://docs.sympy.org/0.7.2/install.html#git , it talks about If you want to install SymPy, but still want to use the git version, you can run from

Re: [sympy] setup.py develop ?

2012-12-01 Thread Rathmann
Thanks. But that is what I tried? python setup.py develop usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'develop' This is the setup.py in the

Re: [sympy] setup.py develop ?

2012-12-01 Thread Sean Vig
On Sat, Dec 1, 2012 at 12:26 PM, Rathmann pkrathma...@gmail.com wrote: Thanks. But that is what I tried? python setup.py develop usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd

Re: [sympy] setup.py develop ?

2012-12-01 Thread Rishabh Dixit
You might need sudo python setupegg.py develop if you are not already root. On Sat, Dec 1, 2012 at 11:59 PM, Sean Vig sean.v@gmail.com wrote: On Sat, Dec 1, 2012 at 12:26 PM, Rathmann pkrathma...@gmail.com wrote: Thanks. But that is what I tried? python setup.py develop usage:

[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.

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Aaron Meurer
On Dec 1, 2012, at 6:31 AM, Shriramana Sharma samj...@gmail.com wrote: On Sat, Dec 1, 2012 at 6:46 PM, Chris Smith smi...@gmail.com wrote: that's what symbols does for you; just store the result in an array if you want: a=symbols('a:11') a[1] a1 a (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,

Re: [sympy] Lambdify with high-prec constants

2012-12-01 Thread Aaron Meurer
I think you should use a Symbol for f in your expression, and then add {'f': mpf(...)} to the namespace dict used by lambdify. Aaron Meurer On Dec 1, 2012, at 4:14 PM, Freddie Witherden fred...@witherden.org wrote: Hi all, Consider (with mp.dps = 30): f =

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Chris Smith
If you work with the current master you won't get the Indexed error: from sympy import IndexedBase A=IndexedBase('A') solve([A[0] + 5*A[1] - 2, -3*A[0]+ 6*A[1] - 15]) [] But no solution...so let's try the Tuple-atoms trick: eqs=Tuple(*([A[0] + 5*A[1] - 2, -3*A[0]+ 6*A[1] - 15]))

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Shriramana Sharma
On Sun, Dec 2, 2012 at 6:59 AM, Chris Smith smi...@gmail.com wrote: If you work with the current master you won't get the Indexed error: from sympy import IndexedBase A=IndexedBase('A') solve([A[0] + 5*A[1] - 2, -3*A[0]+ 6*A[1] - 15]) [] But no solution...so let's try the Tuple-atoms

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Shriramana Sharma
On Sat, Dec 1, 2012 at 7:13 PM, Matthew Rocklin mrock...@gmail.com wrote: In the following example In [1]: X = MatrixSymbol('X', n, n) In [2]: X[1, 2] Out[2]: X₁₂ Ideally X[1, 2] is a Symbol that contains separate information for its origin X and its indices, 1, and 2. Alas, all it knows

Re: [sympy] How to define a symbolic function which involves another function

2012-12-01 Thread Chris Smith
On Sun, Dec 2, 2012 at 7:58 AM, Shriramana Sharma samj...@gmail.com wrote: On Sun, Dec 2, 2012 at 6:59 AM, Chris Smith smi...@gmail.com wrote: If you work with the current master you won't get the Indexed error: from sympy import IndexedBase A=IndexedBase('A') solve([A[0] + 5*A[1] - 2,