[sympy] BooleanTrue is not True

2014-06-26 Thread Chris Smith
x.is_real is True True var('x',positive=True) x (x0) is True False x0 True type(_) class 'sympy.logic.boolalg.BooleanTrue' I understand that the above (x0) is True is False for the same reason that S(1) is 1 is False, but why don't boolean expressions use BooleanTrue, too? Is that ust

[sympy] Re: Issue with KernS

2014-06-26 Thread Chris Smith
kernS is only to keep 2*(x+y)-like expressions from turning into 2*x+2*y. What issues do you have when processing the result of parse_expr with evaluate=False? -- You received this message because you are subscribed to the Google Groups sympy group. To unsubscribe from this group and stop

Re: [sympy] BooleanTrue is not True

2014-06-26 Thread Aaron Meurer
Maybe https://github.com/sympy/sympy/blob/master/sympy/logic/boolalg.py#L81 can provide some insight here. Aaron Meurer On Thu, Jun 26, 2014 at 10:33 AM, Chris Smith smi...@gmail.com wrote: x.is_real is True True var('x',positive=True) x (x0) is True False x0 True type(_) class

Re: [sympy] solve(...) and roots(...)

2014-06-26 Thread Chris Smith
Above 0, the function is monotonic but is ill-behaved in that it is very flat; this can cause troubles for different solver routines. A slow but robust method is bisection nsolve(eq,c2,(1,1000),solver='bisect') mpf('22.964256014441664') Using that, you don't need a very precise range for the

[sympy] Re: Common Factors

2014-06-26 Thread Chris Smith
Not sure exactly what you mean, but can't you use collect? And you could pull off the coefficients to know what are potential items that can be grouped. eq=f(x).diff(x)+x*f(x).diff(x)+f(x).diff(x,2)+x*f(x).diff(x,2) collect(eq,x) x*(Derivative(f(x), x) + Derivative(f(x), x, x)) +

[sympy] Re: pattern replacement for complex numbers and manual factorization

2014-06-26 Thread Chris Smith
With existing methods you can do the following: First, to share a long expression, try filldedent. from sympy.utilities.misc import filldedent print filldedent(eq) -2*g*psi^ss_1*conjugate(psi^ss_1) - 2*g*psi^ss_2*conjugate(psi^ss_2) + omega_2 - (-k + k_2)**2/(2*m) That can be sympified by

[sympy] Getting `nan` or `oo` after subs when not simplified

2014-06-26 Thread James Crist
The code I'm working on in sympy.physics.mechanics often results in large expressions (100,000 + operations, biggest I've seen was 31,000,000 operations). Once these expressions are obtained, we often need to substitute in values/symbols (this is the operating point). However, due to the