Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

integrate and simplify

Hello, Here is a list of command lines that used to work fine one year ago, but today, it's not :

fksin=piecewise([[(-2,0),f1(t)sin(kwt)],[(0,1),f2(t)sin(kwt)],[(1,2),f3(t)sin(kwt)]]) var('t k') assume(k,'integer') f1(t)=0 f2(t)=t f3(t)=2-t T=4 w=2pi/T f=piecewise([[(-2,0),f1],[(0,1),f2],[(1,2),f3]]) fkcos=piecewise([[(-2,0),f1(t)cos(kwt)],[(0,1),f2(t)cos(kwt)],[(1,2),f3(t)cos(kwt)]]) bkf=(2/T)integral(fksin,t,-T/2,T/2) bkf.simplify_trig() 4sin(1/2pik)/(pi^2k^2)

But today, the answer is : Error in lines 1-1 Traceback (most recent call last): File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 905, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/misc/functional.py", line 664, in integral return x.integral(args, *kwds) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/functions/piecewise.py", line 837, in integral F = self.integral(x) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/functions/piecewise.py", line 877, in integral area += fun.integral(x, start, end) File "sage/symbolic/expression.pyx", line 11352, in sage.symbolic.expression.Expression.integral (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/expression.cpp:60288) return integral(self, args, *kwds) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 761, in integrate return definite_integral(expression, v, a, b, hold=hold) File "sage/symbolic/function.pyx", line 988, in sage.symbolic.function.BuiltinFunction.__call__ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:11343) res = super(BuiltinFunction, self).__call__( File "sage/symbolic/function.pyx", line 503, in sage.symbolic.function.Function.__call__ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:7110) res = g_function_evalv(self._serial, vec, hold) File "sage/symbolic/function.pyx", line 1059, in sage.symbolic.function.BuiltinFunction._evalf_or_eval_ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:12072) return self._eval0_(args) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 176, in _eval_ return integrator(args) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 24, in maxima_integrator result = maxima.sr_integral(expression, v, a, b) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 776, in sr_integral return max_to_sr(maxima_eval(([max_integrate],[sr_to_max(SR(a)) for a in args]))) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1630, in max_to_sr args=[max_to_sr(a) for a in max_args] File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1630, in max_to_sr args=[max_to_sr(a) for a in max_args] File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1630, in max_to_sr args=[max_to_sr(a) for a in max_args] File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1630, in max_to_sr args=[max_to_sr(a) for a in max_args] File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1631, in max_to_sr return op(args) File "sage/symbolic/function.pyx", line 841, in sage.symbolic.function.GinacFunction.__call__ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:9780) res = super(GinacFunction, self).__call__(args, **kwds) File "sage/symbolic/function.pyx", line 979, in sage.symbolic.function.BuiltinFunction.__call__ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:11148) res = method() File "sage/symbolic/expression.pyx", line 7169, in sage.symbolic.expression.Expression.cos (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/expression.cpp:39288) g_hold_wrapper(g_cos, self._gobj, hold)) RuntimeError: stub

click to hide/show revision 2
No.2 Revision

integrate and simplify

Hello, Here is a list of command lines that used to work fine one year ago, but today, it's not :

fksin=piecewise([[(-2,0),f1(t)sin(kwt)],[(0,1),f2(t)sin(kwt)],[(1,2),f3(t)sin(kwt)]]) var('t

> fksin=piecewise([[(-2,0),f1(t)*sin(k*w*t)],[(0,1),f2(t)*sin(k*w*t)],[(1,2),f3(t)*sin(k*w*t)]])
>var('t k')
  assume(k,'integer')
  f1(t)=0
  f2(t)=t
  f3(t)=2-t
  T=4
  w=2pi/T
  f=piecewise([[(-2,0),f1],[(0,1),f2],[(1,2),f3]])
  fkcos=piecewise([[(-2,0),f1(t)cos(kwt)],[(0,1),f2(t)cos(kwt)],[(1,2),f3(t)cos(kwt)]])
  bkf=(2/T)integral(fksin,t,-T/2,T/2)
  bkf.simplify_trig()
  4sin(1/2pik)/(pi^2k^2)

>assume(k,'integer') >f1(t)=0 >f2(t)=t >f3(t)=2-t >T=4 >w=2*pi/T >f=piecewise([[(-2,0),f1],[(0,1),f2],[(1,2),f3]]) >fkcos=piecewise([[(-2,0),f1(t)*cos(k*w*t)],[(0,1),f2(t)*cos(k*w*t)],[(1,2),f3(t)*cos(k*w*t)]]) >bkf=(2/T)*integral(fksin,t,-T/2,T/2) >bkf.simplify_trig() 4*sin(1/2*pi*k)/(pi^2*k^2)

But today, the answer is : Error in lines 1-1 Traceback (most recent call last): File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 905, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/misc/functional.py", line 664, in integral return x.integral(args, *kwds) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/functions/piecewise.py", line 837, in integral F = self.integral(x) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/functions/piecewise.py", line 877, in integral area += fun.integral(x, start, end) File "sage/symbolic/expression.pyx", line 11352, in sage.symbolic.expression.Expression.integral (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/expression.cpp:60288) return integral(self, args, *kwds) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 761, in integrate return definite_integral(expression, v, a, b, hold=hold) File "sage/symbolic/function.pyx", line 988, in sage.symbolic.function.BuiltinFunction.__call__ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:11343) res = super(BuiltinFunction, self).__call__( File "sage/symbolic/function.pyx", line 503, in sage.symbolic.function.Function.__call__ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:7110) res = g_function_evalv(self._serial, vec, hold) File "sage/symbolic/function.pyx", line 1059, in sage.symbolic.function.BuiltinFunction._evalf_or_eval_ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:12072) return self._eval0_(args) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 176, in _eval_ return integrator(args) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 24, in maxima_integrator result = maxima.sr_integral(expression, v, a, b) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 776, in sr_integral return max_to_sr(maxima_eval(([max_integrate],[sr_to_max(SR(a)) for a in args]))) File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1630, in max_to_sr args=[max_to_sr(a) for a in max_args] File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1630, in max_to_sr args=[max_to_sr(a) for a in max_args] File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1630, in max_to_sr args=[max_to_sr(a) for a in max_args] File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1630, in max_to_sr args=[max_to_sr(a) for a in max_args] File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 1631, in max_to_sr return op(args) File "sage/symbolic/function.pyx", line 841, in sage.symbolic.function.GinacFunction.__call__ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:9780) res = super(GinacFunction, self).__call__(args, **kwds) File "sage/symbolic/function.pyx", line 979, in sage.symbolic.function.BuiltinFunction.__call__ (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/function.cpp:11148) res = method() File "sage/symbolic/expression.pyx", line 7169, in sage.symbolic.expression.Expression.cos (/projects/sage/sage-6.10/src/build/cythonized/sage/symbolic/expression.cpp:39288) g_hold_wrapper(g_cos, self._gobj, hold)) RuntimeError: stub