cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Singularities ignored by numerics

rmix22-disabled
1-Newbie

Singularities ignored by numerics

Sometimes Mathcad's MC14_M030) numeric ignores singularities whilst the symbolic knows better.
No clue why it gets it right with 1/x+x and not with 1/x-x.
Same faulty behaviour if you do the integral of cot(x), which has a similar singularity at 0.

RMix
3 REPLIES 3

You shouldn't even try to integrate over a singularity. Numeric evaluation is just that -- numeric. There is no analysis of the form of the integrand, only the evaluation at selected points. The actual points chosen for evaluation are somewhat random and unpredictable. If they do not include points that represent significant features of the integrand, the results will be in error, That is the nature of numeric integration. It works for nice well behaved integrands. Only.
__________________
� � � � Tom Gutman

>You shouldn't even try to
>integrate over a singularity.
Sure, but its legitimate to have the desire that a math tool would detect that.

>Numeric evaluation is just
>that -- numeric. There is no
>analysis of the form of the
Hmmmm - you are right. I tend to agree and don't think of it being a bug anymore. After all the symbolic catches the failure correctly and the numeric should not be supposed to do so.
Interesting that as shown with very similar integrands it still sometimes worked and then not.

RMix

On 2/19/2010 10:09:40 AM, rmix22 wrote:

>Interesting that as shown with
>very similar integrands it
>still sometimes worked and
>then not.

The numeric integration divides the integrand into sections using one of several methods. If a boundary falls on a singularity it will fail because it can't evaluate the integrand there. The default algorithm is "adaptive", and I do not know of any way to predict where the boundaries will be. If you change the integration method to "Romberg", your last example will fail. If you read the help about the Romberg method, you will see why: the first step is to divide the integrand into four subintervals, so the boundaries will be at -1/2, 0, and 1/2.

Richard
Top Tags