我正在尝试通过计算e^sin(x)
来找到P'(x)
的导数的频谱近似。{>
def solve4(N):
xlist = [] #list of all x values
flist = [] #list of all f values
deriv = [] #list of first derivative of all values in f
for j in range(0,N):
xlist.append((j*2*pi)/N)
for x in xlist:
flist.append(e**(sin(x)))
for i in range(0,N):
deriv.append((cos(xlist[i]))*(flist[i]))
P = np.fft.fft(xlist,N) #P is an array after xlist's FFT