On Oct 5, 10:16 am, Ondrej Certik <ond...@certik.cz> wrote:
> On Tue, Oct 5, 2010 at 9:57 AM, Scott <spectre...@gmail.com> wrote:
> > Hello everyone!
>
> > I'm trying to do an integration of a large polynomial.  Though it is
> > large, it should be a pretty simple integration (simple/linear terms
> > if it is fully expanded).  I've run this exact polynomial through
> > maxima and it computes the output extremely quick (and evern longer
> > polynomial).  But when I use sympy (which I prefer to maxima), the
> > program runs for 30-45 min before it runs out of memory and I get a
> > memory error (4 GB of ram).
>
> > I also tried to through in a few (or many) "sympy.cache.clear_cache()"
> > statements in hopes that it would help, but it doesn't.  I tried
> > printing some statements throughout the operations to see where it got
> > stuck.  It gets stuck on the first integration and the order of
> > integration (r, s, w) doesn't change the results.  So I get the
> > message "Point 2", but never see "Point 3" before it crashes (see code
> > below).
>
> Let's keep improving this gist.
>
> http://gist.github.com/611924
>
> As a first step, let's agree on the polynomial. If you run this gist, you get:
>
> Start
> Point 1
> expand
> <class 'sympy.core.mul.Mul'>
>
> so the polynomial is actually not a polynomial. How did you get this
> "polynomial"? Can you rewrite it, so that you get an instance of
> Add()? I tried to expand it, but it took forever.
>
> After you have an instance of Add() (which every  polynomial should
> be, right?), then we'll see how to integrate it. I am sure it will be
> fast, if not, you can help it by integrating term by term by hand,
> just like you did for chopping off the terms.
>
> Ondrej

Correct.  This poly was constructed by multiplying two polys together,
so is shows it to be type Mul.  But if you expand the poly, and then
get the type of that expanded poly, it shows the type then to be Add.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to