[sage-devel] Re: numerically solve an equation

2007-10-29 Thread mhampton
Here's some example input for one of the systems you gave: from sage.interfaces.phc import phc r4. = PolynomialRing(CDF,4) eqlist = [p+q-9, q*y+p*x+6, q*y^2+p*x^2-24,p-1] bb_sols = phc.blackbox(eqlist,r4) bb_sols.solutions() -MH On Oct 29, 8:41 am, mhampton <[EMAIL PROTECTED]> wrote: > PHCpack

[sage-devel] Re: numerically solve an equation

2007-10-29 Thread mhampton
PHCpack is probably the best thing to use for numerical solutions of polynomial equations, or equations that can be converted into polynomials (e.g.. sin and cos). My interface was recently included in sage but the PHCpack developers are working on a more sophisticated one which will hopefully ma

[sage-devel] Re: numerically solve an equation

2007-10-29 Thread William Stein
On 10/29/07, Jason Grout <[EMAIL PROTECTED]> wrote: > William Stein wrote: > > On 10/28/07, David Joyner <[EMAIL PROTECTED]> wrote: > >> On 10/26/07, Jason Grout <[EMAIL PROTECTED]> wrote: > >>> I'm trying to numerically solve a system of equations. Currently I have: > >>> > >>> sage: var('x y p

[sage-devel] Re: numerically solve an equation

2007-10-29 Thread Jason Grout
William Stein wrote: > On 10/28/07, David Joyner <[EMAIL PROTECTED]> wrote: >> On 10/26/07, Jason Grout <[EMAIL PROTECTED]> wrote: >>> I'm trying to numerically solve a system of equations. Currently I have: >>> >>> sage: var('x y p q') >>> sage: eq1 = p+q==9 >>> sage: eq2 = q*y+p*x==-6 >>> sage:

[sage-devel] Re: numerically solve an equation

2007-10-28 Thread William Stein
On 10/28/07, David Joyner <[EMAIL PROTECTED]> wrote: > On 10/26/07, Jason Grout <[EMAIL PROTECTED]> wrote: > > > > I'm trying to numerically solve a system of equations. Currently I have: > > > > sage: var('x y p q') > > sage: eq1 = p+q==9 > > sage: eq2 = q*y+p*x==-6 > > sage: eq3 = q*y^2+p*x^2==

[sage-devel] Re: numerically solve an equation

2007-10-28 Thread David Joyner
On 10/26/07, Jason Grout <[EMAIL PROTECTED]> wrote: > > I'm trying to numerically solve a system of equations. Currently I have: > > sage: var('x y p q') > sage: eq1 = p+q==9 > sage: eq2 = q*y+p*x==-6 > sage: eq3 = q*y^2+p*x^2==24 > sage: solve([eq1,eq2,eq3,p==1],p,q,x,y) > [[p == 3, q == 6, x ==

[sage-devel] Re: numerically solve an equation

2007-10-27 Thread Jason Grout
William Stein wrote: > On 10/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> which produces a nested list. Is there a way to flatten the list by one >>> or two levels, but not flatten it all the way? Something like: >>> >>> sage: flatten([[[1,2],[3,4]],[[5,6],[7,8]]],1) >>> [[1,2],[3,4],

[sage-devel] Re: numerically solve an equation

2007-10-26 Thread William Stein
On 10/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > which produces a nested list. Is there a way to flatten the list by one > > or two levels, but not flatten it all the way? Something like: > > > > sage: flatten([[[1,2],[3,4]],[[5,6],[7,8]]],1) > > [[1,2],[3,4],[5,6],[7,8]] An easy w

[sage-devel] Re: numerically solve an equation

2007-10-26 Thread boothby
> P.S. On a different note, my real code has something like: > > sage: [solve([eq1,eq2,eq3,p==i],p,q,x,y) for i in [1..4]] > > which produces a nested list. Is there a way to flatten the list by one > or two levels, but not flatten it all the way? Something like: > > sage: flatten([[[1,2],[3,4]]