首页 > 解决方案 > 如何计算速度的相空间并在python中绘制散点图?

问题描述

我有一个时间序列速度的向量。例如 :

u=[100,120,150,115,130,115,105,103,108,132,135,121]

现在我需要计算Δu,然后绘制散点图。如下图所示。我怎样才能做到这一点?

在此处输入图像描述

标签: pythonpython-3.xmatplotlib

解决方案


import numpy as np
import matplotlib.pyplot as plt

u = np.array([100,120,150,115,130,115,105,103,108,132,135,121])
du = u[1:] - u[:-1] # the difference between the current and the prior velocity

plt.scatter(u[1:],du)
plt.show()

推荐阅读