up previous next
ApproxSolve    --    Approximate real solutions for polynomial system


Syntax
ApproxSolve(L: LIST of RINGELEM): RECORD

Description
This function returns approximations to the real solutions (points) of a 0-dimensional polynomial system L: these approximations are given as a LIST of LISTs of rationals in the field AffinePts; the field indets gives the indets corresponding to the positions in the coordinates of each solution.

The polynomials in L must have rational coefficients. Approximate coordinates are given for non-rational solutions. A heuristic is used to determine the precision (which may vary depending on each solution point).

Useful verbosity range 20--20.

See also RationalSolve which finds all solutions all of whose coordinates are rational.

NOTE: up to version 5.3.2 the output was just the LIST of solutions.

Example
/**/  use QQ[x,y,z];
/**/  L := [x^3-y^2+z-1, x-2, (y-3)*(y+2)];
/**/  RationalSolve(L);
record[AffinePts := [[2, -2, -3], [2, 3, 2]], indets = [x,y,z]]
/**/  ApproxSolve(L);
record[AffinePts := [[2, -2, -3], [2, 3, 2]], indets = [x,y,z]]

/**/  L := [x^3-y^2+z-1, x^2-2, (y-3)*(y+2)];
/**/  AS := ApproxSolve(L);
--> use FloatStr or DecimalStr to make result more readable
/**/  indent([[ FloatStr(coord) | coord in pt] | pt in AS.AffinePts]);
[
  ["1.4142",  "-2.0000",  "2.1716"],
  ["-1.4142",  "-2.0000",  "7.8284"],
  ["1.4142",  "3.0000",  "7.1716"],
  ["-1.4142",  "3.0000",  "12.828"]
]

-- Verify we have an approximate answer:
/**/  indent([ [ FloatStr(eval(f, pt)) | f in L ] | pt in AS.AffinePts]);
[
  ["7.1576*10^(-19)",  "5.0612*10^(-19)",  "0.0000"],
  ["-7.1576*10^(-19)",  "5.0612*10^(-19)",  "0.0000"],
  ["2.8208*10^(-19)",  "1.9946*10^(-19)",  "0.0000"],
  ["-2.8208*10^(-19)",  "1.9946*10^(-19)",  "0.0000"]
]

See Also