我的功能是:def g(R, r):
return (np.sqrt(2.0 * (R + r) / (r * R)) - (1 + np.sqrt(R)) / np.sqrt(R) -
np.sqrt(2.0 / (r * (1 + r))) * (1 - r) -
(1.0 / np.sqrt(R) - np.sqrt(2.0) * (1 - R) / np.sqrt(R * (1 + R))
- 1))
函数是通过设置delta v_B = delta v_H来定义的,其中delta v_B是
^{pr2}$
并且delta v_H是1.0 / np.sqrt(R) - np.sqrt(2.0) * (1 - R) / np.sqrt(R * (1 + R)) - 1
因此,我把g写成delta v_b - delta v_H。在
下面是我的函数和代码:import pylab
import numby as np
def g(R, r):
return (np.sqrt(2.0 * (R + r) / (r * R)) - (1 + np.sqrt(R)) / np.sqrt(R) -
np.sqrt(2.0 / (r * (1 + r))) * (1 - r) -
(1.0 / np.sqrt(R) - np.sqrt(2.0) * (1 - R) / np.sqrt(R * (1 + R))
- 1))
r = np.linspace(11.9, 16, 500000)
R = np.linspace(1, 20, 500000)
fig2 = pylab.figure()
ax2 = fig2.add_subplot(111)
ax2.plot(R, g(R, r),