ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 29 Dec 2018 22:37:22 +0100TypeError 'unable to simplify to float approximation' while trying to define an integral operatorhttps://ask.sagemath.org/question/44805/typeerror-unable-to-simplify-to-float-approximation-while-trying-to-define-an-integral-operator/ Hello, I am trying to define an integral operator acting on a subspace of $L^2(\mathbb{R})$ that depends of time using sage. Being more explicit $W(t)$ takes a real function $f$ and returns another function $g$ defined by
\begin{equation}
W(t)f(x)=g(x)=\int_{-\infty}^{+\infty}K(x,y,z)f(y)\text{d}y
\end{equation}
This is the code I came up with
def W(t):
def dummy2(f):
def dummy3(x):
integrand(y)=f(y)*K(x,y,t)
return numerical_integral(integrand,-Infinity,+Infinity,algorithm='qag')[0]
return dummy3
return dummy2
With $K$ a reasonable function of $x,y,t$
However I am getting the following error
TypeError: unable to simplify to float approximation
I am pretty sure it's related to the types passed to numerical_integrand
What could be a solution? Or a better way to implement it?
Thank you allguesswhowhereSat, 29 Dec 2018 22:37:22 +0100https://ask.sagemath.org/question/44805/