Re: [sympy] Should symbolic integration fail gracefully?

2019-08-20 Thread Oscar Benjamin
Hi David, Can you open an issue on Github please. That's a bug that should be fixed. Oscar On Tue, 20 Aug 2019 at 21:08, David Bailey wrote: > > It seems as though the symbolic integration process fails when it can't find > a solution: > > integrate(sin(x**n),x) > Traceback (most recent call

Re: [sympy] Should symbolic integration fail gracefully?

2019-08-20 Thread Aaron Meurer
"TypeError: cannot determine truth value of Relational" generally indicates a bug in SymPy. And yes, integrate() should always return unevaluated when it can't compute the integral. Aaron Meurer On Tue, Aug 20, 2019 at 2:08 PM David Bailey wrote: > > It seems as though the symbolic integration

[sympy] Should symbolic integration fail gracefully?

2019-08-20 Thread David Bailey
It seems as though the symbolic integration process fails when it can't find a solution:  integrate(sin(x**n),x) Traceback (most recent call last):   File "", line 1, in   File "C:\SymPyWorkbook\lib\site-packages\sympy\integrals\integrals.py", line 1477, in integrate     return

Re: [sympy] Can't get sympy.functions.atan2 to work with _eval_evalf

2019-08-20 Thread Ville Bergholm
On Tuesday, August 20, 2019 at 5:43:40 PM UTC+3, Oscar wrote: > > Can you open an issue on Github for this? > > Sure: https://github.com/sympy/sympy/issues/17461 -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and

[sympy] Re: Can't get sympy.functions.atan2 to work with _eval_evalf

2019-08-20 Thread Kalevi Suominen
It seems that evalf of atan2 currently expects that its arguments are real. For symbols like x and y, this means that they have to be initialized with `real=True`. It does not suffice that evalf would return a real value as assumption code does not try to run evalf. Kalevi Suominen On Tuesday,

Re: [sympy] Can't get sympy.functions.atan2 to work with _eval_evalf

2019-08-20 Thread Oscar Benjamin
There's a "return" missing: $ git diff diff --git a/sympy/functions/elementary/trigonometric.py b/sympy/functions/elementary/trigonometric.py index 635e7f2..b7a0ad1 100644 --- a/sympy/functions/elementary/trigonometric.py +++ b/sympy/functions/elementary/trigonometric.py @@ -3070,4 +3070,4 @@ def

[sympy] Can't get sympy.functions.atan2 to work with _eval_evalf

2019-08-20 Thread Ville Bergholm
I've been trying to use sympy.Symbol to implement a system where the numerical value of a symbolic quantity is only fixed when it is evaluated using evalf(). To accomplish this I've redefined _eval_evalf() to return the aforementioned value (a fixed 5.0 in the toy example below). This works