The decoupling is actually pretty easy. Unfortunately, the Sympy-specific 
stuff isn't especially useful without the context of a numerical 
integrator. 

Maybe an example will help. Say you want to numerically integrate a step 
function H(x) over the interval [-1, 1]. Most numerical integrators will 
try to fit a polynomial to this, but polynomials can't handle the jump at 
x=0 gracefully, so you end up wasting a lot of processing time trying to 
refine it. The fix is to break up the integral, and do it in two pieces, 
one from [-1, 0), and one from [0, 1]. The integrator has no trouble with 
this, so you get a very fast evaluation. Many integrators, and in 
particular scipy.integrate.quad, have this capability.

What I've done is figure out a way to get the same benefits for 
multidimensional functions. So, you could integrate H(x**2 + y**2 - z) over 
a volume, and get the same kind of efficiency. Without this, not only is 
evaluation of the integral very slow, but the results can sometimes be very 
inaccurate too. 

Anyway, from what I can tell, a similar effect could be achieved using 
mpmath, rather than SciPy. Maybe that project is a better venue. 

Thanks again!

N


On Tuesday, February 24, 2015 at 9:17:41 AM UTC-7, Joachim Durchholz wrote:
>
> Am 24.02.2015 um 17:03 schrieb Nathan Woods: 
> > Anyway, I would like to package this up in a way that would be publicly 
> > useful, but I'm not sure where it fits. Sympy seemed a likely guess, but 
> > the SciPy dependence is problematic. 
>
> Out of the box, a separate project with a dependency on both SymPy and 
> SciPy would probably fit best. 
>
>  > Alternatively, the 
> > discontinuity-processing could be decoupled and used with any iterated 
> > integrator that supports manually specified points of discontinuity. 
>
> Decoupling and putting the modules into their respective projects would 
> work, too. 
> It's much more work though. 
>
>  > If 
> > Sympy isn't a good fit for this, I would appreciate suggestions about 
> other 
> > places that might be better. 
>
> I did not fully understand your description of what your code does, so I 
> can't be very specific. 
> In general, anything that analyzes mathematical objects for properties 
> of interest that go beyond a one-shot task would be a worthy addition to 
> SymPy. 
>

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/125f4bc9-7c1d-441f-bf41-5df851379a7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to