我想知道是否有可能用Tensorflow求解一维热传导方程。等式是:
是否可以将以下python代码转换为Tensorflow输入?非常感谢你。
# Initial and boundary conditions
T = np.ones(shape=(mesh_num+1,1))*T_amb
T[0] = 0.
T[mesh_num] = 0.
# Solve discrete equation
for k in range(Total_itr_num):
epsT = np.sin(3.0*np.pi/200.0*T)
source = epsT *(T_amb**4-T**4) + h*(T_amb-T)
for ii in range(mesh_num-1):
i = ii + 1
T[i] = 0.5*(T[i+1]+T[i-1]+source[i]*dx*dx)