Homotopy Continuation Method to Solve A System of Nonlinear Algebraic Equations
Author's Data:  Housam BINOUS
Department of Chemical Engineering
National Institute of Applied Sciences and Technology
Tunis, TUNISIA

FindRoot fails to give correct solution unless a good initial guess is chosen. Difficulty in finding an initial guess is avoided by using homotopy continuation methods such as the fixed point and the Newton homotopy methods.

FindRoot[{x^2 - x y == 1, 
        Sqrt[x + 1] + y ==  0}, {x, -0.1}, {y, 0.5}]

FindRoot[{x^2 - x y == 1, Sqrt[x + 1] + y ==  0}, {x, 
        0.5}, {y, -1}]

Fixed Point Homotopy : 
H(x,t)=(1-t) (x-x0)+tf(x) with x0=(-0.1,0.5)

H[x_, y_, 
        t_] := {(1 - t) (x + 0.1) + 
          t (x^2 - x y - 1), 
(1 - t) (y - 
                0.5) + t (Sqrt[x + 1] + y)}

H[x, y, t]

Off[General::"spell"]

Grad[fon_, var_List] := D[fon, #] & /@ var

J = Grad[H[x, y, t], {x, y, t}]

Js = J /. x -> x[s] /. y -> y[s] /. 
        t -> t[s]

Eq[1] = D[x[s], {s, 1}] ==   Det[Drop[Js, 1]]

Eq[2] = D[y[s], {s, 1}] ==  -Det[Drop[Js, {2}]]

Eq[3] = D[t[s], {s, 1}] ==  Det[Drop[Js, {3}]]

sol = 
      NDSolve[{Eq[1], Eq[2], Eq[3], t[0] ==  0, 
          x[0] ==  -0.1, y[0] ==  0.5}, {x[s], y[s], 
          t[s]}, {s, 0, 0.9}]

Plot[Evaluate[t[s] /. sol], {s, 0, 0.9}]

sol1 = 
      FindRoot[(t[s] /. sol /. s ->  a) == 1, {a, 
          0.9}]

Fixed Point Homotopy and FindRoot give same result

{Evaluate[x[s] /. sol /. s -> a /. sol1 ], 
      Evaluate[y[s] /. sol /. s -> a /. sol1 ]}

FindRoot[{x^2 - x y == 1, Sqrt[x + 1] + y ==  0}, {x, 
        0.5}, {y, -1}]

Newton Homotopy :
H(x,t)= f(x) - (1-t) f(x0) with x0=(-0.1,0.5)

{x^2 - x y - 1, Sqrt[x + 1] + y} /. x ->  -0.1 /. 
      y ->  0.5

H[x_, y_, 
        t_] := {-(1 - t) (-0.94) + (x^2 - x y - 
              1), 
-(1 - 
                  t) (1.4486832980505138) +  (Sqrt[x + 1] + 
              y)}

J = Grad[H[x, y, t], {x, y, t}]

Js = J /. x -> x[s] /. y -> y[s] /. 
        t -> t[s]

Eq[1] = D[x[s], {s, 1}] ==   Det[Drop[Js, 1]]

Eq[2] = D[y[s], {s, 1}] ==  - Det[Drop[Js, {2}]]

Eq[3] = D[t[s], {s, 1}] ==  Det[Drop[Js, {3}]]

sol = 
      NDSolve[{Eq[1], Eq[2], Eq[3], t[0] ==  0, 
          x[0] ==  -0.1, y[0] ==  0.5}, {x[s], y[s], 
          t[s]}, {s, 0, 4}]

Plot[Evaluate[t[s] /. sol], {s, 0, 2.5}]

sol1 = 
      FindRoot[(t[s] /. sol /. s ->  a) == 1, {a, 
          2}]

Newton Homotopy and FindRoot give same result

{Evaluate[x[s] /. sol /. s -> a /. sol1 ], 
      Evaluate[y[s] /. sol /. s -> a /. sol1 ]}

FindRoot[{x^2 - x y == 1, Sqrt[x + 1] + y ==  0}, {x, 
        0.5}, {y, -1}]