Homotopy Continuation Method to Solve A System of Nonlinear Algebraic Equations
Authors: Housam Binous and Ahmed Bellagi
Homotopy Continuation Method to Solve A System of Nonlinear Algebraic Equations
Authors: Housam Binous and Ahmed Bellagi
Authors: Housam Binous and Ahmed Bellagi
FindRoot fails to give a correct solution to a system of nonlinear algebraic equations unless a good initial guess is chosen . Difficulty in finding a suitable initial guess is avoided by using homotopy continuation methods such as the fixed point and the Newton homotopy methods .
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.
In[]:=
FindRoot[{x^2-xy1,Sqrt[x+1]+y0},{x,-0.1},{y,0.5}]
Out[]=
{x-1.-0.0000512881,y4.30262×-0.000102576}
-7
10
In[]:=
FindRoot[{x^2-xy1,Sqrt[x+1]+y0},{x,0.5},{y,-1}]
Out[]=
{x0.554958,y-1.24698}
Fixed Point Homotopy :
H(x,t)=(1-t) (x-x0)+tf(x) with x0=(-0.1,0.5)
H(x,t)=(1-t) (x-x0)+tf(x) with x0=(-0.1,0.5)
In[]:=
H[x_,y_,t_]:={(1-t)(x+0.1)+t(x^2-xy-1),(1-t)(y-0.5)+t(Sqrt[x+1]+y)}
In[]:=
H[x,y,t]
Out[]=
(1-t)(0.1+x)+t(-1+-xy),(1-t)(-0.5+y)+t
2
x
1+x
+yIn[]:=
Off[General::"spell"]
In[]:=
MyGrad[fon_,var_List]:=D[fon,#]&/@var
In[]:=
J=MyGrad[H[x,y,t],{x,y,t}]
Out[]=
1-t+t(2x-y),,{-tx,1},-1.1-x+-xy,0.5+
t
2
1+x
2
x
1+x
In[]:=
Js=J/.xx[s]/.yy[s]/.tt[s]
Out[]=
1-t[s]+t[s](2x[s]-y[s]),,{-t[s]x[s],1},-1.1-x[s]+-x[s]y[s],0.5+
t[s]
2
1+x[s]
2
x[s]
1+x[s]
In[]:=
Eq[1]=D[x[s],{s,1}]Det[Drop[Js,1]]
Out[]=
′
x
2
x[s]
1+x[s]
+x[s]y[s]In[]:=
Eq[2]=D[y[s],{s,1}]-Det[Drop[Js,{2}]]
Out[]=
′
y
0.55t[s]
1+x[s]
t[s]x[s]
2
1+x[s]
t[s]
2
x[s]
2
1+x[s]
1+x[s]
+t[s]1+x[s]
-2t[s]x[s]1+x[s]
+0.5t[s]y[s]-t[s]x[s]y[s]
2
1+x[s]
1+x[s]
y[s]In[]:=
Eq[3]=D[t[s],{s,1}]Det[Drop[Js,{3}]]
Out[]=
′
t
2
t[s]
2
1+x[s]
In[]:=
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}]
Out[]=
x[s]InterpolatingFunction[s],y[s]InterpolatingFunction[s],t[s]InterpolatingFunction[s]
In[]:=
Plot[Evaluate[t[s]/.sol],{s,0,0.9}]
Out[]=
In[]:=
sol1=FindRoot[(t[s]/.sol/.sa)1,{a,0.9}]
Out[]=
{a0.823182}
Fixed Point Homotopy and FindRoot give same result
In[]:=
{Evaluate[x[s]/.sol/.sa/.sol1],Evaluate[y[s]/.sol/.sa/.sol1]}
Out[]=
{{0.554958},{-1.24698}}
In[]:=
FindRoot[{x^2-xy1,Sqrt[x+1]+y0},{x,0.5},{y,-1}]
Out[]=
{x0.554958,y-1.24698}
Newton Homotopy :
H(x,t)= f(x) - (1-t) f(x0) with x0=(-0.1,0.5)
H(x,t)= f(x) - (1-t) f(x0) with x0=(-0.1,0.5)
In[]:=
{x^2-xy-1,Sqrt[x+1]+y}/.x-0.1/.y0.5
Out[]=
{-0.94,1.44868}
In[]:=
H[x_,y_,t_]:={-(1-t)(-0.94)+(x^2-xy-1),-(1-t)(1.4486832980505138)+(Sqrt[x+1]+y)}
In[]:=
J=MyGrad[H[x,y,t],{x,y,t}]
Out[]=
2x-y,,{-x,1},{-0.94,1.44868}
1
2
1+x
In[]:=
Js=J/.xx[s]/.yy[s]/.tt[s]
Out[]=
2x[s]-y[s],,{-x[s],1},{-0.94,1.44868}
1
2
1+x[s]
In[]:=
Eq[1]=D[x[s],{s,1}]Det[Drop[Js,1]]
Out[]=
′
x
In[]:=
Eq[2]=D[y[s],{s,1}]-Det[Drop[Js,{2}]]
Out[]=
′
y
0.47
1+x[s]
In[]:=
Eq[3]=D[t[s],{s,1}]Det[Drop[Js,{3}]]
Out[]=
′
t
x[s]
2
1+x[s]
In[]:=
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}]
Out[]=
x[s]InterpolatingFunction[s],y[s]InterpolatingFunction[s],t[s]InterpolatingFunction[s]
In[]:=
Plot[Evaluate[t[s]/.sol],{s,0,2.5}]
Out[]=
In[]:=
sol1=FindRoot[(t[s]/.sol/.sa)1,{a,2}]
Out[]=
{a1.4332}
Newton Homotopy and FindRoot give same result
In[]:=
{Evaluate[x[s]/.sol/.sa/.sol1],Evaluate[y[s]/.sol/.sa/.sol1]}
Out[]=
{{0.554958},{-1.24698}}
In[]:=
FindRoot[{x^2-xy1,Sqrt[x+1]+y0},{x,0.5},{y,-1}]
Out[]=
{x0.554958,y-1.24698}
Reference : B . G . Higgins and H . Binous, A Simple Method for Tracking Turning Points in Parameter Space, Journal of Chemical Engineering of Japan, Vol . 43, No . 12, pp . 1035–1042, 2010.
