使用Tensorflow解决PDE问题

时间:2016-10-20 04:39:51

标签: tensorflow

我想知道是否有可能用Tensorflow求解一维热传导方程。等式是:

enter image description here

是否可以将以下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)

0 个答案:

没有答案