Following up with another data point:

Sage 4.3.4 under some version of Redhat Linux on an intel computer
with 64GB RAM.

The case that failed on the 4GB macbookpro succeeds here: minimize()
returns a value.

A larger case fails in the same manner,  minimize() returning without
a value:
    S is a polynomial over Q in 48 variables
    S is a quartic polynomial
    S contains 71138 terms.

Daniel Friedan

On Jul 13, 1:07 pm, 8fjm39j <[email protected]> wrote:
> I am trying to minimize numerically (over the reals) a polynomial S
> with rational coefficients.
>
> The function sage.numerical.optimize.minimize() returns without
> returning a value.
>
> Here's the relevant fragment of Sage code (executed using the menu
> item  'evaluate all')
>
> ===== BEGIN CODE FRAGMENT  =====================================
>
> N
>     44
>
> # RQ = PolynomialRing(QQ, N, 'x', sparse=True);   # this was executed
> earlier
>
> S in RQ
>     True
>
> print 'S is a polynomial over Q in', len(S.variables()), 'variables';
> print 'S is a quartic polynomial';
> print 'S contains', len(S.coefficients()), 'terms';
>     S is a polynomial over Q in 44 variables
>     S is a quartic polynomial
>     S contains 55188 terms
>
> S_exp =SR(S);
> init_values = [0] * len(S_exp.variables());
> soln=sage.numerical.optimize.minimize(S_exp,init_values);
> soln
>     Traceback (click to the left of this block for traceback)
>      ...
>      NameError: name 'soln' is not defined
>
> ===== END OF CODE FRAGMENT  =====================================
>
> This does not happen for a smaller problem:
>      S is a polynomial over Q in 40 variables
>      S is a quartic polynomial
>      S contains 34766 terms
>  i.e., minimize() does successfully return a value.
>
> I'm running Sage Version 4.4.4 under OS X 10.6.4 on a macbookpro with
> 4GB RAM, acquired in the form
>           sage-4.4.4-OSX-64bit-10.6-i386-Darwin.dmg
>
> I would attach the worksheet itself to this posting, if I saw a way to
> do so.
>
> Any help would be much appreciated.  Also any pointers towards a more
> efficient method to minimize such polynomials.   I'm just starting to
> learn Sage and Python.  At the moment, the bottlenecks appear to be
> the conversion to a symbolic expression, 'S_exp =SR(S); '  and the
> execution of minimize().  The polynomial algebra used to construct S
> executes relatively quickly.  The number of variables is of the form
> N=4mn where m and n are positive integers. I'd like to take N slightly
> larger, though I don't expect that my computing resources will allow
> taking N much larger, even if I use a more efficient method to
> minimize S.
>
> thanks,
> Daniel Friedan

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to