3D绘图Python输入,时间,输出

时间:2016-01-31 16:33:35

标签: python matplotlib plot 3d

我想使用matplot在3D绘图中绘制输入数据(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)

0 个答案:

没有答案