Menu

#3414 quadratic equatin not solved

None
open
5
2021-06-10
2018-03-23
No

this gives the correct answer:

solve([x²+y²=r², (x-a)²+(y)²=p²],[x,y]);
[[x=(r^2-p^2+a^2)/(2*a),y=-sqrt(-r^4+2*p^2*r^2+2*a^2*r^2-p^4+2*a^2*p^2-a^4)/(2*a)],[x=(r^2-p^2+a^2)/(2*a),y=sqrt(-r^4+2*p^2*r^2+2*a^2*r^2-p^4+2*a^2*p^2-a^4)/(2*a)]]

but this give an empty solution:

solve([x²+y²=r², (x-a)²+(y-b)²=p²],[x,y]);
[]

Related

Bugs: #3414

Discussion

  • Aleksas

    Aleksas - 2018-03-23

    (%i2) eq1:x^2+y^2=r^2$
    eq2:(x-a)^2+(y-b)^2=p^2$
    (%i3) sol:solve([eq1,eq1-eq2],[x,y]);
    (sol)
    [[x=-(bsqrt(-r^4+(2p^2+2b^2+2a^2)r^2-p^4+(2b^2+2a^2)p^2-b^4-2a^2b^2-a^4)-ar^2+ap^2-ab^2-a^3)/(2b^2+2a^2),y=(asqrt(-r^4+(2p^2+2b^2+2a^2)r^2-p^4+(2b^2+2a^2)p^2-b^4-2a^2b^2-a^4)+br^2-bp^2+b^3+a^2b)/(2b^2+2a^2)],[x=(bsqrt(-r^4+(2p^2+2b^2+2a^2)r^2-p^4+(2b^2+2a^2)p^2-b^4-2a^2b^2-a^4)+ar^2-ap^2+ab^2+a^3)/(2b^2+2a^2),y=-(asqrt(-r^4+(2p^2+2b^2+2a^2)r^2-p^4+(2b^2+2a^2)p^2-b^4-2a^2b^2-a^4)-br^2+bp^2-b^3-a^2b)/(2b^2+2a^2)]]
    Test:
    (%i4) subst(sol[1],[eq1,eq2]),radcan;
    (%o4) [r^2=r^2,p^2=p^2]
    (%i5) subst(sol[2],[eq1,eq2]),radcan;
    (%o5) [r^2=r^2,p^2=p^2]

    2018-03-23 10:29 GMT+02:00 Jack Samhain jacksamhain@users.sourceforge.net:


    Status: open
    Group: None
    Created: Fri Mar 23, 2018 08:29 AM UTC by Jack Samhain
    Last Updated: Fri Mar 23, 2018 08:29 AM UTC
    Owner: nobody

    this gives the correct answer:

    solve([x²+y²=r², (x-a)²+(y)²=p²],[x,y]);
    [[x=(r^2-p^2+a^2)/(2a),y=-sqrt(-r^4+2p^2r^2+2a^2r^2-p^4+2a^2p^2-a^4)/(2a)],[x=(r^2-p^2+a^2)/(2a),y=sqrt(-r^4+2p^2r^2+2a^2r^2-p^4+2a^2p^2-a^4)/(2a)]]

    but this give an empty solution:

    solve([x²+y²=r², (x-a)²+(y-b)²=p²],[x,y]);
    []


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

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

     

    Related

    Bugs: #3414

  • Jack Samhain

    Jack Samhain - 2018-03-23

    Ok, found it: I have here these versions from the debian repository:
    maxima 5.38.1-8+b1
    wxmaxima 16.04.2-1

    "maxima" gives the correct result, just like you quoted.
    "wxmaxima" gives the incorrect result.

    So this is a bug in wxmaxima, not maxima.

     
  • Jack Samhain

    Jack Samhain - 2018-03-25

    Did not work out so well. Afterupgrading ti the latest supported version I get reliably this result:

    (%i9) eq1:x²+y²=r²$
    eq2:(x-a)²+(y+b)²=d²$
    solve([eq1,eq2],[x,y]);
    (%o9) []

    This happens on maxima 5.38.1-8+b1 (devuan) and 5.41.0 (FreeBSD).

     
  • Robert Dodier

    Robert Dodier - 2018-04-06
    • labels: --> solve
     
  • David Billinghurst

    • labels: solve --> solve, algsys
    • assigned_to: David Billinghurst
     
  • David Billinghurst

    I'll take this one.

     
  • David Billinghurst

    solve calls algsys to solve systems of polynomial equations. The problem here is (probably) too general for algsys. If some parameters are given values then solutions are found. I will investigate a little further but it is probably a wont-fix.

    What I recommend for this type of problem is to use geometric insight to eliminate some degrees of freedom. The problem as posed is the intersection of a circle centre (0.0) radius r and a circle centre (a,-b) radius d. By rotating and scaling you can transform the problem to the system of equations at (%i8) which is solvable.

    (%i1) display2d:false;
    (%o1) false
    (%i2) eq1:x^2+y^2=r^2$
    (%i3) eq2:(x-a)^2+(y+b)^2=d^2$
    (%i4) solve([eq1,eq2],[x,y]);
    (%o4) []
    (%i5) solve([eq1,eq2],[x,y]),a=1,b=1,r=2,d=3;
    (%o5) [[x = -(sqrt(23)+3)/4,y = -(sqrt(23)-3)/4],
           [x = (sqrt(23)-3)/4,y = (sqrt(23)+3)/4]]
    (%i6) solve([eq1,eq2],[x,y]),a=1,b=1,r=2;
    (%o6) []
    (%i7) solve([eq1,eq2],[x,y]),a=1,b=0,r=2;
    (%o7) [[x = -(d^2-5)/2,y = -sqrt((-d^4)+10*d^2-9)/2],
           [x = -(d^2-5)/2,y = sqrt((-d^4)+10*d^2-9)/2]]
     (%i8) solve([eq1,eq2],[x,y]),a=1,b=0;
    (%o8) [[x = (r^2-d^2+1)/2,
            y = -sqrt((-r^4)+(2*d^2+2)*r^2-d^4+2*d^2-1)/2],
           [x = (r^2-d^2+1)/2,
            y = sqrt((-r^4)+(2*d^2+2)*r^2-d^4+2*d^2-1)/2]]
    
     
  • Jack Samhain

    Jack Samhain - 2021-06-10

    You are right, one can take the solver by it's hand and make it solve the equations, but that is not the point: The solver fails at this simple problem. How should the user trust the solver to work correctly, when it can not solve a perfectly solvable problem? It's a pitty, but in my case it disqualifies maxima for use in classes.

    My old TI-92 solves this equations the correct way :)

     

Log in to post a comment.

MongoDB Logo MongoDB