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

No roots today ?!

  • March 8, 2011
  • 3 replies
  • 12334 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?

1-Visitor
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.

Good spot Wayne,

The description of near is;

  • "near" - returns the value closest to z

Have a look at the attached worksheet. The functions have built in vectorization and therefore return the matching criteria for all values of z which are within the specified TOL.

Mike

Raiko17-PeridotAuthor
17-Peridot
March 9, 2011

Hello Mike,

that's exactly what I thought. I was hoping for some background routine within Match that would sort out the "closer" from the less closer data points, but MC doesn't behave like that.

Raiko