R (Chandra) Chandrasekhar wrote: > Dear Folks, > > Pardon for the double-posting since I am unsure which list is more > appropriate. > > In section 2.4.1 of the Sage Tutorial, there is a non-linear equation > example from Jason Grout that I tried out, but it failed. Details follow. > > My version is built from the Ubuntu jaunty package source and runs on a > Kubuntu Intrepid AMD 64 PC. The startup banner is > > ---------------------------------------------------------------------- > > | SAGE Version 3.0.5, Release Date: 2008-07-11 | > > | Type notebook() for the GUI, and license() for information. | > > ---------------------------------------------------------------------- > > When I load the file with these contents for the example: > === > var('x y p q') > (x, y, p, q) > eq1 = p+q==9 > eq2 = q*y+p*x==-6 > eq3 = q*y^2+p*x^2==24 > solve([eq1,eq2,eq3,p==1],p,q,x,y) > === > > I get this error (with directory paths anonymized): > --------------------------------------------------------------------------- > > ValueError Traceback (most recent call > last) > > /Path-To-File_non_linear_eq_sage_0.py in <module>() > > 8 eq2 = q*y+p*x==-Integer(6) > > 9 eq3 = q*y**Integer(2)+p*x**Integer(2)==Integer(24) > > ---> 10 solve([eq1,eq2,eq3,p==Integer(1)],p,q,x,y) 11 > 12 > > /usr/lib/python2.5/site-packages/sage/calculus/equations.pyc in solve(f, > *args, **kwds) > 1386 s = m.solve(args) > 1387 except: > -> 1388 raise ValueError, "Unable to solve %s for %s"%(f, args) > 1389 a = repr(s) > 1390 sol_list = string_to_list_of_solutions(a) > > ValueError: Unable to solve [q + p == 9, q*y + p*x == -6, q*y^2 + p*x^2 > == 24, p == 1] for (p, q, x, y) > WARNING: Failure executing file: <Path-To-File_non_linear_eq_sage_0.py> > --------------------------------------------------------------------------- > > The version of the tutorial that I am using came with the version of > Sage installed. So, I do not think it is a version incmpatibility problem. > > Can someone tell me what the workaround is, or whether I need to file a > bug report.
I'm not sure what is going on here. Version 3.0.5 is from quite a while ago, at least in Sage terms. The calculation works great in the current version of Sage (version 3.4, just released yesterday, as tested on http://www.sagenb.org.) Did you say that this was from the jaunty source, as in the debian packaging of Sage? Does running "sage -maxima" run maxima? Can you solve simpler equations? That said, when I read the tutorial, I thought it was kind of awkward to have my name be the only name on that page; surely other people contributed the many, many examples on that page. If there should be a reference, then maybe a reference to the paper the calculation came from would be in order (http://arxiv.org/abs/0710.5669), but I wouldn't think that would even be necessary unless you were also trying to make the point that Sage is used in published research, even with simple algebra. Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---