Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-06 Thread Cousin Stanley
| | Did you perhaps use a list (type(p) == type([])) for p? | Alex Using the coefficients in an array instead of a list was the key in the solution to my problems Your other suggestions regarding floating p and the off-by-one error that I had with the polynomial degr

Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-06 Thread Cousin Stanley
| In case you are still interested pygsl wraps the GSL solver. | | | from pygsl import poly | | pc = poly.poly_complex( 3 ) | | tmp , rs = pc.solve( ( 2 , 3 , 1 ) ) | | print rs | | | You get pygsl at http://sourceforge.net/projects/pygsl/ Pierre Thanks again for the link to the Py

Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-03 Thread Alex Renelt
Raymond L. Buvel wrote: Alex Renelt wrote: Alex Renelt wrote: in addition: I'm writing a class for polynomial manipulation. The generalization of the above code is: definitions: 1.) p = array([a_0, a_i, ..., a_n]) represents your polynomial P(x) = \sum _{i=0} ^n a_i x^i 2.) deg(p) is its degree 3

Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-03 Thread Alex Renelt
Cousin Stanley wrote: Alex Thanks for posting your generalized numarray eigenvalue solution It's been almost 30 years since I've looked at any characteristic equation, eigenvalue, eignevector type of processing and at this point I don't recall many of the particulars No

Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-02 Thread konrad . hinsen
Carl Banks wrote: > If you don't have a great need for speed, you can accomplish this > easily with the linear algebra module of Numeric/numarray. Suppose > your quintic polynomial's in the form > >a + b*x + c*x**2 + d*x**3 + e*x**4 + x**5 > > The roots of it are equal to the eigenvalues of

Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-02 Thread Cousin Stanley
| In case you are still interested pygsl wraps the GSL solver. | | from pygsl import poly | | pc = poly.poly_complex( 3 ) | | tmp, rs = pc.solve( ( 2 , 3 , 1 ) ) | | print rs | | | You get pygsl at http://sourceforge.net/projects/pygsl/ Pierre I am still interested and have downloa

Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-01 Thread Pierre Schnizer
In case you are still interested pygsl wraps the GSL solver. from pygsl import poly pc = poly.poly_complex(3) tmp, rs = pc.solve((2,3,1)) print rs You get pygsl at http://sourceforge.net/projects/pygsl/ Pierre -- http://mail.python.org/mailman/listinfo/python-list

Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-01 Thread Cousin Stanley
Alex Thanks for posting your generalized numarray eigenvalue solution It's been almost 30 years since I've looked at any characteristic equation, eigenvalue, eignevector type of processing and at this point I don't recall many of the particulars Not being sure about the

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-27 Thread Carl Banks
Carl Banks wrote: > . from Numeric import * > . from LinearAlgebra import * > . > . def quinticroots(p): > . cm = zeros((5,5),Float32) > . cm[0,1] = cm[1,2] = cm[2,3] = cm[3,4] = 1.0 > . cm[4,0] = -p[0] > . cm[4,1] = -p[1] > . cm[4,2] = -p[2] > . cm[4,3] = -p[3] > . cm[

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-27 Thread David E. Konerding DSD staff
On 2005-02-26, Just <[EMAIL PROTECTED]> wrote: > While googling for a non-linear equation solver, I found > Math::Polynomial::Solve in CPAN. It seems a great little module, except > it's not Python... I'm especially looking for its poly_root() > functionality (which solves arbitrary polynomials)

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-27 Thread Raymond L. Buvel
Alex Renelt wrote: Alex Renelt wrote: in addition: I'm writing a class for polynomial manipulation. The generalization of the above code is: definitions: 1.) p = array([a_0, a_i, ..., a_n]) represents your polynomial P(x) = \sum _{i=0} ^n a_i x^i 2.) deg(p) is its degree 3.) monic(p) makes P moni

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-27 Thread Alex Renelt
Alex Renelt wrote: in addition: I'm writing a class for polynomial manipulation. The generalization of the above code is: definitions: 1.) p = array([a_0, a_i, ..., a_n]) represents your polynomial P(x) = \sum _{i=0} ^n a_i x^i 2.) deg(p) is its degree 3.) monic(p) makes P monic, i.e. monic(p) =

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-27 Thread Alex Renelt
Just wrote: In article <[EMAIL PROTECTED]>, "Carl Banks" <[EMAIL PROTECTED]> wrote: It should be pretty easy to set up a Numeric matrix and call LinearAlgebra.eigenvalues. For example, here is a simple quintic solver: . from Numeric import * . from LinearAlgebra import * . . def quinticroots(p):

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-27 Thread Just
In article <[EMAIL PROTECTED]>, "Carl Banks" <[EMAIL PROTECTED]> wrote: > Just wrote: > > While googling for a non-linear equation solver, I found > > Math::Polynomial::Solve in CPAN. It seems a great little module, > except > > it's not Python... I'm especially looking for its poly_root() > > fu

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Carl Banks
Just wrote: > While googling for a non-linear equation solver, I found > Math::Polynomial::Solve in CPAN. It seems a great little module, except > it's not Python... I'm especially looking for its poly_root() > functionality (which solves arbitrary polynomials). Does anyone know of > a Python modul

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Nick Coghlan
Just wrote: (Hm, I had the impression that scipy != Konrad Hinsen's Scientific module.) You're probably right :) I had played with [1], but it "only" calculates one root, and I need all roots (specifically, for a quintic equation). [2] doesn't seem to be a solver? Actually, I was curious whether

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
In article <[EMAIL PROTECTED]>, "Raymond L. Buvel" <[EMAIL PROTECTED]> wrote: > Just wrote: > > > > > SciPy indeed appear to contain a solver, but I'm currently stuck in > > trying to _get_ it for my platform (OSX). I'm definitely not going to > > install a Fortran compiler just to evaluate i

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Raymond L. Buvel
Just wrote: SciPy indeed appear to contain a solver, but I'm currently stuck in trying to _get_ it for my platform (OSX). I'm definitely not going to install a Fortran compiler just to evaluate it (even though my name is not "Ilias" ;-). Also, SciPy is _huge_, so maybe a Python translation of

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (John M. Gamble) wrote: > >> The > >> original source for the algorithm used in the module is > >> from Hiroshi Murakami's Fortran source, and it shouldn't > >> be too difficult to repeat the translation process to python. > > > >Ah ok, I'll try t

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread John M. Gamble
In article <[EMAIL PROTECTED]>, Just <[EMAIL PROTECTED]> wrote: > >Heh, how big are the odds you find the author of an arbitrary Perl >module on c.l.py... > Hey, that's why it's called lurking. > >Any will do. As I wrote in another post, I'm currently only looking for >a quintic equation solve

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (John M. Gamble) wrote: > In article <[EMAIL PROTECTED]>, > Just <[EMAIL PROTECTED]> wrote: > >While googling for a non-linear equation solver, I found > >Math::Polynomial::Solve in CPAN. It seems a great little module, except > > Thank you. >

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread John M. Gamble
In article <[EMAIL PROTECTED]>, Just <[EMAIL PROTECTED]> wrote: >While googling for a non-linear equation solver, I found >Math::Polynomial::Solve in CPAN. It seems a great little module, except Thank you. >it's not Python... Sorry about that. > I'm especially looking for

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Terry Reedy
"Just" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Does SciPy do what you want? Specifically Scientific.Functions.FindRoot >> [1] & >> Scientific.Functions.Polynomial [2] >> http://starship.python.net/~hinsen/ScientificPython/ScientificPythonManual/Sci >> entific_9.html >> [2]

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
In article <[EMAIL PROTECTED]>, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Just wrote: > > While googling for a non-linear equation solver, I found > > Math::Polynomial::Solve in CPAN. It seems a great little module, except > > it's not Python... I'm especially looking for its poly_root() > > f

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Nick Coghlan
Just wrote: While googling for a non-linear equation solver, I found Math::Polynomial::Solve in CPAN. It seems a great little module, except it's not Python... I'm especially looking for its poly_root() functionality (which solves arbitrary polynomials). Does anyone know of a Python module/pack

any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
While googling for a non-linear equation solver, I found Math::Polynomial::Solve in CPAN. It seems a great little module, except it's not Python... I'm especially looking for its poly_root() functionality (which solves arbitrary polynomials). Does anyone know of a Python module/package that imp