Кто -нибудь знает, как получить, например, 1 -й и 2 -й производные с использованием DST? Вот мой черновик: < /p>
Код: Выделить всё
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import dst, idst, dct, idct
L = 10
N = 100
a = 0.4
x = np.linspace(0,L,N)
# function
u = np.sin(2*np.pi*x/L)*np.exp(-a*x)
# exact 1st derivative
du = np.exp(-a*x)*(-a*np.sin(2*np.pi*x/L) + np.cos(2*np.pi*x/L)*2*np.pi/L)
# get 1st derivative
dufft = idst(-dct(u))
plt.figure()
plt.plot(x,u)
plt.plot(x,du)
plt.figure()
plt.plot(x,dufft)
plt.show()
Подробнее здесь: https://stackoverflow.com/questions/576 ... ck-dst-dct