-2

我正在使用的方程式是

$$ E = M_e + \sum_{n = 1}^N\frac{2}{n}\mathcal{J}_n(ne)\sin(nM_e) $$

其中 $\mathcal{J}_n(x)$ 是第 n 个第一类贝塞尔函数。

作为测试,我绘制了前 6 个 Bessel 函数,一切正常。当我输入 $n * e$ 的参数时,情节并不是我预期的那样。

import numpy as np
import pylab as py
import scipy.special as sp

x = np.linspace(0, 15, 500000)

for v in range(0, 6):
    py.plot(x, sp.jv(v, x))

py.xlim((0, 15))
py.ylim((-0.5, 1.1))
py.legend(('$\mathcal{J}_0(x)$', '$\mathcal{J}_1(x)$', '$\mathcal{J}_2(x)$',
           '$\mathcal{J}_3(x)$', '$\mathcal{J}_4(x)$', '$\mathcal{J}_5(x)$'),
           loc = 0)
py.xlabel('$x$')
py.ylabel('$\mathcal{J}_n(x)$')
#py.title('Plots of the first six Bessel Functions')                                
py.grid(True)
#py.savefig('besseln0to6.eps', format = 'eps')                                      
py.show()

e = 0.99


def E(M):
    return (M + sum(2.0 / n * sp.jv(n * e, M) * np.sin(n * M)
                    for n in range(1, 3, 1)))

M = np.linspace(0, 2 * np.pi, 500000)

fig2 = py.figure()
ax2 = fig2.add_subplot(111, aspect = 'equal')
ax2.plot(E(M), M, 'b')


def E2(M):
    return (M + sum(2.0 / n * sp.jv(n * e, M) * np.sin(n * M)
                    for n in range(1, 11, 1)))


ax2.plot(E2(M), M, 'r')
py.xlim((0, 2 * np.pi))
py.ylim((0, 2 * np.pi))
py.xlabel('Eccentric anomaly, $E$')
py.ylabel('Mean anomaly, $M_e$')
py.show()

在此处输入图像描述

该图应该看起来像 n = 10

在此处输入图像描述

4

1 回答 1

2

问题是贝塞尔函数的使用,sp.jv(n * e, M)而它应该是顺序、参数。这反过来导致sp.jv(n , n * e)which 生成正确的情节。

于 2013-05-27T19:31:22.607 回答