Re: Issue 3545 in sympy: solving a complicated expression with square roots

2012-12-02 Thread sympy
Comment #1 on issue 3545 by asmeu...@gmail.com: solving a complicated expression with square roots http://code.google.com/p/sympy/issues/detail?id=3545 So the issue here is 1. Can we get solve() to return something simpler? 2. solve() just hangs unless you call it with simplify=False and

Re: Issue 3545 in sympy: solving a complicated expression with square roots

2012-12-02 Thread sympy
Comment #2 on issue 3545 by asmeu...@gmail.com: solving a complicated expression with square roots http://code.google.com/p/sympy/issues/detail?id=3545 I missed the last part of the pastebin: The reflection of f over g is then given in parameterized form as x(m) = q y(m) =

Issue 3546 in sympy: 0*x

2012-12-02 Thread sympy
Status: Valid Owner: Labels: Type-Defect Priority-Medium New issue 3546 by smi...@gmail.com: 0*x http://code.google.com/p/sympy/issues/detail?id=3546 0*x 0 0*oo nan The x and all factors for which is_finite is not True should be retained in a product so that a proper determination

Re: Issue 3546 in sympy: 0*x

2012-12-02 Thread sympy
Comment #1 on issue 3546 by asmeu...@gmail.com: 0*x http://code.google.com/p/sympy/issues/detail?id=3546 I think this was discussed before. If 0*x remained unevaluated, then nothing would work like you want it to. x - x would not go to 0. Try making the change in the core and seeing how

Issue 3547 in sympy: Undefined functions with number arguments should have is_number be False

2012-12-02 Thread sympy
Status: Valid Owner: Labels: Type-Defect Priority-Medium New issue 3547 by smi...@gmail.com: Undefined functions with number arguments should have is_number be False http://code.google.com/p/sympy/issues/detail?id=3547 Function('f')(1).is_number True Perhaps it would be better to

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

2012-12-02 Thread Chris Smith
What about this? class Syms(object): Return an Indexed object with name given at instantiation. Indexing can be done using matrix or function notation. Examples from sympy.future import Syms a=Syms('a') a[1] a[1] a(1) a[1] a(i,k)

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

2012-12-02 Thread Shriramana Sharma
On Sun, Dec 2, 2012 at 9:46 AM, Chris Smith smi...@gmail.com wrote: I don't follow you...if the function or Indexed has a different name then it's different from others, and if the argument(s) of any function or Indexed are different they represent different objects.

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

2012-12-02 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} On Sun, Dec 2, 2012 at 6:59 AM, Chris Smith smi...@gmail.com wrote: eqs=Tuple(*([A[0] + 5*A[1] - 2, -3*A[0]+ 6*A[1] -

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

2012-12-02 Thread Shriramana Sharma
Sorry for the extra mail! On Sun, Dec 2, 2012 at 10:04 PM, Shriramana Sharma samj...@gmail.com wrote: Hi can you clarify why you have used a * inside the Tuple constructor in both the above cases and why the additional () around the [] containing the list in the second case? The Tuple

Re: [sympy] Lambdify with high-prec constants

2012-12-02 Thread Freddie Witherden
On 02/12/12 16:07, Stefan Krastanov wrote: I do not think that the sympy's lambdify function is a good fit here. It is mainly used for translating sympy expressions to something faster but not as precise (python math or numpy). It is strange to use it to translate something from sympy back to

[sympy] Issues with plotting and small complex numbers

2012-12-02 Thread Matthew Rocklin
I'm trying to plot a statistical expression using the following code from sympy.stats import * X = StudentT(X, 50) t = Symbol('t', positive=True) plot(simplify(E(exp(I*t*X))), (t, 1e-6, 1e-2)) and I get this error -- 455 elif p[1] is None or q[1] is None or not flat(p,

[sympy] Re: Issues with plotting and small complex numbers

2012-12-02 Thread Stefan Krastanov
presumably just surrounding your expression with re() should do the job. The error seems to be a bug in the adaptive sampling so switching off (with a kwarg) should solve the problem. Concerning the complex numbers, originally whenever a complex number was encountered we plotted only the real

[sympy] Re: Issues with plotting and small complex numbers

2012-12-02 Thread Stefan Krastanov
Just confirmed: the error is within the adaptive sampling routine: plot(re(E(exp(I*t*X))), (t, 1e-6, 1e-2), adaptive=False) results in the attached file On 2 December 2012 19:15, Stefan Krastanov krastanov.ste...@gmail.com wrote: presumably just surrounding your expression with re() should do

[sympy] Re: Issues with plotting and small complex numbers

2012-12-02 Thread Matthew Rocklin
Awesome. How about for very small numbers? plot(re(simplify(E(exp(I*t*X, (t, 1e-30, 1e-26)) On Sun, Dec 2, 2012 at 12:29 PM, Stefan Krastanov krastanov.ste...@gmail.com wrote: Just confirmed: the error is within the adaptive sampling routine: plot(re(E(exp(I*t*X))), (t, 1e-6, 1e-2),

Re: [sympy] Lambdify with high-prec constants

2012-12-02 Thread Aaron Meurer
On Dec 2, 2012, at 10:21 AM, Freddie Witherden fred...@witherden.org wrote: On 02/12/12 16:07, Stefan Krastanov wrote: I do not think that the sympy's lambdify function is a good fit here. It is mainly used for translating sympy expressions to something faster but not as precise (python math

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

2012-12-02 Thread Aaron Meurer
Of you have a tuple literal, it's redundant. Tuple(*(1,2)) is the same as Tuple(1,2). But if you have a variable, you have to use Tuple(*a). Aaron Meurer On Dec 2, 2012, at 9:34 AM, Shriramana Sharma samj...@gmail.com wrote: On Sat, Dec 1, 2012 at 5:07 PM, Chris Smith smi...@gmail.com wrote:

Re: [sympy] Re: Issues with plotting and small complex numbers

2012-12-02 Thread Aaron Meurer
On Dec 2, 2012, at 12:37 PM, Stefan Krastanov krastanov.ste...@gmail.com wrote: The plotting module uses numpy floats so it will fail on very small number or on small intervals. Even worse, the main plotting backend, namely matplotlib, also uses machine precision, so even if we do the

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

2012-12-02 Thread Chris Smith
I found out from the Python documentation that * unpacks lists, but my question about the extra () in the second example still stands... It unpacks tuples, too. -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to

Re: [sympy] setup.py develop ?

2012-12-02 Thread Rathmann
Great. I first had to install setuptools, but then this worked fine. (At least on Linux. I haven't tried Windows or Mac.) I was going to put in a change to the doc, but I see someone has already beaten me to it -- thanks. Just so I am clear on the concept - After doing this you can just

Re: [sympy] setup.py develop ?

2012-12-02 Thread Aaron Meurer
On Sun, Dec 2, 2012 at 5:47 PM, Rathmann pkrathma...@gmail.com wrote: Great. I first had to install setuptools, but then this worked fine. (At least on Linux. I haven't tried Windows or Mac.) I was going to put in a change to the doc, but I see someone has already beaten me to it --

[sympy] How to find out the matrices that solve produces to solve a set of equations

2012-12-02 Thread Shriramana Sharma
Hello. I have the following equations (all equal to zero) which I am able to solve using SymPy for the Ep,De and La subscripted variables after supplying the DeltaP() DeltaQ() and mu values: 2*Ep(0)/7 + Ep(1)/7 + 2*Ep(2)/35 + Ep(3)/70 - La(3) Ep(0)/7 + 6*Ep(1)/35 + 9*Ep(2)/70 + 2*Ep(3)/35 +

Re: [sympy] How to find out the matrices that solve produces to solve a set of equations

2012-12-02 Thread Chris Smith
I don't think there is a way to get back the matrices for the input equations, but I think the following will give you what you want. It can be streamlined, but you can see the steps below: eqs=Tuple(*eqs) eqs.atoms(Function) set([La(3), Ep(0), DeltaQ(1, 0), DeltaQ(0, 0), Ep(2), Ep(3), De(2),

Re: [sympy] How to find out the matrices that solve produces to solve a set of equations

2012-12-02 Thread Chris Smith
If you could take a moment to look over https://github.com/sympy/sympy/pull/1682 you can solve for indexed quantities without having to do the dummy substitution yourself. -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email