我有一个等式,如下:
R - ((1.0 - np.exp(-tau))/(1.0 - np.exp(-a*tau))) = 0.
我想tau用numpy中可用的数值解算器在这个等式中求解.最好的方法是什么?
对于该公式的不同实现,该等式中的值R和a该等式的值不同,但是当要针对tau求解时,将其固定在特定值.
我正在使用 matplotlib 构建一个 3D 散点图,但无法使生成的图形具有所有 3 个轴的共同原点。我怎样才能做到这一点?
我的代码(到目前为止),我还没有为轴规范实现任何定义,因为我对 Python 非常陌生:
from mpl_toolkits.mplot3d.axes3d import Axes3D
import matplotlib.pyplot as plt
# imports specific to the plots in this example
import numpy as np
from matplotlib import cm
from mpl_toolkits.mplot3d.axes3d import get_test_data
def randrange(n, vmin, vmax):
return (vmax-vmin)*np.random.rand(n) + vmin
# Same as wide as it is tall.
fig = plt.figure(figsize=plt.figaspect(1.0))
ax = fig.add_subplot(111, projection='3d')
n = 512
xs = np.random.randint(0, 10, size=n)
ys = np.random.randint(0, 10, size=n)
zs = np.random.randint(0, 10, size=n) …Run Code Online (Sandbox Code Playgroud)