How can I calculate the intersection point of two functions in JMP?<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I am graphing two functions in JMP using the YFunction command in JSL. I would like to calculate the point where they intersect. How should I do this either manually or in JSL?
Thanks for the help!
Re: How can I calculate the intersection point of two functions in JMP?1. Graph > Profiler
2. Y --> Y, Prediction Formula
3. Click on red triangle button next to "Prediction Profiler"
4. Click on Desirability Functions
5. Alt-Click the upper right hand box
6. Click the Maximize Button and change to Match Target
7. Change the Values to 20, 0, and -20 (for High, Middle, and Low)
8. Click Ok
9. Click on the red triangle button next to "Prediction Profiler"
10. Click on Maximize Desirability
At various stages you may want to fiddle with the axes to more clearly display what is going on.
Re: How can I calculate the intersection point of two functions in JMP?How do I specify desirability to be Target = 0? I keep getting stuck on that part. This seems to be exactly what i need.
Re: How can I calculate the intersection point of two functions in JMP?You can interactively find the intersection in this example using a slightly higher level of JMP machinery by using the Profiler.
1. New table with columns X and Y, 2 rows with values -5 and 5 for x.
2. Formula for Y: abs(x)^1.5 - x/10
3. Invoke standalone profiler
4. Specify Y as the prediction formula
5. Specify the desirability function to be Target = 0.
6. Maximize desireability
You will then get the solution X value spelled out on the X-axis.
Re: How can I calculate the intersection point of two functions in JMP?Exactly what i needed, thanks! It works perfectly.
Re: How can I calculate the intersection point of two functions in JMP?Or, if you just want it on the graph,
xaxis( Add Ref Line( intersect_X, "Solid", "Black", char(intersect_x,6,4), 1 ) ),

6,4 is the field width and number of decimal digits after formatting the number to characters.
Re: How can I calculate the intersection point of two functions in JMP?the JSL variable, intersect_X, holds the result of the minimize function. (minimize uses it for an initial guess, then modifies it.) You should check if F1(intersect_X) is close enough to F2(intersect_X) to meet your requirements. A bad initial guess might prevent it from working.
Re: How can I calculate the intersection point of two functions in JMP?That works great, thanks! Do you know how I can output the x-coordinate of the intersection using that? The black line shows up perfectly but I cannot see the x-value.
Re: How can I calculate the intersection point of two functions in JMP?The minimize function might do what you need if your functions are well behaved. In this example, the black reference line is automatically placed at the intersection of the red and green curves.
f1 = Function( {a}, Abs( a ) ^ 1.5);
f2 = Function( {a}, 10 / a );
intersect_X = 1;// guess a value
Minimize( Abs( f1( intersect_X ) - f2( intersect_X ) ), {intersect_X}, <
New Window( "Example",
Graph Box(
xaxis( Add Ref Line( intersect_X, "Solid", "Black", "", 1 ) ),
X Scale( -5, 5 ), Y Scale( -20, 20 ),
Pen Color( "red" ); Y Function( f1( a ), a );
Pen Color( "green" ); Y Function( f2( a ), a );
)
);

Re: How can I calculate the intersection point of two functions in JMP?Dear Craige,
Sorry to bother you almost after a decade here. I guess that is what happens with the timeless functions.
I am getting this error while running your script. Would you happen to know what thisi could be?

Re: How can I calculate the intersection point of two functions in JMP?Not sure why; two ideas:
- close any date tables that have columns of the same names used in the JSL
- check the spelling of the variable names (perhaps use copy-paste the same name to each)...I can't be positive from the picture, but one of the underscores might be a look-alike character.
I copied and pasted the code into JMP 16, 17, 18, and JMP 19 EA and it still works. Maybe the JMP log window will tell you a bit more. What version of JMP are you using? Be great to hear what the answer is, let us know.
