Ask Your Question

hausdorff's profile - activity

2019-03-18 12:47:47 -0500 received badge  Popular Question (source)
2018-08-31 12:45:16 -0500 commented answer Sage could be even more clever - How to force the use of 'sympy' backend for simplifying symbolic integrals?

Thanks, that was the workaround I was looking for!

2018-08-16 12:02:38 -0500 commented answer Solved: Why does integrate(psi(y)*f(y),y) return an error but integrate(psi(t,y)*f(t,y),y) works?

That's good to know, I'll take it as an exception then -- and nothing better to understand the software then a bug being explained!

2018-08-16 11:56:40 -0500 commented answer Solved: Why does integrate(psi(y)*f(y),y) return an error but integrate(psi(t,y)*f(t,y),y) works?

seems to be a whitespace indent Found it!

2018-08-16 11:54:20 -0500 asked a question Sage could be even more clever - How to force the use of 'sympy' backend for simplifying symbolic integrals?

Hi there,

I have noticed the following problem:

sage: f = function('f')(x)                                                                                                                                 
sage: var('h')
sage: integrate(exp(h)*exp(x)*f(x),x)
integrate(e^(h + x)*f(x), x)

The workaround seems to be using the sympy backend for symbolic integration

sage: integrate(exp(h)*exp(x)*f(x),x,algorithm='sympy')                                                                                              
e^h*integrate(e^x*f(x), x)

which always seems to be a good idea as I learned from @Emmanuel Charpentier over here.

Now I would like to force the use of algorith='sympy' for simplifying these integrate(...) expressions globally. Unfortunately, the simplify() command does not allow to set this option.

sage: integrate(exp(h)*exp(x)*f(x),x)                                                                                                                
integrate(e^(h + x)*f(x), x)                                                                                                                         
sage: _.simplify()                                                                                                                                   
integrate(e^(h + x)*f(x), x)

TL;DR How can I force sage to pull out these type of exponential constants from the integral with the simplify() command?

2018-08-16 10:50:40 -0500 received badge  Good Question (source)
2018-08-16 10:37:46 -0500 commented answer Solved: Why does integrate(psi(y)*f(y),y) return an error but integrate(psi(t,y)*f(t,y),y) works?

Thank you for the quick answer! I struggled to format my post -- what are the html tags for the nice verbatim code block?

2018-08-16 10:25:01 -0500 commented answer Solved: Why does integrate(psi(y)*f(y),y) return an error but integrate(psi(t,y)*f(t,y),y) works?

Thank you very much, that is a very thorough answer!

Just started playing around with SAGE, didn't expect the underlying cracks to show up that quickly....

Do you think I should file another ticket or can I somehow 'push' yours?

2018-08-16 10:21:58 -0500 received badge  Supporter (source)
2018-08-16 10:21:46 -0500 received badge  Scholar (source)
2018-08-13 12:12:26 -0500 received badge  Nice Question (source)
2018-08-08 08:33:05 -0500 received badge  Editor (source)
2018-08-08 07:43:48 -0500 received badge  Student (source)
2018-08-08 07:23:22 -0500 asked a question Solved: Why does integrate(psi(y)*f(y),y) return an error but integrate(psi(t,y)*f(t,y),y) works?

Hi there,

I am trying get an symbolic expression for the convolution $$ (\psi \star f)(x) := \int\limits_{\mathbb{R}} \psi(x-y) f(y) {d y} $$

of two functions $ f, \psi: \mathbb{R} \to \mathbb{R} $ as follows:

var('y')
psi = function('psi')(y)
f = function('f')(y)
integrate(psi(x-y)*f(y),y)

upon which I get the error message

RuntimeError: ECL says: Error executing code in Maxima:

If I add an extra argument to the two functions and define them as $$ f, \psi : \mathbb{R} \times \mathbb{R} \to \mathbb{R} $$ as follows:

var('t')
psi = function('psi')(t,y)
f = function('f')(t,y)
integrate(psi(t,x-y)*f(t,y),y)

there is a surprise, it suddenly works! I get the desired symbolic expression on which I can run diff(..,x) and all the other built-in functions.

TL;DR Why does integrate(psi(y)*f(y),y) return an error?

Solution Use sympy backend for symbolic integration as in integrate(psi(x-y)*f(y),y, algorithm="sympy")