From 4422c12155c110feaa3c5e1e078ff954ce2d103f Mon Sep 17 00:00:00 2001 From: ocean Date: Mon, 26 Jan 2026 14:49:42 +0000 Subject: [PATCH] Fixed negativity in sqrt in costs.py by np.clip. --- process/costs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/process/costs.py b/process/costs.py index f1aa09dc79..c5fe104d5e 100644 --- a/process/costs.py +++ b/process/costs.py @@ -3026,7 +3026,8 @@ def coelc(self): # Annual cost of operation and maintenance annoam = cost_variables.ucoam[cost_variables.lsa - 1] * np.sqrt( - heat_transport_variables.p_plant_electric_net_mw / 1200.0e0 + np.clip(heat_transport_variables.p_plant_electric_net_mw, 0, np.inf) + / 1200.0e0 ) # Additional cost due to pulsed reactor thermal storage @@ -3097,7 +3098,8 @@ def coelc(self): # Annual cost of waste disposal annwst = cost_variables.ucwst[cost_variables.lsa - 1] * np.sqrt( - heat_transport_variables.p_plant_electric_net_mw / 1200.0e0 + np.clip(heat_transport_variables.p_plant_electric_net_mw, 0, np.inf) + / 1200.0e0 ) # Cost of electricity due to waste disposal