Menu ▾ ▴

#3150 solve fails on system of two quadratic equations

None
closed
nobody
solve (66)
5
2016-10-02
2016-04-29
No

From the wxMaxima issue tracker #690.

solve can't solve a system of two quadratic equations with no free parameters. This example should have two real solutions:

(%i1) solve([x^2+y^2=1, (x-2)^2+(y-3)^2=9],[x,y]);
(%o1)                                 []

although solve can solve some examples like that:

(%i26) solve([x^2+y^2=1, x^2+(y-3)^2=9],[x,y]);
                       sqrt(35)      1        sqrt(35)      1
(%o26)         [[x = - --------, y = -], [x = --------, y = -]]
                          6          6           6          6
(%i27) solve([x^2+y^2=1, (x-1)^2+(y-3)^2=9],[x,y]);
                              4      3
(%o27)                [[x = - -, y = -], [x = 1, y = 0]]
                              5      5

For the record, Solver (loaded by load(solver);) finds a solution with x in terms of y and to_poly_solve can then find y:

(%i1) load (solver) $
(%i2) Solver ([x^2+y^2=1, (x-2)^2+(y-3)^2=9], [x,y]);
                        2                2
(%o2) [[x = - sqrt(1 - y ), [4 sqrt(1 - y ) - 6 y + 5]], 
                                           2                   2
                            [x = sqrt(1 - y ), [(- 4 sqrt(1 - y )) - 6 y + 5]]]
(%i3) load (to_poly_solve) $
(%i4) map (lambda ([e], to_poly_solve (e, y)), map (second, %o2));
                           5/2                          5/2
                        2 3    + 45                  2 3    - 45
(%o4)      [%union([y = -----------]), %union([y = - -----------])]
                            78                           78

Related

Bugs: #3150
Bugs: #3208

Discussion

  • David Billinghurst

     
    • Aleksas

      Aleksas - 2016-09-22

      (%i3) eq1:x^2+y^2=1$
      eq2:(x-2)^2+(y-3)^2=9$
      solve([eq1,eq2-eq1],[x,y]);
      (%o3)
      [[x=-(3^(5/2)-10)/26,y=(23^(5/2)+45)/78],[x=(3^(5/2)+10)/26,y=-(23^(5/2)-45)/78]]

      best
      Aleksas D

      2016-09-22 5:00 GMT+03:00 David Billinghurst billingd@users.sf.net:

      Duplicate of https://sourceforge.net/p/maxima/bugs/3208/

      Status: open
      Group: None
      Labels: solve
      Created: Fri Apr 29, 2016 09:41 PM UTC by Robert Dodier
      Last Updated: Tue May 10, 2016 10:58 PM UTC
      Owner: nobody

      From the wxMaxima issue tracker #690
      https://github.com/andrejv/wxmaxima/issues/690.

      solve can't solve a system of two quadratic equations with no free
      parameters. This example should have two real solutions:

      (%i1) solve([x^2+y^2=1, (x-2)^2+(y-3)^2=9],[x,y]);
      (%o1) []

      although solve can solve some examples like that:

      (%i26) solve([x^2+y^2=1, x^2+(y-3)^2=9],[x,y]);
      sqrt(35) 1 sqrt(35) 1
      (%o26) [[x = - --------, y = -], [x = --------, y = -]]
      6 6 6 6
      (%i27) solve([x^2+y^2=1, (x-1)^2+(y-3)^2=9],[x,y]);
      4 3
      (%o27) [[x = - -, y = -], [x = 1, y = 0]]
      5 5

      For the record, Solver (loaded by load(solver);) finds a solution with x
      in terms of y and to_poly_solve can then find y:

      (%i1) load (solver) $
      (%i2) Solver ([x^2+y^2=1, (x-2)^2+(y-3)^2=9], [x,y]);
      2 2
      (%o2) [[x = - sqrt(1 - y ), [4 sqrt(1 - y ) - 6 y + 5]],
      2 2
      [x = sqrt(1 - y ), [(- 4 sqrt(1 - y )) - 6 y + 5]]]

      (%i3) load (to_poly_solve) $
      (%i4) map (lambda ([e], to_poly_solve (e, y)), map (second, %o2));
      5/2 5/2
      2 3 + 45 2 3 - 45
      (%o4) [%union([y = -----------]), %union([y = - -----------])]
      78 78


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/maxima/bugs/3150/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #3150

  • David Billinghurst

    • status: open --> closed
     
  • David Billinghurst

    Fixed by commit [2986fc] See [bugs:#3208] for details

    (%i1) solve([x^2+y^2=1, (x-2)^2+(y-3)^2=9],[x,y]);
    
                   5/2                   3/2
                  3    - 10        (- 2 3   ) - 15
    (%o1) [[x = - ---------, y = - ---------------],
                     26                  26
                                                      5/2                3/2
                                                     3    + 10        2 3    - 15
                                                [x = ---------, y = - -----------]]
                                                        26                26
    
     

    Related

    Bugs: #3208
    Commit: [2986fc]


    Last edit: David Billinghurst 2016-10-02

Log in to post a comment.