Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I can't get T to evaluate for noninteger points. For example, T(5.3) gives the following error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_22.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("VCg1LjMp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/tmp/tmpudPhvP/___code___.py", line 3, in <module>
    exec compile(u'T(_sage_const_5p3 )
  File "", line 1, in <module>

  File "/tmp/tmp4oZQrZ/___code___.py", line 5, in T
    return integral(_sage_const_4 /sqrt(pi)*exp(-L)*(x**_sage_const_2 )*exp(-x**_sage_const_2 /_sage_const_4 )/cosh(sqrt(L)*x),x,_sage_const_0 ,oo)
  File "/home/sageserver/sage-5.0.1/local/lib/python2.7/site-packages/sage/misc/functional.py", line 728, in integral
    return x.integral(*args, **kwds)
  File "expression.pyx", line 8745, in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:33707)
  File "/home/sageserver/sage-5.0.1/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 633, in integrate
    return definite_integral(expression, v, a, b)
  File "function.pyx", line 413, in sage.symbolic.function.Function.__call__ (sage/symbolic/function.cpp:4678)
  File "/home/sageserver/sage-5.0.1/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 173, in _eval_
    return integrator(*args)
  File "/home/sageserver/sage-5.0.1/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 21, in maxima_integrator
    result = maxima.sr_integral(expression, v, a, b)
  File "/home/sageserver/sage-5.0.1/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 747, in sr_integral
    raise error
RuntimeError: ECL says: In function GCD, the value of the second argument is
  1.0
which is not of the expected type INTEGER

From some experimenting, the problem appears to be in cosh. If I take the sqrt(L) out of cosh, then it will evaluate. This seems odd.

In the meantime, you might using a combinations of exponentials in place of cosh to force the computation to work.