next | previous | forward | backward | up | top | index | toc | Macaulay2 website
NumericalAlgebraicGeometry :: refine(List,List)

refine(List,List) -- refine numerical solutions to a system of polynomial equations

Synopsis

Description

Uses Newton's method to correct the given solutions so that the resulting approximation has its estimated relative error bounded by min(ErrorTolerance,2^(-Bits)). The number of iterations made is at most Iterations.

i1 : R = CC[x];
i2 : F = polySystem {x^2-2};
i3 : P := refine(F, point{{1.5+0.001*ii}}, Bits=>1000)

o3 = {1.41421}

o3 : Point
i4 : first coordinates P

o4 = 1.41421356237309504880168872420969807856967187537694807317667973799073247846210703885038753432764157273501384623091229702492
     4836055850737212644121497099935831413222665927505592755799950501152782060571470109559971605970274534596862014728517418640889
     19860955232923048430871432145083976260362799525140799

o4 : CC (of precision 1002)
i5 : R = CC[x,y];
i6 : T = {x^2+y^2-1, x*y};
i7 : sols = { {1.1,-0.1}, {0.1,1.2} };
i8 : refine(T, sols, Software=>M2, ErrorTolerance=>.001, Iterations=>10)

o8 = {{1, -2.17629e-17}, {7.01931e-15, 1}}

o8 : List

In case of a singular (multiplicity>1) solution, while solveSystem and track return the end of the homotopy paths marked as a 'failure', it is possible to improve the quality of approximation with refine. The resulting point will be marked as singular:

i9 : R = CC[x,y];
i10 : S = {x^2-1,y^2-1};
i11 : T = {x^2+y^2-1, (x-y)^2};
i12 : solsS = {(1,1),(-1,-1)};
i13 : solsT = track(S,T,solsS)

o13 = {[M,t=.999998], [M,t=.999998]}

o13 : List
i14 : solsT / coordinates

o14 = {{.70667, .707543}, {-.70667, -.707543}}

o14 : List
i15 : refSols = refine(T, solsT)

o15 = {(.707107, .707107), (-.707107, -.707107)}

o15 : List
i16 : refSols / status

o16 = {Singular, Singular}

o16 : List

The failure to complete the refinement procedure is indicated by warning messages and the resulting point is displayed as [R].

i17 : R = CC[x];
i18 : F = polySystem {x^2-2};
i19 : Q := refine(F, point{{1.5+0.001*ii}}, Bits=>1000, Iterations=>2)

o19 = [RF]

o19 : Point
i20 : peek Q

o20 = Point{ConditionNumber => 1               }
            Coordinates => {1.41422}
            ErrorBoundEstimate => .00245131
            SolutionStatus => RefinementFailure
            SolutionSystem => {-2} | x2-2 |

Caveat

There are 2 'safety' bits in the computation. If the condition of the system at the refined point is poor the number of correct bits may be much smaller than requested.

See also