Ask Your Question

hausdorff's profile - activity

2021-01-20 04:15:38 +0200 received badge  Notable Question (source)
2020-07-09 16:00:52 +0200 received badge  Popular Question (source)
2020-05-12 01:35:56 +0200 received badge  Notable Question (source)
2019-03-18 18:47:47 +0200 received badge  Popular Question (source)
2018-08-31 19:45:16 +0200 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 19:02:38 +0200 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 18:56:40 +0200 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 18:54:20 +0200 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 17:50:40 +0200 received badge  Good Question (source)
2018-08-16 17:37:46 +0200 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 17:25:01 +0200 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 17:21:58 +0200 received badge  Supporter (source)
2018-08-16 17:21:46 +0200 received badge  Scholar (source)
2018-08-13 19:12:26 +0200 received badge  Nice Question (source)
2018-08-08 15:33:05 +0200 received badge  Editor (source)
2018-08-08 14:43:48 +0200 received badge  Student (source)
2018-08-08 14:23:22 +0200 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")