リビジョン 375c709d
| learn/python/satellite/orbit/orbit_sorabatake/orbit_odeint_3d.py | ||
|---|---|---|
|
return dpdt
|
||
|
|
||
|
|
||
|
def sphere(radius):
|
||
|
theta, phi = np.mgrid[0: np.pi:50j, 0: 2 * np.pi:100j]
|
||
|
x = radius * np.sin(theta) * np.cos(phi)
|
||
|
y = radius * np.sin(theta) * np.sin(phi)
|
||
|
z = radius * np.cos(theta)
|
||
|
return x, y, z
|
||
|
|
||
|
|
||
|
# 微分方程式の初期条件
|
||
|
pv0 = [10000, 0, 0, 0, 6, 3.6] # 位置 (x,y,z) と 速度 (vx, vy, vz)
|
||
|
t = np.linspace(0, 86400, 1000) # 1日分の軌道伝播 1000の区分で計算
|
||
| ... | ... | |
|
fig = plt.figure()
|
||
|
ax = fig.add_subplot(projection='3d')
|
||
|
ax.plot(sol[:, 0], sol[:, 1], sol[:, 2], 'b')
|
||
|
x, y, z = sphere(6400)
|
||
|
ax.plot_wireframe(x, y, z, linewidth=0.2)
|
||
|
ax.set_aspect('equal')
|
||
|
plt.show()
|
||
Add earth on 3d plot with wireframe