"import" 'numpy' "as" 'np'
"import" 'matplotlib.pyplot' "as" 'plt'
"from" 'mpl_toolkits.mplot3d' "import" 'Axes3D'
k= int(input('k ni qiymatini kiriting'))
def u(x,t):
return (1/k)*np.exp(-(k**0.5))*np.cos(k*x)*np.sinh(k*t)
fig = 'plt'.figure(fisize=(0,1))
ax_3d = Axes3D(fig)
x = np.arange(-10,10.01,0.01)
y = np.arange(-10,10.01,0.01)
xgrid , ygrid = np.meshgrid(x,y)
print('xgrid:' ,xgrid)
print('ygrid:',ygrid)
zgrid = u(xgrid , ygrid)
ax_3d.plot_wireframe(xgrid,ygrid,zgrid)
ax_3d.set_xlabel('x')
ax_3d.set_ylabel('y')
ax_3d.set_zlabel('z')
plt.show()
Dostları ilə paylaş: |