Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Warning Using QUAD

Subject: Warning Using QUAD

From: bhargava sista

Date: 19 Apr, 2010 05:45:08

Message: 1 of 3

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

Subject: Warning Using QUAD

From: Roger Stafford

Date: 19 Apr, 2010 06:53:05

Message: 2 of 3

"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 non-integrable 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 square-root-like 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

Subject: Warning Using QUAD

From: Roger Stafford

Date: 19 Apr, 2010 07:08:04

Message: 3 of 3

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <hqgukh$fi3$1@fred.mathworks.com>...
> ......
> 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.
> ......
---------
  Oops! I erred on the above integral. It should be 12/5. (My old calculus instructor would have given me a scolding for getting a simple integral like that wrong.)

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us