SymPy Integration Query

76 views
Skip to first unread message

Andreu Bernad Serra

unread,
Jun 8, 2022, 7:36:00 AM6/8/22
to sympy
Hello Everyone!

I've been trying to use SymPy to derive thermodynamic properties but I'm facing some problems with the integration. The problem in particular can be seen in the attached figure and the simplified jupyter notebook.  

SymPy Integration Query.png

Instead, I can do the integration by manually separating the terms:

SymPy Integration Query - Manual Integration.png

For sure, there is something that I'm doing wrong!
Thanks a lot!
Andreu 
SymPy Integration Query.ipynb

gu...@uwosh.edu

unread,
Jun 8, 2022, 12:59:29 PM6/8/22
to sympy
I am not sure you are doing anything wrong. I tried it and it appears that you are running up against an inefficiency in the integrator. More investigation would be necessary to figure out why it is taking so long.

I can reproduce a very long run time (>5 minutes, at which point I stopped the process).

Jonathan

Aaron Meurer

unread,
Jun 8, 2022, 4:50:52 PM6/8/22
to sy...@googlegroups.com
It would be helpful if you could paste the expressions here rather than using a screenshot (use print() on them to get a string representation). That way we could easily reproduce the issue. 

Also, as Jonathan mentioned, this does indeed look like a bug. SymPy should be able to integrate rational functions without any problems. So I would suggest opening an issue for this. https://github.com/sympy/sympy/issues

Finally, when something hangs like this, it helps to interrupt it after it has been running for a while and to include the traceback, so we can get an idea of where it is getting stuck. 

Aaron Meurer

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/0d63a825-860c-4edc-914c-1741341d83fan%40googlegroups.com.

Andreu Bernad Serra

unread,
Jun 9, 2022, 2:03:40 AM6/9/22
to sympy
Jonathan and Aaron, thanks for your replies. As suggested, I'll open an issue and paste all the expressions with the appropriate traceback. 

Andreu

Reply all
Reply to author
Forward
0 new messages