I am very new to python and I have to animate wave function depending on time and position. The formula is a sum of sin and cos function, depending of n and m integers. In the formula there is also x, which I would like to leave as a variable and do the summation, and then have a wave function depending only on x. Is it somehow possible? Here is a part with summation:
import sympy as sp
import numpy as np
n = sp.Symbol('n', integer = True, positive = True)
m = sp.Symbol('m', integer = True, positive = True)
x = sp.Symbol('x', real = True)
t = sp.Symbol('t', real = True, positive = True)
a = sp.Symbol('a', real = True, positive = True)
h = sp.Symbol('hbar', real = True, positive = True)
mass = sp.Symbol('m', real = True, positive = True)
V0 = sp.Symbol('V')
C = 4 * mass * a**2 * V0 / sp.pi**3 / h**2
summ = sp.sin(m * sp.pi * x / a)/(n**2 - m**2)**2 * (n * sp.sin(sp.pi * m / 2) * sp.cos(sp.pi * n / 2) + m * sp.sin(sp.pi * n / 2) * sp.cos(sp.pi * m / 2))
Psi0 = lambdify((x, n, m), (summ).subs({h: 6.6 * 10**(-16), a: 1, mass: 9.1 * 10**(-31), V0: 10}))
Psi1 = 0
for i in range (0, 1000):
for j in range (0, 1000):
if i != j:
Psi1 += C * Psi0 (x, i, j)