RootFinding
BivariatePolynomial
find the solutions of two or more bivariate polynomials
Calling Sequence
Parameters
Description
Options
Examples
References
BivariatePolynomial(fg, varlist, options)
fg
-
set or list of two or more polynomials in two variables
varlist
list or set of two names; a list defines the order in the solutions pairs returned, a set requests output in the form {x=..,y=..}
options
(optional) equations of the form option=value where option is one of exact, verify, or verifyTol.
The BivariatePolynomial(fg, varlist, options) command solves the bivariate polynomials fg, in the case when there is only a finite number of solutions. If there are an infinite number of solutions, this routine may fail.
The routine performs a random orthogonal change of coordinates, takes a random linear combination of the two or more input polynomials to produce exactly two polynomials f⁡x,y and g⁡x,y. It then constructs the Bezout matrix B⁡y of f⁡x,y and g⁡x,y with respect to x, and then the Companion matrix pencil of the matrix polynomial B⁡y. It then solves the generalized eigenproblem for eigenvalues and eigenvectors of the pencil; the eigenvalues give the values of y, and the corresponding values of x are deduced from the eigenvectors.
If the option verify=true is given (the default), or if there are more than two input polynomials, each putative root is tested on the original polynomials to see if the residual is acceptably small. A residual is judged to be small enough if it is smaller than ilog[10](n+1)*verifyTol times the maxnorm of the polynomial, where n is the number of roots. By default, verifyTol=Float(1,1-Digits). This default tolerance may be overridden by setting the option verifyTol=... in the call.
The routine assumes that f⁡x,y=g⁡x,y=0 has only isolated simple roots. Multiple roots are, numerically, perturbed into clusters of simple roots by rounding errors in the process. In practice, if the multiplicity of the root is not too high (say not more than three) then the results may be acceptable. If, however, there are an infinite number of roots (i.e. the dimensionality of the variety is higher than zero), then this routine will fail. Through rounding errors, a higher-dimensional system MAY be perturbed to a zero-dimensional system, and in this case pseudozeros are calculated and some information may be deduced about the true solutions by repeated solving; the differing random combinations will produce different pseudozeros that can be put together to get a partial picture of the higher- dimensional zero set.
Exact solutions are sometimes possible, and may be attempted by specifying the option exact=true. In this case, the random combinations are done over the integers to avoid introducing rounding errors. In the case where the input coefficients are exact and the polynomials are not of too high a degree, this may give exact (though not necessarily useful) answers.
Solutions obtained by BivariatePolynomial may be refined by use of fsolve. See the examples.
The options argument can contain the following equation.
exact = true or false
If exact=true, the command performs the computation exactly (depending on Eigenvectors succeeding with an exact computation).
verify = true or false
If verify=true (the default), the command tests that the values of each input polynomial at each computed root is smaller than 10 ulps, where an ulp is a Unit in the Last Place, measured relative to the user's setting of Digits and a vector norm of the polynomial coefficients. If verify=false, this residual test is not performed and infinite and spurious roots are returned along with any genuine roots.
verifyTol = positive floating-point number for residual tolerance
If verifyTol is overridden, the residual test is passed if the residual is less than or equal to ilog[10](n+1)*verifyTol times a vector norm of the polynomial coefficients.
Note: The resultType = data_type option has been superseded by the exact option.
with⁡RootFinding
Analytic,AnalyticZerosFound,BivariatePolynomial,EnclosingBox,EvaluateAtRoot,HasRealRoots,Homotopy,Isolate,NextZero,Parametric,RefineRoot,WitnessPoints
Exact answers (not usually useful)
BivariatePolynomial⁡25⁢u⁢v−12,u2+v2−1,u,v,exact=true
−35,−45,45,35,−45,−35,35,45
f≔randpoly⁡x,y,degree=2,dense
f≔−7⁢x2+22⁢x⁢y−94⁢y2−55⁢x+87⁢y−56
g≔randpoly⁡x,y,degree=2,dense
g≔−62⁢x⁢y−73⁢y2+97⁢x−4⁢y−83
Set output, and a large residual tolerance
BivariatePolynomial⁡f,g,x,y,verifyTol=0.000010
x=−3.95035168944360−5.66623769360476⁢I,y=1.58314710503979−0.669082838293886⁢I,x=−3.95035168944360+5.66623769360475⁢I,y=1.58314710503979+0.669082838293884⁢I,x=0.217656104641032−0.580098578671116⁢I,y=0.283760691054643−0.781752717215506⁢I,x=0.217656104641038+0.580098578671126⁢I,y=0.283760691054644+0.781752717215506⁢I
A higher-degree example
f≔randpoly⁡x,y,degree=3,dense
f≔−10⁢x3+62⁢x2⁢y+80⁢x⁢y2−17⁢y3−82⁢x2−44⁢x⁢y−75⁢y2+71⁢x−10⁢y−7
g≔randpoly⁡x,y,degree=3,dense
g≔−40⁢x3+42⁢x2⁢y+23⁢x⁢y2+6⁢y3−50⁢x2+75⁢x⁢y+74⁢y2−92⁢x+72⁢y+37
sols≔BivariatePolynomial⁡f,g,x,y,verify=false:
finiteSols≔select⁡type,map⁡convert,sols,set,set⁡complex⁡numeric
finiteSols≔−8.72546491823764+1.35925353545860×10−17⁢I,−0.804422190778388+3.34994664560768×10−18⁢I,−1.61657845360198+1.76908763026871×10−13⁢I,0.422070508744693+1.19857563106188×10−13⁢I,−0.786588411682248−1.14300482684492⁢I,0.604101549296862−0.622769842152083⁢I,−0.786588411681959+1.14300482684388⁢I,0.604101549296839+0.622769842152225⁢I,−0.453554755499160−1.18516902864060⁢I,−0.278993622119871+1.39562033543789⁢I,−0.453554755498933+1.18516902864131⁢I,−0.278993622120491−1.39562033543820⁢I,−0.373755472345027+7.92945549673299×10−15⁢I,0.156992272818564−6.72289805687904×10−14⁢I,0.237394982252642+1.13779271541314×10−14⁢I,0.546628853006322−9.64664526931731×10−14⁢I,1.19776154305770−4.99381711787469×10−14⁢I,1.96030291260013+5.12600673966412×10−13⁢I
Refining the solutions by passing them as initial approximations to fsolve.
finiteSols≔BivariatePolynomial⁡f,g,x,y
finiteSols≔−0.804422190776780+1.46422793108841×10−13⁢I,−8.72546491824324−1.63996064108809×10−12⁢I,−0.453554755502399−1.18516902863964⁢I,−0.278993622115287+1.39562033544011⁢I,−0.453554755497189+1.18516902864016⁢I,−0.278993622120292−1.39562033543835⁢I,0.422070508744006+8.37039084916395×10−14⁢I,−1.61657845360167+1.43001714671995×10−14⁢I,−0.786588411674588+1.14300482683918⁢I,0.604101549297744+0.622769842150686⁢I,−0.786588411675714−1.14300482684893⁢I,0.604101549297546−0.622769842152381⁢I,1.96030291261380+1.18650982072347×10−11⁢I,1.19776154306172+2.06586651483422×10−12⁢I,0.546628853006201+9.53326896881672×10−13⁢I,0.237394982252107+1.65986499189513×10−13⁢I,0.156992272818433−1.91316953588403×10−13⁢I,−0.373755472345041−3.33107473056885×10−14⁢I
Digits≔30
better≔fsolve⁡f,g,x=finiteSols51,y=finiteSols52
better≔x=−0.804422190778384243337546951432,y=−8.72546491823766479368773875110
subs⁡better,f,g
0.,3.×10−26
A one-dimensional variety, which causes BivariatePolynomial to fail: Note that many roots are found of the form x=1, y=anything (but not an infinite number), and the isolated roots are lost.
Digits≔trunc⁡evalhf⁡Digits
Digits≔15
f≔x2+y2−1⁢x−1
g≔25⁢x⁢y−12⁢x−1
1.00000000000001+0.⁢I,−44.2792829220309−0.⁢I,0.999999999999998+0.⁢I,8.85157501302492−0.⁢I,0.999999999999998−2.28983498828939×10−16⁢I,−0.352677478474666+1.00257635649826⁢I,0.999999999999998+1.80411241501588×10−16⁢I,−0.356764630842446−0.997039491465078⁢I,1.00000000000002−2.88262252609583×10−16⁢I,0.481584461593518−0.00389300631624244⁢I
Another example, worse in that the multiplicity is higher.
f≔x−32⁢x⁢y−6
g≔x−32⁢y+1
BivariatePolynomial⁡f,g,x,y,verifyTol=0.010
x=1.61444903148044−0.⁢I,y=0.763898897286967+0.⁢I
Correct solutions are not always returned. Doing it again may produce different output (because of the randomness)
x=2.73814436435934−0.725571745406410⁢I,y=1.45312067994126+0.828323525015386⁢I,x=3.29782787720106−0.409284725291712⁢I,y=1.34803030226128−0.615234355186775⁢I
x=3.56899994105181−1.61302716647830⁢I,y=−0.430598760149443−0.0959828272717515⁢I
x=2.20198934663833−0.00971969562366036⁢I,y=−8.50553116114323+0.00889436395203620⁢I,x=2.71283424639345+0.0000968297360482233⁢I,y=−5.76272532238580−0.0000886076010987100⁢I,x=4.18582785348240+0.518458807889304⁢I,y=−0.914609115095914+1.74179987404571⁢I,x=4.18587935513598−0.519028264653766⁢I,y=−0.914656243572590−1.74127877174821⁢I
x=1.73929994257694+0.212413901689147⁢I,y=−0.554498533677898+1.03622687896322⁢I,x=0.0575672432947175+0.243286301423028⁢I,y=−1.43966697429396−0.0176580709281279⁢I,x=0.670062363179550−0.783148116579887⁢I,y=−0.642081391140170−1.17185083506937⁢I
Barnett, Stephen. Polynomials and Linear Control Systems. Deffer, 1983.
Manocha, Dinesh. "Numerical methods for solving polynomial equations, in Applications of Computational Geometry." AMS proceedings of applied mathematics, Vol. 53. 1998.
See Also
fsolve
LinearAlgebra[BezoutMatrix]
LinearAlgebra[CompanionMatrix]
LinearAlgebra[Eigenvectors]
select
solve
type
Download Help Document