Skip to main content
17-Peridot
March 8, 2011
Solved

No roots today ?!

  • March 8, 2011
  • 3 replies
  • 12336 views

Hi MC folks,

I've got this data in which I'd like to find all roots by using the Match function. Problem is that only an incomplete subset of the roots is identified - see attached sheet.

Does anybody has a clue why this happens?

Cheers

Raiko

P.S. The attached sheet is in MC12 but the original has been made by MC15!

Best answer by AlanStevens

Here's how I'd find the roots. It would be easy to interpolate, though I've just picked off the value nearest to zero (interpolating on an index number doesn't seem very sensible!)

Alan

3 replies

March 8, 2011

Hi Raiko,

MC12 doesn't accept the "near" parameter but looks like you need to define what is "near" enough.

I've changed the TOL on your sheet & it finds what it thinks is zero in diminishing ranges.

regards

Andy

23-Emerald V
March 8, 2011

Raiko Milanovic wrote:

Hi MC folks,

I've got this data in which I'd like to find all roots by using the Match function. Problem is that only an incomplete subset of the roots is identified - see attached sheet.

Does anybody has a clue why this happens?

Cheers

Raiko

P.S. The attached sheet is in MC12 but the original has been made by MC15!

As Andy says, 'near' isn't quite near enough. If you want to leave TOL alone, then you can use 'range' instead of near to set your criteria. However, it's not a particularly effective way of finding the roots (zero-crossing points) because there are quite a few points that are 'near' zero, but don't represent a root. I've attached a crude zero-crossing function to show the difference. I think Richard may have posted something better?

Stuart

1-Visitor
March 8, 2011
I think Richard may have posted something better?

I have just been looking through the thread 'Peaks' where you and Richard posted a few nice worksheets, but that was more looking at the extreme values.

I though you had posted a zerocross over function before.

Clipboard01.jpg

Once again this would require the user to change the TOL settings.

Mike

23-Emerald V
March 8, 2011

Mike Armstrong wrote:

I think Richard may have posted something better?

I have just been looking through the thread 'Peaks' where you and Richard posted a few nice worksheets, but that was more looking at the extreme values.

I though you had posted a zerocross over function before.

Clipboard01.jpg

Once again this would require the user to change the TOL settings.

Mike

Hi Mike,

Thanks for the memory jog. I may very well have posted variants of a zero crossing function before, but I have a memory like a ... one of those things that swims around in a wadjamacallit. Hence, I often find that it's quicker just to reinvent the wheel and let the circumstances dictate the quality of that wheel - normally (as in this case) a rough and ready function will do the essential job of looking at the principle.

Stuart

12-Amethyst
March 8, 2011

Mathcad's help says "near" finds the closest point, but it isn't acting that way, it finds all points in a range.

Rather than chante tol, if you divide by 10, you find multiple values near every corssing, zoom in to see th points.

Do you want to find actual data points, or interpolated roots?

Raiko17-PeridotAuthor
17-Peridot
March 9, 2011

Hello Wayne,

do I understand you correctly that you're proposing to find the two nearest points to zero (one positive the other negative) and then interpolate in order to find the crossing point?

This would be fine. Do you know of a function or routine which manages that?

Raiko

19-Tanzanite
March 9, 2011

Wayne Reid wrote:

Raiko,

Alan's method is way too simple, we can't have that.

If you are looking for complications I should, perhaps, note that, strictly, my method detects crossing points - it won't pick up a maximum or minimum that just touches zero!

Alan

Message was edited by: AlanStevens On second thoughts, it will if one of the two data points is exactly zero, but not if the zero lies between two small positive or two small negative values.