From be3dbd1fd0545b2a2e9b46f3f3fd558cc7f2df57 Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Sat, 2 Nov 2024 01:09:43 +0000 Subject: [PATCH] Changed guard against division by zero This is to port the improvement for Buildings, #4032 --- IBPSA/Electrical/DC/Loads/Resistor.mo | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/IBPSA/Electrical/DC/Loads/Resistor.mo b/IBPSA/Electrical/DC/Loads/Resistor.mo index d12c94d174..547d7ef749 100644 --- a/IBPSA/Electrical/DC/Loads/Resistor.mo +++ b/IBPSA/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=IBPSA.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,12 +44,17 @@ The temperature T is the temperature of the heat port if useHeatPor ", revisions="