python - 计算python中CARTHE漂移器集的相对离散度
问题描述
我正在尝试计算 CARTHE 漂移组的相对分散度;这是作为时间函数的平均对间隔距离的平方,然后在 python 中将色散绘制为时间的函数。D(t) = sqrt(平均(d^2(t)))
我认为编码公式 D(t) 运行正确,但我不能确定我的输出是否正确。我似乎也无法将 D(t) 和距离绘制在同一个数字上。这是当前代码:
import matplotlib.pyplot as plt
import math
import statistics
def Main():
distance = [1.1725e+05, 1.8653e+05, 4.2449e+05, 8.7399e+05] # ID281 ID496, red
time = [5, 10, 20, 40]
dt = math.sqrt( statistics.mean(distance) ** (2*(statistics.mean(time))) ) # D(t)=sqrt(mean(d^2(t)))
print(dt)
plt.plot(distance, time, color='red', markersize=22)
plt.plot(dt, time,'--', color='red', markersize=20)
plt.rc('xtick', labelsize=30)
plt.rc('ytick', labelsize=30)
plt.xlabel("distance (m)", fontsize=46)
plt.ylabel("days", fontsize=46)
plt.title("Seperation Distance Between Drifters Pairs", fontsize=52)
plt.show()
解决方案
推荐阅读
- vba - 使用 ItemAdd 事件将邮件项移动/复制到文件夹会生成错误
- c# - 如何在 WPF 中显示和绑定数据属性的变量编号(和类型)
- web-services - MSI 安装成功但未安装服务,事件日志中出现 MsiExec 错误
- excel - 更好的做事方式?VBA
- java - 将文件上传到只能通过另一个 SSH/SFTP 服务器访问的 SFTP 服务器
- ios - 我应该在 iPhone X 和 iPhone 8 Plus 中选择哪些@3x 图片
- c++ - C++ 正则表达式从字符串中提取所有可能的 10 位数字
- android - 在用户滑动删除应用程序之前删除文件
- html - 如何在 HTML FlexBox 中将文本与换行符右对齐
- python - 在熊猫分组后选择样本随机组?