Find the intersection point of two ListLinePlot in math

I have a lot of experimental data that I draw as 2 curves using ListLinePlot in math. I want to find the intersection between the two. Can I do this without creating an interpolation function and Solve []? I really do not think that it is necessary to make a polynomial with the order of 1000, or whatever it may be in my case. It should be simple, but I cannot find a function that does this. I am well versed in a function that assumes straight lines between each data point, like ListLinePlot (since there are so many). I feel this should be very obvious, but I really can't figure out how to do this (except that I just use my mind)

+4
source share
1 answer

I would use Mathematica Interpolation to generate interpolations of the two curves, and then use FindRoot to find the intersection, as shown below.

 curve1 = Interpolation[ data1 ]; curve2 = Interpolation[ data2 ]; FindRoot[ curve1[x] - curve2[x], {x, bestguess} ] 

Despite the thousands of points involved, interpolation is a very fast operation, and on my machine there is no noticeable delay between pressing shift + enter and returning Mathematica.

However, there is a warning. Since this is experimental data, the intersection itself will have uncertainty, and I suggest you use a suitable method designed to create this information, for example, found here . Although it is not immediately available, it should point you in the right direction.

+5
source

Source: https://habr.com/ru/post/1400767/


All Articles