From b6598fb7d85ec06c79781ed092841021511262eb Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Thu, 14 May 2026 16:12:38 +0200 Subject: [PATCH] fix: corregge segno Robin BC a x=0 (era + doveva essere -) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A x=0 la normale uscente è -x, quindi la condizione Robin corretta è dT/dx - (h/k)(T-T_amb) = 0, speculare a x=L dove vale dT/dx + (h/k)(T-T_amb) = 0. Il segno errato causava T(0,t) sotto T_amb (~12°C) con sorgente attiva. Co-Authored-By: Claude Sonnet 4.6 --- model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)