我想用matplot在3D plot中绘制输入数据(X)、时间(y)和输出(Z)。我找到了一个教程mplot3d example code,但仍然有一个错误我找不到。你知道吗
mdot0是我的输入参数。我想用odeint解我的微分方程,并把它们保存在结果中。 这样,每个mdot0的结果是100x11矩阵。你知道吗
希望有人能帮我
这是我的密码:
#############################################################################
start_time=0.
end_time=600
resolution=100
t=linspace(start_time, end_time, resolution)
N=100
number_of_equations=11
#############################################################################
def odefunk(equations_to_solve, Tu, t, input_data):
T0=zeros(nT)+Tu
solv=odeint(equations_to_solve,T0,t,args=(Tu,input_data,alpha,A,m,cp,Q,epsilon,PTC))-273.15
return solv
mdot =array([16.4*lmin, mdotL ,33.4*lmin, 0*50.3*lmin, 0.2*lmin])
mdot0=linspace(10.4*lmin,16.4*lmin,N)
n_var=5
fig = plt.figure()
ax = fig.gca(projection='3d')
for mdot[0] in mdot0:
f=odefunk(basicsAuto.dTSystem, Tu, t, mdot)
surf = ax.plot_surface(mdot[0], t,f[:,8] , rstride=1, cstride=1, cmap=cm.coolwarm,
linewidth=0, antialiased=False)
ax.set_zlim(0., 25.)
ax.zaxis.set_major_locator(LinearLocator(10))
ax.zaxis.set_major_formatter(FormatStrFormatter('%.02f'))
fig.colorbar(surf, shrink=0.5, aspect=5)
目前没有回答
相关问题 更多 >
编程相关推荐