From 43f49a78c6955ec943ec9ff4140653a6526b2f28 Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Mon, 4 Nov 2024 13:25:32 +0000 Subject: [PATCH] Changed guard against division by zero (#4035) This closes #4032 --- Buildings/Electrical/DC/Loads/Resistor.mo | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Buildings/Electrical/DC/Loads/Resistor.mo b/Buildings/Electrical/DC/Loads/Resistor.mo index f7800eedc39..a45ffe14a11 100644 --- a/Buildings/Electrical/DC/Loads/Resistor.mo +++ b/Buildings/Electrical/DC/Loads/Resistor.mo @@ -4,7 +4,7 @@ model Resistor "Ideal linear electrical resistor" redeclare package PhaseSystem = PhaseSystems.TwoConductor, redeclare Interfaces.Terminal_n terminal, final mode=Buildings.Electrical.Types.Load.FixedZ_steady_state, - final P_nominal=V_nominal^2/max(R, Modelica.Constants.small)); + final P_nominal=V_nominal^2/max(R, sqrt(Modelica.Constants.small))); extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = T_ref); parameter Modelica.Units.SI.Resistance R(start=1) "Resistance at temperature T_ref"; @@ -44,6 +44,11 @@ The temperature T is the temperature of the heat port if useHeatPor ", revisions="