What I want is to create an indexed function. Something of the form:
Where i is an integer and x is real. The idea is then to be able to integrate or take the x derivative:
I've been looking everywhere how to do it, unsuccessfully.
For example, I attempted the following code:
import sympy as sy
x, n = sy.symbols('x n', real=True, integer=True)
f = sy.Function('f')
f_n = sy.Indexed(f(x), n)
f_n
Only to obtain the following error:
TypeError:
The base can only be replaced with a string, Symbol, IndexedBase or an
object with a method for getting items (i.e. an object with a
`__getitem__` method).
I've tried the next alternative:
import sympy as sy
x, n = sy.symbols('x n', real=True, integer=True)
f = sy.IndexedBase(sy.Function('f'))
f_n = sy.Indexed(f, n)
f_n
But then I get this error:
SympifyError: SympifyError: f
Any help is greatly appreciated!