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

        8589934591  8589934593    4801919417  9603838835       
o3 = {{{----------, ----------}, {----------, ----------}}, {{-
        8589934592  8589934592    2147483648  4294967296       
     ------------------------------------------------------------------------
                         1064233693                    
     -------------------------------------------------,
     5846006549323611672814739330865132078623730171904 
     ------------------------------------------------------------------------
                         7139765529                        4801919417 
     --------------------------------------------------}, {----------,
     46768052394588893382517914646921056628989841375232    2147483648 
     ------------------------------------------------------------------------
     9603838835      8589934591  8589934593      9603838835    4801919417   
     ----------}}, {{----------, ----------}, {- ----------, - ----------}},
     4294967296      8589934592  8589934592      4294967296    2147483648   
     ------------------------------------------------------------------------
                             2021455743                     
     {{- --------------------------------------------------,
         11692013098647223345629478661730264157247460343808 
     ------------------------------------------------------------------------
                         7042718549                          9603838835   
     --------------------------------------------------}, {- ----------, -
     46768052394588893382517914646921056628989841375232      4294967296   
     ------------------------------------------------------------------------
     4801919417
     ----------}}}
     2147483648

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

          19207677669                          1374104015                    
o4 = {{1, -----------}, {- --------------------------------------------------
           8589934592      93536104789177786765035829293842113257979682750464
     ------------------------------------------------------------------------
       19207677669         19207677669     
     , -----------}, {1, - -----------}, {-
        8589934592          8589934592     
     ------------------------------------------------------------------------
                         1043104423                        19207677669
     --------------------------------------------------, - -----------}}
     93536104789177786765035829293842113257979682750464     8589934592

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

o5 = {{[1,1], [2.23607,2.23607]}, {[-1.82045e-40,1.52663e-40],
     ------------------------------------------------------------------------
     [2.23607,2.23607]}, {[1,1], [-2.23607,-2.23607]},
     ------------------------------------------------------------------------
     {[-1.72892e-40,1.50588e-40], [-2.23607,-2.23607]}}

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

o6 = {{[.999512,1.00049], [2.23535,2.23633]}, {[-1.82057e-40,1.5273e-40],
     ------------------------------------------------------------------------
     [2.23535,2.23633]}, {[.999512,1.00049], [-2.23633,-2.23535]},
     ------------------------------------------------------------------------
     {[-1.72909e-40,1.50668e-40], [-2.23633,-2.23535]}}

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

o7 = {{1, 2.23607}, {-1.46906e-41, 2.23607}, {1, -2.23607}, {-1.11519e-41,
     ------------------------------------------------------------------------
     -2.23607}}

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

o8 = {{1, 2.23584}, {-1.46632e-41, 2.23584}, {1, -2.23584}, {-1.11207e-41,
     ------------------------------------------------------------------------
     -2.23584}}

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]}, {[-1.82045e-40,1.52663e-40],
      -----------------------------------------------------------------------
      [2.23607,2.23607]}, {[1,1], [-2.23607,-2.23607]},
      -----------------------------------------------------------------------
      {[-1.72892e-40,1.50588e-40], [-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 Msolve.m2:636:0.