LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find graph intersections

Hello,

 

I need to find the x values of intersections of the two graphs in the code below and put them in an array. I'm having a hard time trying to figure out how to do it. Any help would be much appreciated.

Thanks. 

0 Kudos
Message 1 of 7
(4,749 Views)

Can you place reasonably default values into the controls and repost (or simply tell us typical values for ponts, bessel number, and delta).

 

Some suggestions:

  • You recalculate the same formulas with the same inputs millions of times per seconds. The calcuations only need to be done once and then whenever the inputs change. Use an event structure or at least place a small delay inside the while loop.
  • The terminals for delta and bessel number belong before the FOR loop. They only need to be read once and not with every iteration of the FOR loop.
  • ...
Message 2 of 7
(4,730 Views)
yeah here's the one with values
Message Edited by Kriek on 05-23-2009 07:50 PM
0 Kudos
Message 3 of 7
(4,725 Views)
Here's a quick draft making a few simplifying assumptions (it will e.g. fail for cases where the two curves touch, but not cross. It also assumes that the red curve starts above the white curve). It probably still need a few tweaks, depending how general a solution you want. The solution is approximate, because in interpolates linearly between actual data points. Still, the two curves differ only by ~1E-15 or less at the found points. Modify as needed.
Message 4 of 7
(4,692 Views)

thanks so much thats exactly what I needed to do.

0 Kudos
Message 5 of 7
(4,684 Views)

Altenbach, nice job with marking the intersection points.

1 Kudos for you Smiley Very Happy

Cory K
0 Kudos
Message 6 of 7
(4,654 Views)

altenbach wrote:
It probably still need a few tweaks ... 

The VI currently goes into an infinite loop if the bessel number is set to zero. Not good!

 

The quickest fix would be th add a "+1" after "round to +inf" and eliminate the "-1" of the blue wire going into the while loop.

Message 7 of 7
(4,646 Views)