Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Variable 't' not found

Hi there,

I was trying to simply plot some fonctions defined as integrals like this one:

var('t')
plot( integrate(cos(x*t),t,0,sin(a)), x, 0, 10)
# a is an angle such that 0 < a < pi/2 defined beforehand

to do some brief visual checks on what I'm working on. That one works perfectly.

Then, just adding a "/sqrt(1-t^2)" :

var('t')
plot( integrate(cos(x*t)/sqrt(1-t^2),t,0,sin(a)), x, 0, 10)

ruins everything: gives me the error message : "... ValueError: Variable 't' not found"

And in fact I also tried with "/(1-t^2)" instead or even "/(1-t)", same result.

I'm very surprised, and I can't understand that. Thanks for any help.


Here is the full report:

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

  File "/tmp/tmpW3H_J9/___code___.py", line 4, in <module>
    exec compile(u'plot( integrate(cos(x*t)/t,t,_sage_const_0 ,sin(a)), x, _sage_const_0 , _sage_const_10 )
  File "", line 1, in <module>

  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 554, in wrapper
    return func(*args, **options)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1931, in plot
    G = funcs.plot(*args, **original_opts)
  File "sage/symbolic/expression.pyx", line 11383, in sage.symbolic.expression.Expression.plot (/usr/lib/sagemath//src/build/cythonized/sage/symbolic/expression.cpp:63333)
  File "sage/symbolic/expression.pyx", line 11424, in sage.symbolic.expression.Expression._plot_fast_callable (/usr/lib/sagemath//src/build/cythonized/sage/symbolic/expression.cpp:63626)
  File "sage/ext/fast_callable.pyx", line 456, in sage.ext.fast_callable.fast_callable (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:4485)
  File "sage/symbolic/expression.pyx", line 11261, in sage.symbolic.expression.Expression._fast_callable_ (/usr/lib/sagemath//src/build/cythonized/sage/symbolic/expression.cpp:62248)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1579, in fast_callable
    return FastCallableConverter(ex, etb)()
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 226, in __call__
    return self.composition(ex, operator)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1545, in composition
    return self.etb.call(function, *ex.operands())
  File "sage/ext/fast_callable.pyx", line 734, in sage.ext.fast_callable.ExpressionTreeBuilder.call (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:6980)
  File "sage/ext/fast_callable.pyx", line 609, in sage.ext.fast_callable.ExpressionTreeBuilder.__call__ (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:5984)
  File "sage/symbolic/expression.pyx", line 11261, in sage.symbolic.expression.Expression._fast_callable_ (/usr/lib/sagemath//src/build/cythonized/sage/symbolic/expression.cpp:62248)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1579, in fast_callable
    return FastCallableConverter(ex, etb)()
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 217, in __call__
    return self.arithmetic(div, div.operator())
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1507, in arithmetic
    return reduce(lambda x,y: self.etb.call(operator, x,y), operands)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1507, in <lambda>
    return reduce(lambda x,y: self.etb.call(operator, x,y), operands)
  File "sage/ext/fast_callable.pyx", line 734, in sage.ext.fast_callable.ExpressionTreeBuilder.call (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:6980)
  File "sage/ext/fast_callable.pyx", line 609, in sage.ext.fast_callable.ExpressionTreeBuilder.__call__ (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:5984)
  File "sage/symbolic/expression.pyx", line 11261, in sage.symbolic.expression.Expression._fast_callable_ (/usr/lib/sagemath//src/build/cythonized/sage/symbolic/expression.cpp:62248)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1579, in fast_callable
    return FastCallableConverter(ex, etb)()
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 226, in __call__
    return self.composition(ex, operator)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1545, in composition
    return self.etb.call(function, *ex.operands())
  File "sage/ext/fast_callable.pyx", line 734, in sage.ext.fast_callable.ExpressionTreeBuilder.call (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:6980)
  File "sage/ext/fast_callable.pyx", line 609, in sage.ext.fast_callable.ExpressionTreeBuilder.__call__ (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:5984)
  File "sage/symbolic/expression.pyx", line 11261, in sage.symbolic.expression.Expression._fast_callable_ (/usr/lib/sagemath//src/build/cythonized/sage/symbolic/expression.cpp:62248)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1579, in fast_callable
    return FastCallableConverter(ex, etb)()
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 217, in __call__
    return self.arithmetic(div, div.operator())
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1507, in arithmetic
    return reduce(lambda x,y: self.etb.call(operator, x,y), operands)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1507, in <lambda>
    return reduce(lambda x,y: self.etb.call(operator, x,y), operands)
  File "sage/ext/fast_callable.pyx", line 734, in sage.ext.fast_callable.ExpressionTreeBuilder.call (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:6980)
  File "sage/ext/fast_callable.pyx", line 609, in sage.ext.fast_callable.ExpressionTreeBuilder.__call__ (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:5984)
  File "sage/symbolic/expression.pyx", line 11261, in sage.symbolic.expression.Expression._fast_callable_ (/usr/lib/sagemath//src/build/cythonized/sage/symbolic/expression.cpp:62248)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1579, in fast_callable
    return FastCallableConverter(ex, etb)()
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 212, in __call__
    return self.symbol(ex)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1528, in symbol
    return self.etb.var(SR(ex))
  File "sage/ext/fast_callable.pyx", line 681, in sage.ext.fast_callable.ExpressionTreeBuilder.var (/usr/lib/sagemath//src/build/cythonized/sage/ext/fast_callable.c:6561)
ValueError: Variable 't' not found