diff --git a/Modelica/Fluid/Machines.mo b/Modelica/Fluid/Machines.mo index eadbc05207..11c293215c 100644 --- a/Modelica/Fluid/Machines.mo +++ b/Modelica/Fluid/Machines.mo @@ -739,7 +739,7 @@ provided a two-phase medium model is used (see Advanced tab). W_nominal[2] = c[1] + V_flow_nominal[2]*c[2]; */ protected - Real c[2] = Modelica.Math.Matrices.solve([ones(3),V_flow_nominal],W_nominal) + Real c[2] = Modelica.Math.Matrices.solve([ones(2),V_flow_nominal],W_nominal) "Coefficients of linear power consumption curve"; algorithm consumption := c[1] + V_flow*c[2]; diff --git a/ModelicaTest/Fluid/TestComponents/Machines/TestLinearPower.mo b/ModelicaTest/Fluid/TestComponents/Machines/TestLinearPower.mo new file mode 100644 index 0000000000..b34e0de89d --- /dev/null +++ b/ModelicaTest/Fluid/TestComponents/Machines/TestLinearPower.mo @@ -0,0 +1,9 @@ +within ModelicaTest.Fluid.TestComponents.Machines; +model TestLinearPower + extends Modelica.Icons.Example; + Modelica.Units.SI.Power p; +equation + p = Modelica.Fluid.Machines.BaseClasses.PumpCharacteristics.linearPower(V_flow_nominal={1,2}, W_nominal={3,5}, V_flow=11); + assert(p >= 23 and p <= 23, "Error in linearPower"); +annotation(experiment(StopTime=1)); +end TestLinearPower; diff --git a/ModelicaTest/Fluid/TestComponents/Machines/package.order b/ModelicaTest/Fluid/TestComponents/Machines/package.order index ca683b1bd2..8ab8e097f0 100644 --- a/ModelicaTest/Fluid/TestComponents/Machines/package.order +++ b/ModelicaTest/Fluid/TestComponents/Machines/package.order @@ -12,3 +12,4 @@ TestWaterPumpNPSH TestWaterPumpPowerCharacteristic TestWaterPumpRecirculation TestWaterPumpVariableSpeed +TestLinearPower diff --git a/ModelicaTest/Resources/Reference/ModelicaTest/Fluid/TestComponents/Machines/TestLinearPower/comparisonSignals.txt b/ModelicaTest/Resources/Reference/ModelicaTest/Fluid/TestComponents/Machines/TestLinearPower/comparisonSignals.txt new file mode 100644 index 0000000000..be59cc0a30 --- /dev/null +++ b/ModelicaTest/Resources/Reference/ModelicaTest/Fluid/TestComponents/Machines/TestLinearPower/comparisonSignals.txt @@ -0,0 +1,2 @@ +time +p