next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
PHCpack :: nonZeroFilter

nonZeroFilter -- returns solutions with coordinate larger than given tolerance

Synopsis

Description

A solution has its k-th coordinate non-zero when the abs function evaluates to a number greater than the given tolerance.

i1 : R = CC[x,y];
i2 : f = { x^3*y^5 + y^2 + x^2*y, x*y + x^2 - 1};
i3 : fSols = solveSystem(f, randomSeed=>3);
i4 : fSols/print
{-1, 0}
{1, 0}
{-1.59272, .964857}
{.742585+.425943*ii, .270685-1.00715*ii}
{-.764107, -.544612}
{1.33076-.335184*ii, -.62414+.513163*ii}
{-.894935-.624334*ii, .143333+1.14868*ii}
{1.33076+.335184*ii, -.62414-.513163*ii}
{-.894935+.624334*ii, .143333-1.14868*ii}
{.742585-.425943*ii, .270685+1.00715*ii}

o4 = {, , , , , , , , , }

o4 : List
i5 : nonZeroSols = nonZeroFilter(fSols,1,1.0e-10);
i6 : nonZeroSols / print
{-1.59272, .964857}
{.742585+.425943*ii, .270685-1.00715*ii}
{-.764107, -.544612}
{1.33076-.335184*ii, -.62414+.513163*ii}
{-.894935-.624334*ii, .143333+1.14868*ii}
{1.33076+.335184*ii, -.62414-.513163*ii}
{-.894935+.624334*ii, .143333-1.14868*ii}
{.742585-.425943*ii, .270685+1.00715*ii}

o6 = {, , , , , , , }

o6 : List

Here is another system where we filter solutions with ‘large enough’ first coordinate:

i7 : f = {x^2+y^2,y*x+x};
i8 : fSols = solveSystem(f);
i9 : fSols/print
(-2.46519e-32+1.07852e-32*ii, -2.40467e-32+9.0524e-34*ii)
{-ii, -1}
{ii, -1}

o9 = {, , }

o9 : List
i10 : zeroSols = zeroFilter(fSols,0,1.0e-10);
i11 : zeroSols/print
(-2.46519e-32+1.07852e-32*ii, -2.40467e-32+9.0524e-34*ii)

o11 = {}

o11 : List

Good values for the tolerance are relative to the accuracy and the condition number of the solution. To improve the accuracy of a solution, apply refineSolutions with a higher working precision.

The method returns the complement of the result of zeroFilter.

See also

Ways to use nonZeroFilter :