[SciPy-User] Problems with scipy.integrate.quad and sinusoidal weights

Per Nielsen evilper@gmail....
Fri Sep 28 09:02:36 CDT 2012


>
>
> the weight function is automatically added
>
> >>> integrate.quad(lambda x: np.exp(-x)*np.sin(100*x), 0., 10., args=())
> Warning: The maximum number of subdivisions (50) has been achieved.
>   If increasing the limit yields no improvement it is advised to analyze
>   the integrand in order to determine the difficulties.  If the position
> of a
>   local difficulty can be determined (singularity, discontinuity) one will
>   probably gain from splitting up the interval and calling the integrator
>   on the subranges.  Perhaps a special-purpose integrator should be used.
> (0.0099990111781434986, 0.00068140460275433325)
>
> >>> integrate.quad(lambda x: np.exp(-x), 0., 10., args=(), weight='sin',
> wvar=100.)
> (0.0099987410521618428, 7.0983734843630013e-10)
>
> (I never used wvar before, just guessing
>
> Josef
>
>
Ahh, you are completely right. I was thinking that weight function meant
what basis function it used in the numerical integration, but of course it
simply multiply it to the integrand.

Thanks for making that clear to me :)

Per



> > Cheers,
> > Per
> >
> >
> >
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-User@scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user
> >
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120928/aa0a7636/attachment.html 


More information about the SciPy-User mailing list