Hello, I got this from the "report a problem" link in the notebook. I
don't know if anything could be done about it though ...
-----------------
I've got a problem evaluating some pretty simple math functions; a
small fourier series, and integrals thereof, then evaluating
numerically (because sage just can't handle the symbolic answers
*sigh* --- maple could.
I can do about half the problem, but if enable (uncomment) the fourier
series part, the worksheet halts with a "too many contexts" error from
maxima. I have to restart the worksheet to continue --- which is
pointless, because it just errors out again.
I tried this on the sagenb.org server, and got exactly the same error,
so it's not my mac that is the problem.
-----
# Here is the code. This out to be trivial!
import pylab
kk = 1.0
ll = 10.0
npi = N(pi)
var('z, zd, zl, zg, zz')
dz = 1.0
zs = pylab.arange(0.0, ll+0.5*dz, dz)
f1 = lambda z: z*(ll-z)
ghomo = lambda zl, zg: 2/ll*sin(kk*zl)*sin(kk*(ll-zg))/(kk*sin(kk*ll))
gfourn = lambda z, zd, n: sin(npi*n*z/ll)*sin(npi*n*zd/ll)/((npi*n/ll)^2 - kk^2)
def uhomo(z):
return N(integrate(ghomo(zl,z)*f1(zl),zl,0,z) +
integrate(ghomo(z,zg)*f1(zg),zg,z,ll))
def ufourn(z,n):
return [N(integrate(f1(zd)*gfourn(z,zd,nn),zd,0,ll)) for nn in range(1,n)]
print ufourn(2.3, 8)
-----
Traceback (click to the left for traceback)
...
Too many contexts.
Traceback (most recent call last):
File "/Users/jdsahr/.sage/sage_notebook/worksheets/admin/19/code/19.py",
line 24, in ufourn
return [N(integrate(f1(zd)*gfourn(z,zd,nn),zd,_sage_const_0 ,ll)) for
nn in range(_sage_const_1 ,n)]
File
"/Applications/sage/local/lib/python2.6/site-packages/sage/misc/functional.py",
line 416, in integral
return x.integral(*args, **kwds)
File "expression.pyx", line 5962, in
sage.symbolic.expression.Expression.integral
(sage/symbolic/expression.cpp:24542)
File
"/Applications/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py",
line 566, in integral
result = expression._maxima_().integrate(v, a, b)
File
"/Applications/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py",
line 2003, in integral
return I(var, min, max)
File
"/Applications/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1390, in __call__
return self._obj.parent().function_call(self._name, [self._obj] +
list(args), kwds)
File
"/Applications/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1298, in function_call
return self.new(s)
File
"/Applications/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1094, in new
return self(code)
File
"/Applications/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1029, in __call__
return cls(self, x, name=name)
File
"/Applications/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py",
line 1433, in __init__
raise TypeError, x
TypeError: Error executing code in Maxima
CODE:
sage4 : integrate(sage0,sage1,sage2,sage3)$
Maxima ERROR:
`rat' replaced .3141592653589793 by 52103/165849 = .3141592653558357
`rat' replaced -10.0 by -10/1 = -10.0
Too many contexts.
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org