Message Boards Message Boards

0
|
5074 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Graph mark intersections

Posted 9 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[1][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[1][u][1 + b[t]], p, 
    p - (p b[t])/(2 epsH)}, {b[t], 0, 2 epsH}];
test = Solve[p == Derivative[1][u][1 + b[t]], b[t]]
test1 = test[[1]]
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[1][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

POSTED BY: Claude Dax
2 Replies

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[1][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 BY: Gianluca Gorni
Posted 9 years ago

first ty for your suggestion. this is the result and it looks nice.

enter image description here

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, enter image description here

if anyone got an idea to add this please let me know :) i wish you all a good day

POSTED BY: Claude Dax
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract