Math: FindRoot for a common tangent

I asked a little about this question , which helped to find a solution. I came up with a pretty acceptable approach, but still not completely where I want. Suppose that there are two functions f1[x]and g1[y]I want to determine the value of xand yfor the common touch (s). I can at least identify x, and yfor one of the tangents, such as the following:

f1[x_]:=(5513.12-39931.8x+23307.5x^2+(-32426.6+75662.x-43235.4x^2)Log[(1.-1.33333x)/(1.-1.x)]+x(-10808.9+10808.9x)Log[x/(1.-1.x)])/(-1.+x)
g1[y_]:=(3632.71+3806.87y-51143.6y^2+y(-10808.9+10808.9y)Log[y/(1.-1.y)]+(-10808.9+32426.6y-21617.7y^2)Log[1.-(1.y)/(1.-1.y)])/(-1.+y)

Show[
Plot[f1[x],{x,0,.75},PlotRange->All],
Plot[g1[y],{y,0,.75},PlotRange->All]
]

Chop[FindRoot[
{
(f1[x]-g1[y])/(x-y)==D[f1[x],x]==D[g1[y],y]
},
{x,0.0000001},{y,.00000001}
]
[[All,2]]
]

However, it can be seen from the graph that there is another common tangent for somewhat larger values ​​of xand y(say, x~ 4 and y~ 5). Now, I wonder if I slightly modified the above expressions for f1[x]and g1[y]as follows:

    f2[x_]:=(7968.08-59377.8x+40298.7x^2+(-39909.6+93122.4x-53212.8x^2)Log[(1.-1.33333x)/(1.-1.x)]+x(-13303.2+13303.2x)Log[x/(1.-1.x)])/(-1.+x)
    g2[y_]:=(5805.16-27866.2y-21643.y^2+y(-13303.2+13303.2y)Log[y/(1.-1.y)]+(-13303.2+39909.6y-26606.4y^2)Log[1.-(1.y)/(1.-1.y)])/(-1.+y)

    Show[
    Plot[f2[x],{x,0,.75},PlotRange->All],
    Plot[g2[y],{y,0,.75},PlotRange->All]
    ]

    Chop[FindRoot[
    {
    (f2[x]-g2[y])/(x-y)==D[f2[x],x]==D[g2[y],y]
    },
    {x,0.0000001},{y,.00000001}
    ]
    [[All,2]]
    ]

, Mathematica x y .

, : , Mathematica , x y , ? f g z, - ( x y) z.

ex[z_]:=Chop[FindRoot[
{
(f[x,z]-g[y,z])/(x-y)==D[f[x],x]==D[g[y],y]
},
{x,0.0000001},{y,.00000001}
]
[[All,2]]
]

ListLinePlot[
Table[{ex[z][[i]],z},{i,1,2},{z,1300,1800,10}]
]
+2
2

{x, y}, , ContourPlot .

f1[x_]:=(5513.12-39931.8 x+23307.5 x^2+(-32426.6+75662. x- 
    43235.4 x^2)Log[(1.-1.33333 x)/(1.-1.x)]+
    x(-10808.9+10808.9 x) Log[x/(1.-1.x)])/(-1.+x)
g1[y_]:=(3632.71+3806.87 y-51143.6 y^2+y (-10808.9+10808.9y) Log[y/(1.-1.y)]+
    (-10808.9+32426.6 y-21617.7 y^2) Log[1.-(1.y)/(1.-1.y)])/(-1.+y)

plot = ContourPlot[{f1'[x] == g1'[y], f1[x] + f1'[x] (y - x) == g1[y]}, 
   {x, 0, 1}, {y, 0, 1}, PlotPoints -> 40]

Mathematica graphics

, (0,1) 2 . FindRoot:

seeds = {{.6,.4}, {.05, .1}};
sol = FindRoot[{f1'[x] == g1'[y], f1[x] + f1'[x] (y - x) == g1[y]}, 
    {x, #1}, {y, #2}] & @@@ seeds

sol, ReplaceAll:

points = {{x, f1[x]}, {y, g1[y]}} /. sol

(* 
 ==> {{{0.572412, 19969.9}, {0.432651, 4206.74}}, 
      {{0.00840489, -5747.15}, {0.105801, -7386.68}}}
*)

, :

Show[Plot[{f1[x], g1[x]}, {x, 0, 1}],
 {ParametricPlot[#1 t + (1 - t) #2, {t, -5, 5}, PlotStyle -> {Gray, Dashed}],
  Graphics[{PointSize[Medium], Point[{##}]}]} & @@@ points]

Mathematica graphics

+3

, , :

f1 g1,

plot = Plot[{f1[x], g1[x]}, {x, 0, .75}]

da plot

sol1 = Chop[FindRoot[{(f1[x] - g1[y])/(x - y) == D[f1[x], x] == D[g1[y], y]}, 
    {x, 0.0000001}, {y, .00000001}]]

(* {x -> 0.00840489, y -> 0.105801} *)

l1[t_] = (1 - t) {x, f1[x]} + t {y, g1[y]} /. sol1

Show[plot, Graphics[Point[{l1[0], l1[1]}]], 
     ParametricPlot[l1[t], {t, -1, 2}], 
     PlotRange -> {{-.2, .4}, {-10000, 10000}}]

combined plot


( ), , (, sol1 ) , f1 x g1 y, ..

LogicalExpand[{x, f[x]} + t {1, f'[x]} == {y, g[y]} && f'[x] == g'[y]]

, , Manipulate:

Manipulate[Show[plot, ParametricPlot[{x, f1[x]} + t {1, f1'[x]}, {t, -1, 1}]], 
       {x, 0, .75, Appearance -> "Labeled"}]

-

animation!

x y, ,

sol = Chop[Table[
   FindRoot[{(f1[x] - g1[y])/(x - y) == D[f1[x], x] == D[g1[y], y]},
    {x, xy[[1]]}, {y, xy[[2]]}], {xy, {{0.001, 0.01}, {0.577, 0.4}}}]]

,

l[t_] = (1 - t) {x, f1[x]} + t {y, g1[y]} /. sol

Show[plot, Graphics[Point[Flatten[{l[0], l[1]}, 1]]], 
 ParametricPlot[l[t], {t, -1, 2}, PlotStyle -> Dotted]]

anudda plot


, , .

+1

All Articles