0
|
4516 Views
|
2 Replies
|
0 Total Likes
View groups...
Share

# Graph mark intersections

Posted 8 years ago
 Hey guys, i wanna create a plot with 3 different functions and mark specific intersection: the code is the following: p = 0.8 epsH = 6 u[x_] := 2*Sqrt[x] Plot[{Derivative[u][1 + b[t]], p, p - (p b[t])/(2 epsH)}, {b[t], 0, 2 epsH}]  Is there an easy way to mark the intersections. i did it using grids and it does what i want but im not fully satisfied with it. i tried this one here too but did not manage to get it to run. http://www.wolfram.com/mathematica/new-in-10/basic-and-formula-regions/curve-intersection.html . The Code for this try is here: p = 0.8 epsH = 6 u[x_] := 2*Sqrt[x] test2 = Plot[{Derivative[u][1 + b[t]], p, p - (p b[t])/(2 epsH)}, {b[t], 0, 2 epsH}]; test = Solve[p == Derivative[u][1 + b[t]], b[t]] test1 = test[] intersections = {Red, PointSize[Medium], Point[b[t] /. test1]} Show[Graphics[{test2, intersections}]]  Im sure there is a mistake in the Show line but i dont get it. i would be happy about any response how to graph intersections and is that possible for a manipulate graph? here is the code so you see what i mean. p =. Manipulate[ Plot[{Derivative[u][1 + b[t]], p, p - (p b[t])/(2 epsH)}, {b[t], 0, 2 epsH}, PlotLegends -> "First order conditions"], {p, 0.5, 0.9}];  Thx for all answers in advance
2 Replies
Sort By:
Posted 8 years ago
 The intersections are given by Solve[u'[1 + x] == p, x] Solve[p - p x/(2 epsH) == u'[1 + x], x, Reals] You can plot them this way Plot[{Derivative[u][1 + b[t]], p, p - (p b[t])/(2 epsH)}, {b[t], 0, 2 epsH}, Epilog -> {PointSize[Large], Point[{x, u'[1 + x]} /. Join[Solve[u'[1 + x] == p, x], Solve[p - p x/(2 epsH) == u'[1 + x], x, Reals]]]}] 
Posted 8 years ago
 first ty for your suggestion. this is the result and it looks nice. This is good and i could work with it but honestly i would like to have lines added for the intersection. here is what i mean, if anyone got an idea to add this please let me know :) i wish you all a good day