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


Syntax
ApproxSolve(L: LIST of RINGELEM): LIST of LIST of RAT

Description
This function returns the list of real solutions (points) of a 0-dimensional polynomial system L . The polynomials in L must have rational coefficients. Approximate coordinates are given for non-rational solutions.

Useful verbosity range 20--20.

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

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

/**/  L := [x^3-y^2+z-1, x^2-2, (y-3)*(y+2)];
/**/  Pts := ApproxSolve(L);
--> use FloatStr or DecimalStr to make result more readable
/**/  indent([[ FloatStr(coord) | coord in pt] | pt in Pts]);
[
  ["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 Pts]);
[
  ["-3.2567*10^(-76)", "-6.2932*10^(-77)", "2.3668*10^(-76)"],
  ["-1.3971*10^(-77)", "8.1808*10^(-78)", "2.5541*10^(-77)"],
  ["-3.7110*10^(-77)", "8.1808*10^(-78)", "2.5541*10^(-77)"],
  ["7.7208*10^(-77)", "3.2902*10^(-77)", "-1.2374*10^(-76)"]
]

See Also