gpt4 book ai didi

Mean Square Displacement calculation using FFT(基于FFT的均方位移计算)

转载 作者:bug小助手 更新时间:2023-10-25 23:21:56 27 4
gpt4 key购买 nike



For my array of temperature fluctuations (five million data points as (time, temperature fluctuation) I calculate Mean Square Displacement:

对于我的温度波动数组(500万个数据点作为(时间,温度波动),我计算平均平方位移:


data = np.loadtxt("daily_temp.csv", skiprows = 0, delimiter = ",")
fluctuation = data[:, 3] #This is the temperature fluctuation column
z = len(fluctuation)
t = [np.log(i) for i in range(1, z+1)]
MSD = [i for i in range(z)]
for j in range(z, 0, -1):
n = [i for i in range(j)]
for i in range(j):
a = fluctuation[i]
b = fluctuation[i+z-j]
c = (a-b)**2
n[i] = c
x = sum(n) / j
print(j)
MSD[z - j -1] = np.log10(x)

I took the logarithm because I want a log-log plot of temperature fluctuation vs time. Here is an FFT-based algorithm calculating MSD. I have no understanding on S1 and S2 under the msd_fft function. How to modify the code so it is FFT-based?

我选择这个对数是因为我想要一个温度波动随时间变化的对数对数图。这是一个基于FFT的计算MSD的算法。我对msd_fft函数下的s1和s2一无所知。如何修改代码以使其基于FFT?


更多回答

Have you seen stackoverflow.com/a/34222273/4601890?

你看过Stackoverflow.com/a/34222273/4601890吗?

优秀答案推荐
更多回答

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com