On Thu, Aug 31, 2023 at 5:07 AM Oscar Benjamin <[email protected]> wrote: > > On Tue, 29 Aug 2023 at 07:09, Shahriar Iravanian <[email protected]> > wrote: > > > > Hi All, > > > > Hi Shahriar, > > > I have uploaded a new package, hyint, to github and PyPi. It is a hybrid > > (symbolic-numeric) integration package on top of SymPy and numpy/scipy. I > > would appreciate it if it is added to the list of projects using SymPy. > > > > You can find it at https://github.com/siravan/hyint or install it as 'pip > > install hyint'. > > > > hyint uses an ansatz generation algorithm similar to the Risch-Bronstein > > poor man's integrator combined with a sparse regression algorithm > > adopted from the Sparse identification of nonlinear dynamics (SINDy) to > > solve indefinite integration problems to univariate expressions. It can > > solve a large subset of standard elementary integrals despite a very small > > size (a few hundred lines of code). > > > > I'm one of the principal contributors to SymbolicNumericIntegartion.jl > > (https://github.com/SciML/SymbolicNumericIntegration.jl), which is a Julia > > package for symbolic-numeric integration and is the basis of hyint. > > This sounds excellent. Yes, you can add it to the list of projects > using SymPy using a pull request, I think to the website repo. > > How exactly is it different from Bronstein's poor man's integrator? > > SymPy has an integration algorithm called heurisch which is based on > the poor man's integrator but uses exact rather than approximate > solutions to the linear equations. Is exact vs approximate the main > distinction here between what hyint does and what heurisch does?
Judging from the examples, it looks like it In: hyint.integrate(1 / (x**3 - 2*x + 1), x) Out: 2.17082039324994*log(x - 1) + 1.34164078649988*log(x + 1/2 + sqrt(5)/2) - 1.17082039324993*log(x**3 - 2*x + 1) And looking at the code, I'd say a difference is that the Bronstein algorithm is more rigorous and general in how it generates its ansatz. But actually one of the reasons heurisch() is so slow is that it can generate ansatz that are huge (especially when it's given an integrand that doesn't have an answer to begin with). Employing some heuristics like the ones used here in heurisch could help it out. Actually it wouldn't be much work to generalize this to something that gives an exact answer at least some of the time. For example, you could use nsimplify() to guess at exact values for numeric coefficients. As long as diff(answer) - integrand symbolically simplifies to 0 you know you have a correct answer. Aaron Meurer > > -- > Oscar > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/CAHVvXxRyJ3FUZ1pN6GACMoHZBYGbUJAavKq5Y1RW5__1nFAT8w%40mail.gmail.com. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6LxbG%2BZ_%2B9Q6jChaw7eQHm%2B%2BkGsbC47QyTbgN4i1wMrzw%40mail.gmail.com.
