Revision history [back]

solving simultaneous equations with solve()

I am trying to solve a set of (fairly simple) nonlinear simultaneous algebraic equations with real solutions as shown below. I know the equations have real solutions (they are in the comment line), but I cannot get sage to produce them. If I remove the 'sympy' and 'real' it produces complex solutions. Is there a better method for solving equations like these?

x,y,z=var('x y z')
s=solve([x*x*x-y*y==10.5,3.0*x*y+y==4.6],x,y,algorithm='sympy',domain='real',solution_dict=True)
#solutions are x=2.215, y=0.6018
print 'second problem:',' x=',s[0][x],' y=',s[0][y]