[sage-support] utf-8, encoding and notebook() Edit page

2008-08-24 Thread Philippe Saade

hi,

I am working on an Ubuntu box, with firefox and UTF-8 is my system's default.
[EMAIL PROTECTED]:~$ locale
LANG=fr_FR.UTF-8
LC_CTYPE=fr_FR.UTF-8
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_COLLATE=fr_FR.UTF-8
LC_MONETARY=fr_FR.UTF-8
LC_MESSAGES=fr_FR.UTF-8
LC_PAPER=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8.
LC_ALL=


If i edit a worksheet (to add HTML) or change the name of the
worksheet with an accented letter, characters are added in iso-8859-1
or 15.

In the body of the worksheet and in the title, everything looks fine
until a close and reopen the worksheet.

I know about trac#2593, but it doesn't help

Thanks for any help.
Philippe

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: utf-8, encoding and notebook() Edit page

2008-08-24 Thread Philippe Saade

On Sun, Aug 24, 2008 at 9:01 AM, Philippe Saade [EMAIL PROTECTED] wrote:
 hi,

 I am working on an Ubuntu box, with firefox and UTF-8 is my system's default.
 [EMAIL PROTECTED]:~$ locale
 LANG=fr_FR.UTF-8
 LC_CTYPE=fr_FR.UTF-8
 LC_NUMERIC=fr_FR.UTF-8
 LC_TIME=fr_FR.UTF-8
 LC_COLLATE=fr_FR.UTF-8
 LC_MONETARY=fr_FR.UTF-8
 LC_MESSAGES=fr_FR.UTF-8
 LC_PAPER=fr_FR.UTF-8
 LC_NAME=fr_FR.UTF-8
 LC_ADDRESS=fr_FR.UTF-8
 LC_TELEPHONE=fr_FR.UTF-8
 LC_MEASUREMENT=fr_FR.UTF-8
 LC_IDENTIFICATION=fr_FR.UTF-8.
 LC_ALL=


 If i edit a worksheet (to add HTML) or change the name of the
 worksheet with an accented letter, characters are added in iso-8859-1
 or 15.

 In the body of the worksheet and in the title, everything looks fine
 until a close and reopen the worksheet.

 I know about trac#2593, but it doesn't help

 Thanks for any help.
 Philippe

Here is what i did to fix the Edit issue :

** go to Firefox -- Préférences -- Contenu -- Police et couleurs
-- Avancé... -- Encodage par défaut : Unicode (UTF-8)
** better restart firefox

This doesn't fix the issue when editing the title by clicking on it
and filling the popup-box.
For that, i change the title in Edit mode...

Hope it will help other ùéçèà buddies :-)
Philippe

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] upgrade

2008-08-24 Thread Bin Zhang

Hi,

I have upgraded my sage 3.0.6 to 3.1.1 using sage -upgrade.
It seems to me it did not upgrade sage-banner:

 ./sage
--
| SAGE Version 3.0.6, Release Date: 2008-07-30   |
| Type notebook() for the GUI, and license() for information.|
--

sage: version()
'SAGE Version 3.1.1, Release Date: 2008-08-17'


Best regards,
Bin
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: simplifying complex matrices

2008-08-24 Thread David Joyner

On Sun, Aug 24, 2008 at 12:20 AM, Ryan [EMAIL PROTECTED] wrote:

 I have the symbolic complex matrix:

 M=matrix([[1/((-1)^(1/4)*(I - 1)), (1 - I)*I/((-1)^(1/4)*(-1*I-1)*(I -
 1))],[1/((-1)^(1/4)*(I - 1)),I/((-1)^(1/4)*(-1*I - 1))]])

 This matrix should simplify to a real matrix with all entries plus or
 minus 1/sqrt(2), however when I use

 M.simplify()

What about

sage: M.apply_map(real)

[-1/sqrt(2)  1/sqrt(2)]
[-1/sqrt(2) -1/sqrt(2)]
sage: M.apply_map(imag)

[0 0]
[0 0]


Does that help any?


 it doesn't simplify much at all.  Any thoughts?  My temporary solution
 has been to change the base ring to CDF, but this results in some
 small imaginary parts in the entries due to roundoff error which is
 also undesirable.

 Thanks.

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] simplifying complex matrices

2008-08-24 Thread Ryan

I have the symbolic complex matrix:

M=matrix([[1/((-1)^(1/4)*(I - 1)), (1 - I)*I/((-1)^(1/4)*(-1*I-1)*(I -
1))],[1/((-1)^(1/4)*(I - 1)),I/((-1)^(1/4)*(-1*I - 1))]])

This matrix should simplify to a real matrix with all entries plus or
minus 1/sqrt(2), however when I use

M.simplify()

it doesn't simplify much at all.  Any thoughts?  My temporary solution
has been to change the base ring to CDF, but this results in some
small imaginary parts in the entries due to roundoff error which is
also undesirable.

Thanks.

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] jsMath issue and solution with error code -7

2008-08-24 Thread Philippe Saade

Hi,

i post this here for future newbies who might encounter the same problem...

** on Linux/Ubuntu 8.04, under Firefox 2 or 3, with all TexFonts
installed, i kept having this error message :

It looks like jsMath failed to set up properly (error code -7)

for a single
sage : show(x^2)

command.

My solution was to :

* mkdir -p /home/foobar/.fonts   (for user foobar)
* download on of the zip file here :
http://www.math.union.edu/~dpvc/jsMath/download/jsMath-fonts.html
(the TeX-fonts-15.zip looks not too dark.)
* unzip the .zip
* restart firefox
* (adjust scale size in the options of jsMaths control panel to suit my taste)

Philippe

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: upgrade

2008-08-24 Thread William Stein

Try

  sage: hg_scripts.pull()
  sage: hg_scripts.merge()
and possibly
  sage: hg_scripts.updae()

then restart sage.

On Sun, Aug 24, 2008 at 2:42 AM, Bin Zhang [EMAIL PROTECTED] wrote:

 Hi,

 I have upgraded my sage 3.0.6 to 3.1.1 using sage -upgrade.
 It seems to me it did not upgrade sage-banner:

  ./sage
 --
 | SAGE Version 3.0.6, Release Date: 2008-07-30   |
 | Type notebook() for the GUI, and license() for information.|
 --

 sage: version()
 'SAGE Version 3.1.1, Release Date: 2008-08-17'


 Best regards,
 Bin
 




-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: simplifying complex matrices

2008-08-24 Thread William Stein

On Sun, Aug 24, 2008 at 3:54 AM, David Joyner [EMAIL PROTECTED] wrote:

 On Sun, Aug 24, 2008 at 12:20 AM, Ryan [EMAIL PROTECTED] wrote:

 I have the symbolic complex matrix:

 M=matrix([[1/((-1)^(1/4)*(I - 1)), (1 - I)*I/((-1)^(1/4)*(-1*I-1)*(I -
 1))],[1/((-1)^(1/4)*(I - 1)),I/((-1)^(1/4)*(-1*I - 1))]])

 This matrix should simplify to a real matrix with all entries plus or
 minus 1/sqrt(2), however when I use

 M.simplify()

 What about

 sage: M.apply_map(real)

 [-1/sqrt(2)  1/sqrt(2)]
 [-1/sqrt(2) -1/sqrt(2)]
 sage: M.apply_map(imag)

 [0 0]
 [0 0]


 Does that help any?

You can also use a number field, which will be very fast, but
map not be so useful for whatever else you're doing:

INPUT:
x = polygen(QQ)
K.a = NumberField(x^4 + 1)
I = a^2
matrix([[1/(a*(I - 1)), (1 - I)*I/(a*(-1*I-1)*(I -1))],[1/(a*(I -
1)),I/(a*(-1*I - 1))]])

OUTPUT:
[ 1/2*a^3 - 1/2*a -1/2*a^3 + 1/2*a]
[ 1/2*a^3 - 1/2*a  1/2*a^3 - 1/2*a]

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: jsMath issue and solution with error code -7

2008-08-24 Thread Timothy Clemans

I've been seeing this with the last few releases.

On Sun, Aug 24, 2008 at 10:46 AM, Philippe Saade [EMAIL PROTECTED] wrote:

 Hi,

 i post this here for future newbies who might encounter the same problem...

 ** on Linux/Ubuntu 8.04, under Firefox 2 or 3, with all TexFonts
 installed, i kept having this error message :

 It looks like jsMath failed to set up properly (error code -7)

 for a single
 sage : show(x^2)

 command.

 My solution was to :

 * mkdir -p /home/foobar/.fonts   (for user foobar)
 * download on of the zip file here :
 http://www.math.union.edu/~dpvc/jsMath/download/jsMath-fonts.html
 (the TeX-fonts-15.zip looks not too dark.)
 * unzip the .zip
 * restart firefox
 * (adjust scale size in the options of jsMaths control panel to suit my taste)

 Philippe

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: simplifying complex matrices

2008-08-24 Thread William Stein

On Sun, Aug 24, 2008 at 11:03 AM, Ryan [EMAIL PROTECTED] wrote:

 Thanks, both seem like workable options.  A related question...

 There are alot of different simplify commands, but not one that seems
 to be effective for hyperbolic trig functions.  For instance

 cosh(arcsinh(3/2)) simplifies to sqrt(13)/2

 but none of the simplify commands seem to produce this.

 Any thoughts?


Wait a little?  In the new Ginac-based Sage symbolic
code that Burcin and I are implementing right now this works
automatically:

sage: x = var('x', ns=1); S = x.parent()
sage: S(3/2).arcsinh().cosh()
sqrt(13/4)

Keep your eye on
http://trac.sagemath.org/sage_trac/ticket/3872

Ginac is a very robust fast C++ library for symbolic manipulation
that will replace most of Sage's current dependence on Maxima
by something much better.  http://www.ginac.de/

Sympy doesn't automatically do the above simplification (yet):

sage: import sympy
sage: Integer = sympy.Integer
sage: sympy.cosh(sympy.asinh(3/2))
cosh(asinh(3/2))


By the way, in ginac the C++ code that defines the above simplification
is here:


if (is_exactly_afunction(x)) {
const ex t = x.op(0);

// cosh(acosh(x)) - x
if (is_ex_the_function(x, acosh))
return t;

// cosh(asinh(x)) - sqrt(1+x^2)
if (is_ex_the_function(x, asinh))
return sqrt(_ex1+power(t,_ex2));

// cosh(atanh(x)) - 1/sqrt(1-x^2)
if (is_ex_the_function(x, atanh))
return power(_ex1-power(t,_ex2),_ex_1_2);
}

It's in the file inifcns_trans.cpp in the ginac distribution.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: numerically solving a polynomial system of equations

2008-08-24 Thread William Stein

On Sun, Aug 24, 2008 at 12:16 PM, Michael [EMAIL PROTECTED] wrote:

 I have a polynomial system of 50 equations in 50 unknowns. I would
 like
 to numerically solve this system (I'm interested in complex zeros).
 Seems to me that if I use sage's solve, it will sttempt to solve these
 algebraically.

 Are there any funcitons in sage for solving a polynomial or non-linear
 system
 numerically.

You're probably going to want to use scipy.optimize.  It has a large
range of sophisticated numerical optimization routines.  Maybe
they can be used for what you want.  I've hardly used them, so I
can't easily say more -- hopefully somebody who has can.

sage: import scipy
scisagimport scipy.optimize
sage: scipy.optimize.
scipy.optimize.NumpyTestscipy.optimize.broyden2
 scipy.optimize.fmin_ncg scipy.optimize.moduleTNC
scipy.optimize.anderson scipy.optimize.broyden3
 scipy.optimize.fmin_powell  scipy.optimize.newton
scipy.optimize.anderson2scipy.optimize.broyden_generalized
 scipy.optimize.fmin_tnc scipy.optimize.nonlin
scipy.optimize.anneal   scipy.optimize.brute
 scipy.optimize.fminboundscipy.optimize.optimize
scipy.optimize.approx_fprimescipy.optimize.check_grad
 scipy.optimize.fsolve   scipy.optimize.ridder
scipy.optimize.bisect   scipy.optimize.cobyla
 scipy.optimize.golden   scipy.optimize.rosen
scipy.optimize.bisectionscipy.optimize.fixed_point
 scipy.optimize.lbfgsb   scipy.optimize.rosen_der
scipy.optimize.bracket  scipy.optimize.fmin
 scipy.optimize.leastsq  scipy.optimize.rosen_hess
scipy.optimize.brentscipy.optimize.fmin_bfgs
 scipy.optimize.line_search  scipy.optimize.rosen_hess_prod
scipy.optimize.brenth   scipy.optimize.fmin_cg
 scipy.optimize.linesearch   scipy.optimize.test
scipy.optimize.brentq   scipy.optimize.fmin_cobyla
 scipy.optimize.minpack  scipy.optimize.tnc
scipy.optimize.broyden1 scipy.optimize.fmin_l_bfgs_b
 scipy.optimize.minpack2 scipy.optimize.zeros

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] numerically solving a polynomial system of equations

2008-08-24 Thread Michael

I have a polynomial system of 50 equations in 50 unknowns. I would
like
to numerically solve this system (I'm interested in complex zeros).
Seems to me that if I use sage's solve, it will sttempt to solve these
algebraically.

Are there any funcitons in sage for solving a polynomial or non-linear
system
numerically.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: simplifying complex matrices

2008-08-24 Thread Ryan

Thanks, both seem like workable options.  A related question...

There are alot of different simplify commands, but not one that seems
to be effective for hyperbolic trig functions.  For instance

cosh(arcsinh(3/2)) simplifies to sqrt(13)/2

but none of the simplify commands seem to produce this.

Any thoughts?

Thanks again.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: simplifying complex matrices

2008-08-24 Thread Ondrej Certik

On Sun, Aug 24, 2008 at 8:12 PM, William Stein [EMAIL PROTECTED] wrote:

 On Sun, Aug 24, 2008 at 11:03 AM, Ryan [EMAIL PROTECTED] wrote:

 Thanks, both seem like workable options.  A related question...

 There are alot of different simplify commands, but not one that seems
 to be effective for hyperbolic trig functions.  For instance

 cosh(arcsinh(3/2)) simplifies to sqrt(13)/2

 but none of the simplify commands seem to produce this.

 Any thoughts?


 Wait a little?  In the new Ginac-based Sage symbolic
 code that Burcin and I are implementing right now this works
 automatically:

 sage: x = var('x', ns=1); S = x.parent()
 sage: S(3/2).arcsinh().cosh()
 sqrt(13/4)

 Keep your eye on
http://trac.sagemath.org/sage_trac/ticket/3872

 Ginac is a very robust fast C++ library for symbolic manipulation
 that will replace most of Sage's current dependence on Maxima
 by something much better.  http://www.ginac.de/

 Sympy doesn't automatically do the above simplification (yet):

 sage: import sympy
 sage: Integer = sympy.Integer
 sage: sympy.cosh(sympy.asinh(3/2))
 cosh(asinh(3/2))


 By the way, in ginac the C++ code that defines the above simplification
 is here:


if (is_exactly_afunction(x)) {
const ex t = x.op(0);

// cosh(acosh(x)) - x
if (is_ex_the_function(x, acosh))
return t;

// cosh(asinh(x)) - sqrt(1+x^2)
if (is_ex_the_function(x, asinh))
return sqrt(_ex1+power(t,_ex2));

// cosh(atanh(x)) - 1/sqrt(1-x^2)
if (is_ex_the_function(x, atanh))
return power(_ex1-power(t,_ex2),_ex_1_2);
}

 It's in the file inifcns_trans.cpp in the ginac distribution.

I sent a patch fixing this to:

http://code.google.com/p/sympy/issues/detail?id=1037

This is what I did in sympy:

+if isinstance(arg, acosh):
+return arg.args[0]
+
+if isinstance(arg, asinh):
+return sqrt(1+arg.args[0]**2)
+
+if isinstance(arg, atanh):
+return 1/sqrt(1-arg.args[0]**2)

Ondrej

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: numerically solving a polynomial system of equations

2008-08-24 Thread Joshua Kantor

1. I would recommend looking at phcpack, it is designed to exploit the
special nature of large polynomial systems, however, supposedly I
believe it is sometimes difficult to compile, I've never used it but
it might be better suited to your problem.

http://www.math.uic.edu/~jan/download.html

2. The optimize.fsolve routine may be able to do what you want, though
I'm not sure how it will deal with that large a system

sage: import scipy
sage: from scipy import optimize
sage: def f(x):
return [float(x[0]**2-x[0]*x[1]-1),float(x[1]**2+x[0]*x[1]-2)]
:
sage: optimize.fsolve(f,[0.1r,0.1r])
array([-0.46821319,  1.66756601])

Note the float and 0.1r. scipy is not happy with sage floats or ints,
so you need to make sure everything is really python types and not
sage types.


The initial guess is very important if you give it a starting point of
[0,0] it won't converge.
Also, you can give it a jacobian which for that large a system is
probably a good idea.
do

sage: optimize.fsolve? for the arguments.


On Aug 24, 12:24 pm, William Stein [EMAIL PROTECTED] wrote:
 On Sun, Aug 24, 2008 at 12:16 PM, Michael [EMAIL PROTECTED] wrote:

  I have a polynomial system of 50 equations in 50 unknowns. I would
  like
  to numerically solve this system (I'm interested in complex zeros).
  Seems to me that if I use sage's solve, it will sttempt to solve these
  algebraically.

  Are there any funcitons in sage for solving a polynomial or non-linear
  system
  numerically.

 You're probably going to want to use scipy.optimize.  It has a large
 range of sophisticated numerical optimization routines.  Maybe
 they can be used for what you want.  I've hardly used them, so I
 can't easily say more -- hopefully somebody who has can.

 sage: import scipy
 scisagimport scipy.optimize
 sage: scipy.optimize.
 scipy.optimize.NumpyTestscipy.optimize.broyden2
  scipy.optimize.fmin_ncg scipy.optimize.moduleTNC
 scipy.optimize.anderson scipy.optimize.broyden3
  scipy.optimize.fmin_powell  scipy.optimize.newton
 scipy.optimize.anderson2scipy.optimize.broyden_generalized
  scipy.optimize.fmin_tnc scipy.optimize.nonlin
 scipy.optimize.anneal   scipy.optimize.brute
  scipy.optimize.fminboundscipy.optimize.optimize
 scipy.optimize.approx_fprimescipy.optimize.check_grad
  scipy.optimize.fsolve   scipy.optimize.ridder
 scipy.optimize.bisect   scipy.optimize.cobyla
  scipy.optimize.golden   scipy.optimize.rosen
 scipy.optimize.bisectionscipy.optimize.fixed_point
  scipy.optimize.lbfgsb   scipy.optimize.rosen_der
 scipy.optimize.bracket  scipy.optimize.fmin
  scipy.optimize.leastsq  scipy.optimize.rosen_hess
 scipy.optimize.brentscipy.optimize.fmin_bfgs
  scipy.optimize.line_search  scipy.optimize.rosen_hess_prod
 scipy.optimize.brenth   scipy.optimize.fmin_cg
  scipy.optimize.linesearch   scipy.optimize.test
 scipy.optimize.brentq   scipy.optimize.fmin_cobyla
  scipy.optimize.minpack  scipy.optimize.tnc
 scipy.optimize.broyden1 scipy.optimize.fmin_l_bfgs_b
  scipy.optimize.minpack2 scipy.optimize.zeros
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: numerically solving a polynomial system of equations

2008-08-24 Thread William Stein

On Sun, Aug 24, 2008 at 2:03 PM, Joshua Kantor [EMAIL PROTECTED] wrote:

 1. I would recommend looking at phcpack, it is designed to exploit the
 special nature of large polynomial systems, however, supposedly I
 believe it is sometimes difficult to compile, I've never used it but
  ^

It is written in ADA.

 it might be better suited to your problem.

 http://www.math.uic.edu/~jan/download.html

It is good when the zero locus is maybe not 0-dimensional,
i.e., when there are infinitely many solutions and you want
to understand them.


 2. The optimize.fsolve routine may be able to do what you want, though
 I'm not sure how it will deal with that large a system

 sage: import scipy
 sage: from scipy import optimize
 sage: def f(x):
return [float(x[0]**2-x[0]*x[1]-1),float(x[1]**2+x[0]*x[1]-2)]
 :
 sage: optimize.fsolve(f,[0.1r,0.1r])
 array([-0.46821319,  1.66756601])

 Note the float and 0.1r. scipy is not happy with sage floats or ints,
 so you need to make sure everything is really python types and not
 sage types.

It's best to just do

  RealNumber = float; Integer = int

first.

Thanks Josh!



 The initial guess is very important if you give it a starting point of
 [0,0] it won't converge.
 Also, you can give it a jacobian which for that large a system is
 probably a good idea.
 do

 sage: optimize.fsolve? for the arguments.


 On Aug 24, 12:24 pm, William Stein [EMAIL PROTECTED] wrote:
 On Sun, Aug 24, 2008 at 12:16 PM, Michael [EMAIL PROTECTED] wrote:

  I have a polynomial system of 50 equations in 50 unknowns. I would
  like
  to numerically solve this system (I'm interested in complex zeros).
  Seems to me that if I use sage's solve, it will sttempt to solve these
  algebraically.

  Are there any funcitons in sage for solving a polynomial or non-linear
  system
  numerically.

 You're probably going to want to use scipy.optimize.  It has a large
 range of sophisticated numerical optimization routines.  Maybe
 they can be used for what you want.  I've hardly used them, so I
 can't easily say more -- hopefully somebody who has can.

 sage: import scipy
 scisagimport scipy.optimize
 sage: scipy.optimize.
 scipy.optimize.NumpyTestscipy.optimize.broyden2
  scipy.optimize.fmin_ncg scipy.optimize.moduleTNC
 scipy.optimize.anderson scipy.optimize.broyden3
  scipy.optimize.fmin_powell  scipy.optimize.newton
 scipy.optimize.anderson2scipy.optimize.broyden_generalized
  scipy.optimize.fmin_tnc scipy.optimize.nonlin
 scipy.optimize.anneal   scipy.optimize.brute
  scipy.optimize.fminboundscipy.optimize.optimize
 scipy.optimize.approx_fprimescipy.optimize.check_grad
  scipy.optimize.fsolve   scipy.optimize.ridder
 scipy.optimize.bisect   scipy.optimize.cobyla
  scipy.optimize.golden   scipy.optimize.rosen
 scipy.optimize.bisectionscipy.optimize.fixed_point
  scipy.optimize.lbfgsb   scipy.optimize.rosen_der
 scipy.optimize.bracket  scipy.optimize.fmin
  scipy.optimize.leastsq  scipy.optimize.rosen_hess
 scipy.optimize.brentscipy.optimize.fmin_bfgs
  scipy.optimize.line_search  scipy.optimize.rosen_hess_prod
 scipy.optimize.brenth   scipy.optimize.fmin_cg
  scipy.optimize.linesearch   scipy.optimize.test
 scipy.optimize.brentq   scipy.optimize.fmin_cobyla
  scipy.optimize.minpack  scipy.optimize.tnc
 scipy.optimize.broyden1 scipy.optimize.fmin_l_bfgs_b
  scipy.optimize.minpack2 scipy.optimize.zeros
 




-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: numerically solving a polynomial system of equations

2008-08-24 Thread mabshoff



On Aug 24, 2:22 pm, William Stein [EMAIL PROTECTED] wrote:
 On Sun, Aug 24, 2008 at 2:03 PM, Joshua Kantor [EMAIL PROTECTED] wrote:

  1. I would recommend looking at phcpack, it is designed to exploit the
  special nature of large polynomial systems, however, supposedly I
  believe it is sometimes difficult to compile, I've never used it but

           ^

 It is written in ADA.

And building the GNU Ada compiler from sources is a giant pain unless
you have the GNU Ada compiler to bootstrap. I did build some phcpack
binaries for x86-64 Linux and it has a tendency to segfault when run
on say Debian if the binary was build on a FC8 box and vice versa. I
mainly wanted an Itanium binary, but cross compiling the ada toolchain
was just plainly not worth it for it.

So in conclusion: great code if you can use a binary that works, if
you need to build from sources it plainly sucks. The lesson learned
here is not to use exotic languages since the (alleged) benefit from
using Ada is far outweight by the fact that the practicality of
building the code :)

SNIP

 William Stein

Cheers,

Michael

 Associate Professor of Mathematics
 University of Washingtonhttp://wstein.org

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: upgrade

2008-08-24 Thread Bin Zhang

William Stein wrote:
 Try

   sage: hg_scripts.pull()
   sage: hg_scripts.merge()
 and possibly
   sage: hg_scripts.updae()

   

sage: hg_scripts.merge()
cd /home/zhang/src/sage-3.1.1/local/bin  hg merge
abort: repo has 3 heads - please merge with an explicit rev

sage: hg_scripts.update()
cd /home/zhang/src/sage-3.1.1/local/bin  hg update
abort: crosses branches (use 'hg merge' or 'hg update -C')


 then restart sage.

 On Sun, Aug 24, 2008 at 2:42 AM, Bin Zhang [EMAIL PROTECTED] wrote:
   
 Hi,

 I have upgraded my sage 3.0.6 to 3.1.1 using sage -upgrade.
 It seems to me it did not upgrade sage-banner:

  ./sage
 --
 | SAGE Version 3.0.6, Release Date: 2008-07-30   |
 | Type notebook() for the GUI, and license() for information.|
 --

 sage: version()
 'SAGE Version 3.1.1, Release Date: 2008-08-17'


 Best regards,
 Bin
 

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: square of an inequality

2008-08-24 Thread Stan Schymanski

I think it would be very nice to include a solve algorithm for
inequalities. To my knowledge, Mathematica does not do this, either.
Or at least, I did not find out how to do it in Mathematica after 4
years of use.

Stan

On Aug 23, 12:51 pm, Alec Mihailovs [EMAIL PROTECTED] wrote:
  By the way, I just looked at Wester's article (briefly), and it seems as
  if
  he missed inequalities. Such things, as, say, x+y=3, x=0, y=0 for
  integer
  x and y, should be a part of the standard test, I think. [...]
  Can SAGE do that?

 I meant to solve. The answer should be either a list of points, {x=0,y=0},
 {x=0,y=1} etc. - or their convex hull. That gives feasible points for
 integer (linear or convex) programming problems.

 I posted about that on Mapleprimes (Kindergarten). Maple can't do that using
 isolve.

 Alec
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Issues wrt sage 3.1.1 on linux

2008-08-24 Thread doug5y

Hello,

I upgraded my sage 3.0.6 installation using the command : sage -
upgrade. Every thing seemed to go well.

I then did sage --testall with the result :

--
The following tests failed:


sage -t  devel/sage/sage/graphs/graph_generators.py
sage -t  devel/sage/sage/calculus/calculus.py
sage -t  devel/sage/sage/combinat/root_system/
weyl_characters.py
Total time for all tests: 11051.6 seconds

Is there any way to get more detailed info wrt to these failures?
Maybe correct them in some way?

The output of uname -a is :

uname -a
Linux yamnuska 2.6.25.14-69.fc8 #1 SMP Mon Aug 4 14:20:24 EDT 2008
i686 athlon i386 GNU/Linux


TIA,
Doug Nadworny
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: upgrade

2008-08-24 Thread Bin Zhang

William Stein wrote:
 On Sun, Aug 24, 2008 at 3:20 PM, Bin Zhang [EMAIL PROTECTED] wrote:
   
 William Stein wrote:
 
 Try

   sage: hg_scripts.pull()
   sage: hg_scripts.merge()
 and possibly
   sage: hg_scripts.updae()


   
 sage: hg_scripts.merge()
 cd /home/zhang/src/sage-3.1.1/local/bin  hg merge
 abort: repo has 3 heads - please merge with an explicit rev
 

 It says repo has 3 heads, please merge, so you have
 to explicitly merge.  Do hg_sage.heads() to see a list
 of heads, then do

 sage: hg_sage.merge(one_of_the_head_numbers)

   

Thanks. It works.

Regards,
Bin

 sage: hg_scripts.update()
 cd /home/zhang/src/sage-3.1.1/local/bin  hg update
 abort: crosses branches (use 'hg merge' or 'hg update -C')


 
 then restart sage.

 On Sun, Aug 24, 2008 at 2:42 AM, Bin Zhang [EMAIL PROTECTED] wrote:

   
 Hi,

 I have upgraded my sage 3.0.6 to 3.1.1 using sage -upgrade.
 It seems to me it did not upgrade sage-banner:

  ./sage
 --
 | SAGE Version 3.0.6, Release Date: 2008-07-30   |
 | Type notebook() for the GUI, and license() for information.|
 --

 sage: version()
 'SAGE Version 3.1.1, Release Date: 2008-08-17'


 Best regards,
 Bin

 



   


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Issues wrt sage 3.1.1 on linux

2008-08-24 Thread doug5y

Hi Michael,

I looked in the tmp/test.log file and found :

.
.
sage -t  devel/sage/sage/graphs/graph_generators.py *** ***
Error: TIMED OUT! *** ***
ESC[?1034h*** *** Error: TIMED OUT! *** ***
.
.
.
sage -t  devel/sage/sage/calculus/calculus.py   *** ***
Error: TIMED OUT! *** ***
ESC[?1034h*** *** Error: TIMED OUT! *** ***
.
.
sage -t  devel/sage/sage/combinat/root_system/weyl_characters.py***
*** Error: TIMED OUT! *** ***
ESC[?1034h*** *** Error: TIMED OUT! *** ***
.
.

So it does seem that the tests Timed  Out as you say. I never
thought of my system as being slow, but I'm new to sage.
Do you have any recommendations as to how I might run the tests with
extended time limits?

TIA,
Doug Nadworny

On Aug 24, 5:34 pm, mabshoff [EMAIL PROTECTED]
dortmund.de wrote:
 On Aug 24, 3:36 pm, doug5y [EMAIL PROTECTED] wrote:

  Hello,

 Hi Doug,

  I upgraded my sage 3.0.6 installation using the command : sage -
  upgrade. Every thing seemed to go well.

  I then did sage --testall with the result :

  --
  The following tests failed:

  sage -t  devel/sage/sage/graphs/graph_generators.py
  sage -t  devel/sage/sage/calculus/calculus.py
  sage -t  devel/sage/sage/combinat/root_system/
  weyl_characters.py
  Total time for all tests: 11051.6 seconds

 Could you post the output from the failures? Your system seems to be a
 slow one and all three of the above could have simply timed out.

  Is there any way to get more detailed info wrt to these failures?
  Maybe correct them in some way?

  The output of uname -a is :

  uname -a
  Linux yamnuska 2.6.25.14-69.fc8 #1 SMP Mon Aug 4 14:20:24 EDT 2008
  i686 athlon i386 GNU/Linux

  TIA,
  Doug Nadworny

 Cheers,

 Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: square of an inequality

2008-08-24 Thread Jason Merrill

On Aug 24, 5:43 pm, Stan Schymanski [EMAIL PROTECTED] wrote:
 I think it would be very nice to include a solve algorithm for
 inequalities. To my knowledge, Mathematica does not do this, either.
 Or at least, I did not find out how to do it in Mathematica after 4
 years of use.

In Mathematica, there is Reduce:

Reduce[expr,vars]
reduces the statement expr by solving equations or inequalities for
vars and eliminating quantifiers.

JM

 Stan
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---