"bhargava sista" <bhargavasista@gmail.com> wrote in message <hqgql4$cm1$1@fred.mathworks.com>...
> Hi,
>
> I am using QUAD to perform a numerical integration. My function is pretty complex and is giving me a warning: 'Warning: Minimum step size reached; singularity possible.'
>
> This is resulting in a significant error for my problem. Is there any way to control the number of integration points or any other way of solving this issue? Hoping to get a solution for this problem. Thank you very much,
>
> Bhargava Sista
It is highly likely that 'quad' has indeed encountered a singularity in the integrand function, either a value approaching infinity or a derivative approaching infinity. Rather than trying to ignore the problem by trying to limit step size, my recommendation would be to attempt to find the singularity and gain an understanding of its nature. Some kinds of singularity are nonintegrable and you would therefore be attempting to obtain a finite result from an integral that is really infinite. If the singularity is actually integrable, there are often transformations of variables that can be performed that would render the problem solvable by 'quad'. The 'quad' function itself isn't intelligent enough to perform singularity analyses and devise transformations of variables for you in such situations. You have to do that for yourself.
For example, the integral from x = 0 to x = 1, of (1+x^2)/sqrt(x) with respect to x, possesses the finite answer, 8/3, even though the integrand becomes infinite at x = 0. 'quad' would have a real headache with it. If you were faced with an integrand which had a squarerootlike singularity at one end similar to this, a substitution like y = sqrt(x) could remove that singularity and make life much easier for 'quad' (and you!)
Roger Stafford
