Macaulay2 » Documentation
Packages » Msolve :: msolveRealSolutions
next | previous | forward | backward | up | index | toc

msolveRealSolutions -- compute all real solutions to a zero dimensional system using symbolic methods

Description

This functions uses the msolve package to compute the real solutions to a zero dimensional polynomial ideal with either integer or rational coefficients.

The second input is optional, and indicates the alternative ways to provide output either using an exact rational interval QQi, a real interval RRi, or by taking a rational or real approximation of the midpoint of the intervals.

i1 : R = QQ[x,y]

o1 = R

o1 : PolynomialRing
i2 : I = ideal {(x-1)*x, y^2-5}

             2       2
o2 = ideal (x  - x, y  - 5)

o2 : Ideal of R
i3 : rationalIntervalSols = msolveRealSolutions I

        18446744073709551615  18446744073709551617    41248173712355948587 
o3 = {{{--------------------, --------------------}, {--------------------,
        18446744073709551616  18446744073709551616    18446744073709551616 
     ------------------------------------------------------------------------
     41248173712355948589                   288817664571061611           
     --------------------}}, {{- ---------------------------------------,
     18446744073709551616        340282366920938463463374607431768211456 
     ------------------------------------------------------------------------
                414474765439290959              41248173712355948587 
     ---------------------------------------}, {--------------------,
     340282366920938463463374607431768211456    18446744073709551616 
     ------------------------------------------------------------------------
     41248173712355948589      18446744073709551615  18446744073709551617  
     --------------------}}, {{--------------------, --------------------},
     18446744073709551616      18446744073709551616  18446744073709551616  
     ------------------------------------------------------------------------
        10312043428088987147    41248173712355948587       
     {- --------------------, - --------------------}}, {{-
         4611686018427387904    18446744073709551616       
     ------------------------------------------------------------------------
               1037102244511300283           
     ---------------------------------------,
     340282366920938463463374607431768211456 
     ------------------------------------------------------------------------
               2532877672945861017                41248173712355948589   
     ---------------------------------------}, {- --------------------, -
     340282366920938463463374607431768211456      18446744073709551616   
     ------------------------------------------------------------------------
     20624086856177974293
     --------------------}}}
      9223372036854775808

o3 : List
i4 : rationalApproxSols = msolveRealSolutions(I, QQ)

          10312043428088987147               31414275217057337            
o4 = {{1, --------------------}, {---------------------------------------,
           4611686018427387904    170141183460469231731687303715884105728 
     ------------------------------------------------------------------------
     10312043428088987147         82496347424711897175  
     --------------------}, {1, - --------------------},
      4611686018427387904         36893488147419103232  
     ------------------------------------------------------------------------
                 747887714217280367              82496347424711897175
     {---------------------------------------, - --------------------}}
      340282366920938463463374607431768211456    36893488147419103232

o4 : List
i5 : floatIntervalSols = msolveRealSolutions(I, RRi)

o5 = {{[1,1], [2.23607,2.23607]}, {[-8.48759e-22,1.21803e-21],
     ------------------------------------------------------------------------
     [2.23607,2.23607]}, {[1,1], [-2.23607,-2.23607]},
     ------------------------------------------------------------------------
     {[-3.04777e-21,7.44346e-21], [-2.23607,-2.23607]}}

o5 : List
i6 : floatIntervalSols = msolveRealSolutions(I, RRi_10)

o6 = {{[.999999,1], [2.23607,2.23607]}, {[-2.29375e-7,3.52376e-7],
     ------------------------------------------------------------------------
     [2.23606,2.23607]}, {[.999998,1], [-2.23608,-2.23606]},
     ------------------------------------------------------------------------
     {[-6.59293e-9,4.9431e-9], [-2.23607,-2.23607]}}

o6 : List
i7 : floatApproxSols = msolveRealSolutions(I, RR)

o7 = {{1, 2.23607}, {1.84637e-22, 2.23607}, {1, -2.23607}, {2.19784e-21,
     ------------------------------------------------------------------------
     -2.23607}}

o7 : List
i8 : floatApproxSols = msolveRealSolutions(I, RR_10)

o8 = {{1, 2.23607}, {6.15009e-8, 2.23607}, {1, -2.23607}, {-8.24912e-10,
     ------------------------------------------------------------------------
     -2.23607}}

o8 : List

Note in cases where solutions have multiplicity this is not reflected in the output. While the solver does not return multiplicities, it reliably outputs the verified isolating intervals for multiple solutions.

i9 : I = ideal {(x-1)*x^3, (y^2-5)^2}

             4    3   4      2
o9 = ideal (x  - x , y  - 10y  + 25)

o9 : Ideal of R
i10 : floatApproxSols = msolveRealSolutions(I, RRi)

o10 = {{[1,1], [2.23607,2.23607]}, {[-4.71774e-29,3.50855e-29],
      -----------------------------------------------------------------------
      [2.23607,2.23607]}, {[1,1], [-2.23607,-2.23607]},
      -----------------------------------------------------------------------
      {[-4.73028e-21,1.29108e-20], [-2.23607,-2.23607]}}

o10 : List

Ways to use msolveRealSolutions:

  • msolveRealSolutions(Ideal)
  • msolveRealSolutions(Ideal,Ring)
  • msolveRealSolutions(Ideal,RingFamily)

For the programmer

The object msolveRealSolutions is a method function with options.


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/Msolve.m2:644:0.