diff --git a/model.py b/model.py index 5f003a2..23d4233 100644 --- a/model.py +++ b/model.py @@ -59,7 +59,7 @@ def heat_pinn_loss(model, x_f, t_f, x_ic, t_bc, x_left = torch.zeros(t_bc.shape[0], device=t_bc.device).requires_grad_(True) T_left = model(torch.stack([x_left, t_bc.detach()], dim=1)) dT_dx_left = torch.autograd.grad(T_left.sum(), x_left, create_graph=True)[0] - L_bc_left = ((dT_dx_left + (config.H_CONV / config.K) * (T_left.squeeze() - config.T_AMB)) ** 2).mean() / _bc_scale + L_bc_left = ((dT_dx_left - (config.H_CONV / config.K) * (T_left.squeeze() - config.T_AMB)) ** 2).mean() / _bc_scale # BC x=L: Robin — dT/dx + H_CONV/K * (T(L,t) - T_AMB) = 0 x_right = torch.full((t_bc.shape[0],), config.L, device=t_bc.device).requires_grad_(True)