0

假设我以这个盒子为例:

2D 粗粒度嵌入式 Rossler 系统(x 分量)

我想计算嵌入相空间中的平均方向向量。平均方向向量 V_k 在轨迹通过第 k 个框的每个通道 p 处计算。这会生成一个单位向量 e_p,其方向由轨迹进入盒子的相空间点和轨迹离开盒子的相空间点确定。这里有 2 种方法,我不确定什么是正确的方法,或者两者都错了:

def unit_vector(v):
    return v / np.linalg.norm(v)

# x-line and y-line
x = 0.00066496
y = 0.00069381

# y-vals along x-line
ys = [0.0007515997, 0.0007516736, 0.0007517695, 0.0007517716, 0.0007517978, 0.0007518086, 0.0007518439,
      0.0007518738, 0.0007518758, 0.0007518850, 0.0007518883, 0.0007518912, 0.0007518925, 0.0007519232]
# x-vals along y-line
xs = [0.0007860762, 0.0007861990, 0.0007862053, 0.0007862724, 0.0007862800, 0.0007863471, 0.0007864196,
      0.0007864439, 0.0007864641, 0.0007864704, 0.0007864773, 0.0007864814, 0.0007864959, 0.0007865132]

# Create the coordinates
A, B = [], []
for i, j in zip(ys, xs):
    A.append([x, i])
    B.append([j, y])
A = np.matrix(A)
B = np.matrix(B)

# Method 1
avg_direction_unit_vector = []
for i in range(len(A)):
    avg_direction_unit_vector.append([unit_vector(A[i, 0] - B[i, 0]), unit_vector(A[i, 1] - B[i, 1])])

V = np.mean(np.array(avg_direction_unit_vector), axis=0)
print(np.abs(V))

# Method 2
avg_direction_unit_vector = []
for i in range(len(A)):
    avg_direction_unit_vector.append(unit_vector([A[i, 0] - B[i, 0], (A[i, 1] - B[i, 1])]))
V = np.mean(avg_direction_unit_vector, axis=0)
print(np.abs(V))

这是幻灯片中的方法: 确定性测试

4

0 回答 0