Re: [sympy] Re: modify latex representation of user-defined function

2014-06-14 Thread Aaron Meurer
You may want to subclass gamma (the original SymPy version) instead of Function, so that you keep all the gamma behavior. Aaron Meurer On Fri, Jun 6, 2014 at 4:37 PM, Björn Dahlgren bjo...@gmail.com wrote: On Friday, 6 June 2014 23:13:39 UTC+2, Andrei Berceanu wrote: I define a function

Re: [sympy] Solving for undetermined coefficients

2014-06-14 Thread Aaron Meurer
There is a solve_undetermined_coefficients() function. Aaron Meurer On Sun, Jun 8, 2014 at 8:36 AM, Avichal Dayal avichal.da...@gmail.com wrote: How do I solve for undetermined coefficients in equations like:- eq =a[0]*cos(x) + (a[1] - 1)*sin(x) solve(eq, a[0], a[1]) [{a₀: (-a₁ +

Re: [sympy] type of a defined function

2014-06-14 Thread Aaron Meurer
On Tue, Jun 10, 2014 at 8:13 AM, Anton Akhmerov anton.akhme...@gmail.com wrote: Hi Ondrej and Aaron, Thanks for the replies. On Tuesday, June 10, 2014 8:38:15 AM UTC+2, Ondřej Čertík wrote: Agreed, we should do that. In C++, which allows even less freedom than Python, I just created a

[sympy] Problem with parsing of an expression

2014-06-14 Thread Peter
hallo everybody, I've got following script in an .py file: import sys from sympy import * from sympy.parsing.sympy_parser import * transformations=(standard_transformations + ( implicit_multiplication_application,) + (function_exponentiation,)) param1=parse_expr(sys.argv[1],

Re: [sympy] Re: Convert from a system of linear equations to a matrix

2014-06-14 Thread James Crist
It's just the convention I'm most used to. Systems that can be expressed as A*x = B I usually solve for x, or if A isn't square, the least squares solution x. In both cases you need A and B in this form. I suppose Ax + B could seem more natural though. On Friday, June 13, 2014 6:45:48 PM

Re: [sympy] Problem with parsing of an expression

2014-06-14 Thread Aaron Meurer
I think you are missing the transformation that maps ^ to exponentiation. The -x is really because it thinks it is Not(x), i.e., Xor(x, 2). Aaron Meurer On Sat, Jun 14, 2014 at 6:23 PM, Peter peter.ma...@fit4exam.de wrote: hallo everybody, I've got following script in an .py file: import

Re: [sympy] Re: Convert from a system of linear equations to a matrix

2014-06-14 Thread Aaron Meurer
Oh, of course. B is on the rhs. This is probably more natural to me too. Should we make a convenience function that does this? I think this use of jacobian would be lost on most people. Aaron Meurer On Sat, Jun 14, 2014 at 6:29 PM, James Crist crist...@umn.edu wrote: It's just the convention

Re: [sympy] Problem with parsing of an expression

2014-06-14 Thread Peter
Hi Aaron, thanks for the quick answer! Ok. but I already included function_exponentiation. Is there a further module I have to include? Peter Am Sonntag, 15. Juni 2014 01:41:21 UTC+2 schrieb Aaron Meurer: I think you are missing the transformation that maps ^ to exponentiation. The -x is

Re: [sympy] Problem with parsing of an expression

2014-06-14 Thread Aaron Meurer
I think that is just for letting sin**2 x map to sin(x)**2. It must be a different one that maps ^ to **. Aaron Meurer On Sat, Jun 14, 2014 at 6:45 PM, Peter peter.ma...@fit4exam.de wrote: Hi Aaron, thanks for the quick answer! Ok. but I already included function_exponentiation. Is there a

[sympy] Re: Problem with parsing of an expression

2014-06-14 Thread Peter
Ok, i did a PHP workaround before posting the Value to sympy $VarPost=str_replace(^, **, $param1); Now it works! Thanks for your help! I believe that this is an necessary tool to implement py standard to sympy. CU Peter Am Sonntag, 15. Juni 2014 01:23:50 UTC+2 schrieb Peter: hallo

Re: [sympy] Re: Problem with parsing of an expression

2014-06-14 Thread Aaron Meurer
I think you want the convert_xor transformation. Aaron Meurer On Sat, Jun 14, 2014 at 7:00 PM, Peter peter.ma...@fit4exam.de wrote: Ok, i did a PHP workaround before posting the Value to sympy $VarPost=str_replace(^, **, $param1); Now it works! Thanks for your help! I believe that