On Sat, Aug 15, 2009 at 11:02 AM, Mani chandra<mchan...@iitk.ac.in> wrote:
>
> William Stein wrote:
>> On Sat, Aug 15, 2009 at 5:44 AM, Mani chandra<mchan...@iitk.ac.in> wrote:
>>
>>> Hi,
>>>
>>>    I wrote a code in sage to construct a Low Dimensional model for the
>>> Magnetohydrodynamic equations to study dynamos etc... But the program
>>> crashes at different points on different machines with the following error:
>>>
>>> Traceback (most recent call last):
>>>  File "./LowD_model.py", line 158, in <module>
>>>    du_x_dt.append(select_mode(RHS_Ux, l, m, n) )
>>>  File "./LowD_model.py", line 28, in select_mode
>>>    val = (func*exp(-I*(l*x + m*y +
>>> n*z))).integrate(x,0,2*pi).integrate(y,0,2*pi).integrate(z,0,2*pi)
>>>  File "expression.pyx", line 5700, in
>>> sage.symbolic.expression.Expression.integral
>>> (sage/symbolic/expression.cpp:24436)
>>>  File
>>> "/opt/sage/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py",
>>> line 566, in integral
>>>    result = expression._maxima_().integrate(v, a, b)
>>>  File
>>> "/opt/sage/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py",
>>> line 2003, in integral
>>>    return I(var, min, max)
>>>  File
>>> "/opt/sage/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
>>> line 1382, in __call__
>>>    return self._obj.parent().function_call(self._name, [self._obj] +
>>> list(args), kwds)
>>>  File
>>> "/opt/sage/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
>>> line 1290, in function_call
>>>    return self.new(s)
>>>  File
>>> "/opt/sage/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
>>> line 1086, in new
>>>    return self(code)
>>>  File
>>> "/opt/sage/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
>>> line 1021, in __call__
>>>    return cls(self, x, name=name)
>>>  File
>>> "/opt/sage/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
>>> line 1425, in __init__
>>>    raise TypeError, x
>>> TypeError: Error executing code in Maxima
>>> CODE:
>>>        sage2436 : integrate(sage2432,sage2433,sage2434,sage2435)$
>>> Maxima ERROR:
>>>
>>> Maxima encountered a Lisp error:
>>>
>>>  Memory limit reached. Please jump to an outer point or quit program.
>>>
>>> Automatically continuing.
>>> To reenable the Lisp debugger set *debugger-hook* to nil.
>>>
>>>
>>> I'm attaching the entire code but the function where it crashed is the
>>> follows:
>>>
>>> def select_mode(func,l,m,n):
>>>    val = (func*exp(-I*(l*x + m*y +
>>> n*z))).integrate(x,0,2*pi).integrate(y,0,2*pi).integrate(z,0,2*pi)
>>>    return val/(8*pi**3)
>>>
>>> Also, I'd like to know if the symbolic computation backend for SAGE is
>>> Maxima, Pynac or Sympy? Or is it a combination of all the three?
>>>
>>
>> All three, though I don't think anything from sympy is used by default.
>>
>>
>>> Will
>>> SAGE move to a single backend in the future?
>>>
>>
>> It will be much better if Sage moves away from Maxima, as your
>> question nicely illustrates.  Here's a big shout of encouragement to
>> everybody out there who is working on code to make it so Sage doesn't
>> depend at all on Maxima for symbolic calculus.
>>
>>
>>>  If this bug can't be fixed,
>>> is it suggested that I rewrite the code using the Sympy library?
>>>
>>>
>>
>> Is it really a bug?  It says "Memory limit reached."  Running out of
>> memory isn't necessarily a bug.  Computers have finite RAM.
>>
>> What operating system, computer hardware, etc. are you using?  Without
>> that info it is very hard to be more helpful.
>>
>>
>>> P.S If anyone is running the code, then please note that it takes a LOT
>>> of time.
>>>
>>> Thanking you,
>>> Mani chandra
>>>
>>>
>>
>>
>>
>>
> Hi,
>   I forgot to add hardware info. The program is using nowhere close to
> the 4 GB limit on my computer. I'm using Archlinux x86_64, kernel
> 2.6.30. I also tried it on another machine which has 1 GB of ram (which
> also is not being used fully) and which has Archlinux x86_64, kernel
> 2.6.28 .
>
> I totally agree that symbolic calculus backend be changed from Maxima to
> whatever is the best out there. I've had so many (other)troubles with
> Maxima in SAGE, with "assume", "solve", etc... As it stands, It simply
> is not an elegant system.

+1   If you want to launch into a project to just rewrite (say) solve
natively in Sage, that would be great.  Somebody will have to do it.
And the sooner the better.

You might experiment with:

sage: f = x^2
sage: f.integrate(algorithm='sympy')
1/3*x^3

William

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

Reply via email to