Repository: NREL/OpenStudio (language: python)

Issue:
Allow non-Quadratic curves for the EIR-f-PLR for the Chiller:Electric:EIR object
Enhancement Request
--------------
Allow other univariable curve types to be used to set the electric input to cooling output ratio as a function of the part load ratio for the EIR electric chiller object.

## Detailed Description
Currently, only quadratic curves can be used to set the EIR-f-PLR input of the Chiller:Electric:EIR object in OpenStudio as documented [here](https://openstudio-sdk-documentation.s3.amazonaws.com/cpp/OpenStudio-3.4.0-doc/model/html/classopenstudio_1_1model_1_1_chiller_electric_e_i_r.html#a82684ecd3a44088224108ea328fa674b). The same input in EnergyPlus allows other univariable curve types such as cubic curves.

Allow non-Quadratic curves for the EIR-f-PLR for the Chiller:Electric:EIR object
Enhancement Request
--------------
Allow other univariable curve types to be used to set the electric input to cooling output ratio as a function of the part load ratio for the EIR electric chiller object.

## Detailed Description
Currently, only quadratic curves can be used to set the EIR-f-PLR input of the Chiller:Electric:EIR object in OpenStudio as documented [here](https://openstudio-sdk-documentation.s3.amazonaws.com/cpp/OpenStudio-3.4.0-doc/model/html/classopenstudio_1_1model_1_1_chiller_electric_e_i_r.html#a82684ecd3a44088224108ea328fa674b). The same input in EnergyPlus allows other univariable curve types such as cubic curves.



Discussion / hints:

Fix patch:
diff --git a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_4_1_TBD.md b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_4_1_TBD.md
new file mode 100644
index 00000000000..4f82839e709
--- /dev/null
+++ b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_4_1_TBD.md
@@ -0,0 +1,91 @@
+# OpenStudio Version 3.4.1 (TDB)
+
+_Release Notes_ -  _TDB_
+
+These release notes describe version 3.4.1 of the OpenStudio SDK developed by the National Renewable Energy Laboratory (NREL), Buildings and Thermal Sciences Center, Commercial Buildings Research Group, Tools Development Section, and associated collaborators. The notes are organized into the following sections:
+
+-  Overview
+-  Where to Find OpenStudio Documentation
+-  Installation Notes
+-  OpenStudio SDK: Changelog
+
+# Overview
+
+As of April 2020, development and distribution of the OpenStudioApplication and the SketchUp plugin have transitioned to the OpenStudio Coalition, who is independently managing and distributing the software through its own [openstudiocoalition/OpenStudioApplication](https://github.com/openstudiocoalition/OpenStudioApplication) repository. The OpenStudio SDK is continuing to be actively developed and distributed by NREL and is released two times per year, through a spring and a fall release.
+
+Below is the list of components that is included in this SDK installer:
+
+__**OpenStudio SDK 3.4.1**__
+- EnergyPlus
+- Command Line Interface (CLI)
+- Radiance
+- Ruby API
+- C++ SDK
+
+**Note** that [PAT](https://github.com/NREL/OpenStudio-PAT) is not included in either the SDK or the OpenStudio Coalition's Application installers. You will need to install PAT separately which is distributed on the [OpenStudio-PAT](https://github.com/NREL/OpenStudio-PAT) GitHub page.
+
+# Where to Find OpenStudio SDK Documentation
+
+- OpenStudio SDK release documentation, including these release notes, tutorials, and other user documentation, is available at [https://www.openstudio.net/](https://www.openstudio.net/.)
+- C++ API documentation is available at [https://openstudio-sdk-documentation.s3.amazonaws.com/index.html](https://openstudio-sdk-documentation.s3.amazonaws.com/index.html)
+- Measure development documentation is available at [http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/](http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/ )
+- A roadmap for planned features is available at http://nrel.github.io/OpenStudio-user-documentation/getting_started/roadmap/.
+
+# Installation Notes
+
+OpenStudio SDK 3.4.1 is supported on 64-bit Windows 7 – 10, OS X 10.15, and Ubuntu 18.04, 20.04
+
+OpenStudio SDK 3.4.1 supports [EnergyPlus Release 22.1.0](https://github.com/NREL/EnergyPlus/releases/tag/v22.1.0), which is bundled with the OpenStudio installer. It is no longer necessary to download and install EnergyPlus separately. Other builds of EnergyPlus are not supported by OpenStudio SDK 3.4.1.
+
+OpenStudio SDK 3.4.1 supports Radiance 5.0.a.12, which is bundled with the OpenStudio installer; users no longer must install Radiance separately, and OpenStudio will use the included Radiance version regardless of any other versions that may be installed on the system. Other builds of Radiance are not supported by OpenStudio SDK 3.4.1.
+
+As usual, you can refer to the **[OpenStudio SDK Compatibility Matrix](https://github.com/NREL/OpenStudio/wiki/OpenStudio-SDK-Version-Compatibility-Matrix)** for more information.
+
+
+## Installation Steps
+
+- Download and install [OpenStudio SDK](https://github.com/NREL/openstudio) and/or [openstudiocoalition/OpenStudioApplication](https://github.com/openstudiocoalition/OpenStudioApplication) depending on your needs. Select components for installation. Note that OpenStudio Application is a standalone app and does not require you to install OpenStudio SDK.
+- Setup a Building Component Library (BCL) account to access online building components and measures. View instructions on how to setup your account and configure the key in OpenStudio.
+- The OpenStudio Application SketchUp Plug-in requires SketchUp 2021-2022 (not available for Linux). The OpenStudio Application SketchUp Plug-in does not support older versions of SketchUp. SketchUp must be installed before OpenStudio Application to automatically activate the plugin. If you install SketchUp after OpenStudio Application, simply re-run the OpenStudio Application installer.
+
+For help with common installation problems please visit, http://nrel.github.io/OpenStudio-user-documentation/getting_started/getting_started/.
+
+# OpenStudio SDK: Changelog
+
+The 3.4.1 is a minor release. This update includes several new features, performance improvements, and bug fixes.
+You can find the list of Pull Requests that got into this release (**NEEDS UPDATE**) [here](https://github.com/NREL/OpenStudio/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+created%3A2021-04-27..2022-09-26+).
+
+
+## Python Bindings
+
+As of OpenStudio SDK 3.2.0, Python bindings are officially supported and distributed through Python Package Index (PyPI). To install, users will need to have Python3 installed along with pip and simply run the following command in a terminal window.
+
+`pip install openstudio==3.4.1`
+
+Please see [openstudio on PyPi](https://pypi.org/project/openstudio/) for further instructions on how to install. Users can also visit the test channel at [openstudio on TestPyPi](https://test.pypi.org/project/openstudio/) to install development bindings.
+
+You can also refer to the [OpenStudio SDK Python Binding Version Compatibility Matrix](https://github.com/NREL/OpenStudio/wiki/OpenStudio-SDK-Python-Binding-Version-Compatibility-Matrix) to see the list of supported platforms and python versions.
+
+## New Features, Major Fixes and API-breaking changes
+
+* [#4616](https://github.com/NREL/OpenStudio/pull/4616) - Addresses #4611, allow non-Quadratic curves for the EIR-f-PLR for the Chiller:Electric:EIR object
+    * `Chiller:Electric:EIR` has a few API-breaking changes related to its Curves. The types for the constructor, getters and setters used to be explicit (eg: `CurveBiquadratic`): it is now the base class, more generic, `Curve` type for added flexibility.
+
+
+## Minor changes and bug fixes
+
+
+**Developer changes**:
+
+* [OpenStudio-benchmarks](https://github.com/NREL/OpenStudio-benchmarks) - Added additional performance benchmark tests to improve SDK performance.
+
+
+## OpenStudio New Contributors
+
+
+### OpenStudio Standards vXXXX
+
+
+### OpenStudio Server vXXXX
+
+## Issue Statistics Since Previous Release
diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateChillerElectricEIR.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateChillerElectricEIR.cpp
index 9cef0d951ae..291ef9ac7b9 100644
--- a/src/energyplus/ForwardTranslator/ForwardTranslateChillerElectricEIR.cpp
+++ b/src/energyplus/ForwardTranslator/ForwardTranslateChillerElectricEIR.cpp
@@ -35,10 +35,8 @@
 #include "../../model/Node_Impl.hpp"
 #include "../../model/ChillerElectricEIR.hpp"
 #include "../../model/ChillerElectricEIR_Impl.hpp"
-#include "../../model/CurveBiquadratic.hpp"
-#include "../../model/CurveBiquadratic_Impl.hpp"
-#include "../../model/CurveQuadratic.hpp"
-#include "../../model/CurveQuadratic_Impl.hpp"
+#include "../../model/Curve.hpp"
+#include "../../model/Curve_Impl.hpp"
 #include "../../utilities/core/Logger.hpp"
 #include "../../utilities/core/Assert.hpp"
 #include <utilities/idd/Chiller_Electric_EIR_FieldEnums.hxx>
@@ -216,7 +214,7 @@ namespace energyplus {
 
     // CoolingCapacityFunctionofTemperatureCurveName
 
-    CurveBiquadratic curve = modelObject.coolingCapacityFunctionOfTemperature();
+    Curve curve = modelObject.coolingCapacityFunctionOfTemperature();
 
     boost::optional<IdfObject> _curve = translateAndMapModelObject(curve);
 
@@ -236,7 +234,7 @@ namespace energyplus {
 
     // ElectricInputtoCoolingOutputRatioFunctionofPartLoadRatioCurveName
 
-    CurveQuadratic quadcurve = modelObject.electricInputToCoolingOutputRatioFunctionOfPLR();
+    Curve quadcurve = modelObject.electricInputToCoolingOutputRatioFunctionOfPLR();
 
     _curve = translateAndMapModelObject(quadcurve);
 
diff --git a/src/model/ChillerElectricEIR.cpp b/src/model/ChillerElectricEIR.cpp
index 0a0ff85742d..0a355c971f8 100644
--- a/src/model/ChillerElectricEIR.cpp
+++ b/src/model/ChillerElectricEIR.cpp
@@ -34,6 +34,8 @@
 #include "CurveBiquadratic_Impl.hpp"
 #include "CurveQuadratic.hpp"
 #include "CurveQuadratic_Impl.hpp"
+#include "Curve.hpp"
+#include "Curve_Impl.hpp"
 #include "Schedule.hpp"
 #include "Schedule_Impl.hpp"
 #include "Node.hpp"
@@ -164,19 +166,19 @@ namespace model {
       return result;
     }
 
-    CurveBiquadratic ChillerElectricEIR_Impl::coolingCapacityFunctionOfTemperature() const {
+    Curve ChillerElectricEIR_Impl::coolingCapacityFunctionOfTemperature() const {
       WorkspaceObject wo = getTarget(OS_Chiller_Electric_EIRFields::CoolingCapacityFunctionofTemperatureCurveName).get();
-      return wo.optionalCast<CurveBiquadratic>().get();
+      return wo.optionalCast<Curve>().get();
     }
 
-    CurveBiquadratic ChillerElectricEIR_Impl::electricInputToCoolingOutputRatioFunctionOfTemperature() const {
+    Curve ChillerElectricEIR_Impl::electricInputToCoolingOutputRatioFunctionOfTemperature() const {
       WorkspaceObject wo = getTarget(OS_Chiller_Electric_EIRFields::ElectricInputtoCoolingOutputRatioFunctionofTemperatureCurveName).get();
-      return wo.optionalCast<CurveBiquadratic>().get();
+      return wo.optionalCast<Curve>().get();
     }
 
-    CurveQuadratic ChillerElectricEIR_Impl::electricInputToCoolingOutputRatioFunctionOfPLR() const {
+    Curve ChillerElectricEIR_Impl::electricInputToCoolingOutputRatioFunctionOfPLR() const {
       WorkspaceObject wo = getTarget(OS_Chiller_Electric_EIRFields::ElectricInputtoCoolingOutputRatioFunctionofPartLoadRatioCurveName).get();
-      return wo.optionalCast<CurveQuadratic>().get();
+      return wo.optionalCast<Curve>().get();
     }
 
     double ChillerElectricEIR_Impl::minimumPartLoadRatio() const {
@@ -401,21 +403,21 @@ namespace model {
       return result;
     }
 
-    bool ChillerElectricEIR_Impl::setCoolingCapacityFunctionOfTemperature(const CurveBiquadratic& curve) {
+    bool ChillerElectricEIR_Impl::setCoolingCapacityFunctionOfTemperature(const Curve& curve) {
       if (model() != curve.model()) {
         return false;
       }
       return this->setPointer(OS_Chiller_Electric_EIRFields::CoolingCapacityFunctionofTemperatureCurveName, curve.handle());
     }
 
-    bool ChillerElectricEIR_Impl::setElectricInputToCoolingOutputRatioFunctionOfTemperature(const CurveBiquadratic& curve) {
+    bool ChillerElectricEIR_Impl::setElectricInputToCoolingOutputRatioFunctionOfTemperature(const Curve& curve) {
       if (model() != curve.model()) {
         return false;
       }
       return this->setPointer(OS_Chiller_Electric_EIRFields::ElectricInputtoCoolingOutputRatioFunctionofTemperatureCurveName, curve.handle());
     }
 
-    bool ChillerElectricEIR_Impl::setElectricInputToCoolingOutputRatioFunctionOfPLR(const CurveQuadratic& curve) {
+    bool ChillerElectricEIR_Impl::setElectricInputToCoolingOutputRatioFunctionOfPLR(const Curve& curve) {
       if (model() != curve.model()) {
         return false;
       }
@@ -816,8 +818,7 @@ namespace model {
 
   }  // namespace detail
 
-  ChillerElectricEIR::ChillerElectricEIR(const Model& model, const CurveBiquadratic& CCFofT, const CurveBiquadratic& EItoCORFofT,
-                                         const CurveQuadratic& EItoCORFofPLR)
+  ChillerElectricEIR::ChillerElectricEIR(const Model& model, const Curve& CCFofT, const Curve& EItoCORFofT, const Curve& EItoCORFofPLR)
     : WaterToWaterComponent(ChillerElectricEIR::iddObjectType(), model) {
     OS_ASSERT(getImpl<detail::ChillerElectricEIR_Impl>());
 
@@ -959,27 +960,27 @@ namespace model {
     return getImpl<detail::ChillerElectricEIR_Impl>()->isReferenceCondenserFluidFlowRateAutosized();
   }
 
-  bool ChillerElectricEIR::setCoolingCapacityFunctionOfTemperature(const CurveBiquadratic& curve) {
+  bool ChillerElectricEIR::setCoolingCapacityFunctionOfTemperature(const Curve& curve) {
     return getImpl<detail::ChillerElectricEIR_Impl>()->setCoolingCapacityFunctionOfTemperature(curve);
   }
 
-  bool ChillerElectricEIR::setElectricInputToCoolingOutputRatioFunctionOfTemperature(const CurveBiquadratic& curve) {
+  bool ChillerElectricEIR::setElectricInputToCoolingOutputRatioFunctionOfTemperature(const Curve& curve) {
     return getImpl<detail::ChillerElectricEIR_Impl>()->setElectricInputToCoolingOutputRatioFunctionOfTemperature(curve);
   }
 
-  bool ChillerElectricEIR::setElectricInputToCoolingOutputRatioFunctionOfPLR(const CurveQuadratic& curve) {
+  bool ChillerElectricEIR::setElectricInputToCoolingOutputRatioFunctionOfPLR(const Curve& curve) {
     return getImpl<detail::ChillerElectricEIR_Impl>()->setElectricInputToCoolingOutputRatioFunctionOfPLR(curve);
   }
 
-  CurveBiquadratic ChillerElectricEIR::coolingCapacityFunctionOfTemperature() const {
+  Curve ChillerElectricEIR::coolingCapacityFunctionOfTemperature() const {
     return getImpl<detail::ChillerElectricEIR_Impl>()->coolingCapacityFunctionOfTemperature();
   }
 
-  CurveBiquadratic ChillerElectricEIR::electricInputToCoolingOutputRatioFunctionOfTemperature() const {
+  Curve ChillerElectricEIR::electricInputToCoolingOutputRatioFunctionOfTemperature() const {
     return getImpl<detail::ChillerElectricEIR_Impl>()->electricInputToCoolingOutputRatioFunctionOfTemperature();
   }
 
-  CurveQuadratic ChillerElectricEIR::electricInputToCoolingOutputRatioFunctionOfPLR() const {
+  Curve ChillerElectricEIR::electricInputToCoolingOutputRatioFunctionOfPLR() const {
     return getImpl<detail::ChillerElectricEIR_Impl>()->electricInputToCoolingOutputRatioFunctionOfPLR();
   }
 
diff --git a/src/model/ChillerElectricEIR.hpp b/src/model/ChillerElectricEIR.hpp
index dd3c052c357..73741c1d9d0 100644
--- a/src/model/ChillerElectricEIR.hpp
+++ b/src/model/ChillerElectricEIR.hpp
@@ -37,8 +37,7 @@ namespace openstudio {
 
 namespace model {
 
-  class CurveQuadratic;
-  class CurveBiquadratic;
+  class Curve;
   class Schedule;
   class Node;
 
@@ -60,8 +59,7 @@ namespace model {
    *\param EItoCORFofT Electric Input to Cooling Output Ratio as a Function of Temp
    *\param EItoCORFofPLR Electric Input to Cooling Output Ratio as a Function of Partial Load Ratio
    */
-    explicit ChillerElectricEIR(const Model& model, const CurveBiquadratic& CCFofT, const CurveBiquadratic& EItoCORFofT,
-                                const CurveQuadratic& EItoCORFofPLR);
+    explicit ChillerElectricEIR(const Model& model, const Curve& CCFofT, const Curve& EItoCORFofT, const Curve& EItoCORFofPLR);
 
     explicit ChillerElectricEIR(const Model& model);
 
@@ -100,11 +98,11 @@ namespace model {
 
     bool isReferenceCondenserFluidFlowRateAutosized() const;
 
-    CurveBiquadratic coolingCapacityFunctionOfTemperature() const;
+    Curve coolingCapacityFunctionOfTemperature() const;
 
-    CurveBiquadratic electricInputToCoolingOutputRatioFunctionOfTemperature() const;
+    Curve electricInputToCoolingOutputRatioFunctionOfTemperature() const;
 
-    CurveQuadratic electricInputToCoolingOutputRatioFunctionOfPLR() const;
+    Curve electricInputToCoolingOutputRatioFunctionOfPLR() const;
 
     double minimumPartLoadRatio() const;
 
@@ -204,11 +202,11 @@ namespace model {
 
     void autosizeReferenceCondenserFluidFlowRate();
 
-    bool setCoolingCapacityFunctionOfTemperature(const CurveBiquadratic&);
+    bool setCoolingCapacityFunctionOfTemperature(const Curve&);
 
-    bool setElectricInputToCoolingOutputRatioFunctionOfTemperature(const CurveBiquadratic&);
+    bool setElectricInputToCoolingOutputRatioFunctionOfTemperature(const Curve&);
 
-    bool setElectricInputToCoolingOutputRatioFunctionOfPLR(const CurveQuadratic&);
+    bool setElectricInputToCoolingOutputRatioFunctionOfPLR(const Curve&);
 
     bool setMinimumPartLoadRatio(double minimumPartLoadRatio);
 
diff --git a/src/model/ChillerElectricEIR_Impl.hpp b/src/model/ChillerElectricEIR_Impl.hpp
index 887d1342ef2..4ab7d414257 100644
--- a/src/model/ChillerElectricEIR_Impl.hpp
+++ b/src/model/ChillerElectricEIR_Impl.hpp
@@ -36,8 +36,7 @@ namespace openstudio {
 namespace model {
 
   class ChillerElectricEIR;
-  class CurveBiquadratic;
-  class CurveQuadratic;
+  class Curve;
   class Schedule;
   class Node;
 
@@ -127,11 +126,11 @@ namespace model {
 
       bool isReferenceCondenserFluidFlowRateAutosized() const;
 
-      CurveBiquadratic coolingCapacityFunctionOfTemperature() const;
+      Curve coolingCapacityFunctionOfTemperature() const;
 
-      CurveBiquadratic electricInputToCoolingOutputRatioFunctionOfTemperature() const;
+      Curve electricInputToCoolingOutputRatioFunctionOfTemperature() const;
 
-      CurveQuadratic electricInputToCoolingOutputRatioFunctionOfPLR() const;
+      Curve electricInputToCoolingOutputRatioFunctionOfPLR() const;
 
       double minimumPartLoadRatio() const;
 
@@ -231,11 +230,11 @@ namespace model {
 
       void autosizeReferenceCondenserFluidFlowRate();
 
-      bool setCoolingCapacityFunctionOfTemperature(const CurveBiquadratic&);
+      bool setCoolingCapacityFunctionOfTemperature(const Curve&);
 
-      bool setElectricInputToCoolingOutputRatioFunctionOfTemperature(const CurveBiquadratic&);
+      bool setElectricInputToCoolingOutputRatioFunctionOfTemperature(const Curve&);
 
-      bool setElectricInputToCoolingOutputRatioFunctionOfPLR(const CurveQuadratic&);
+      bool setElectricInputToCoolingOutputRatioFunctionOfPLR(const Curve&);
 
       bool setMinimumPartLoadRatio(double minimumPartLoadRatio);
 


Test patch:
diff --git a/src/model/test/ChillerElectricEIR_GTest.cpp b/src/model/test/ChillerElectricEIR_GTest.cpp
index 117fd21c019..94df1be5513 100644
--- a/src/model/test/ChillerElectricEIR_GTest.cpp
+++ b/src/model/test/ChillerElectricEIR_GTest.cpp
@@ -36,6 +36,9 @@
 #include "../ChillerElectricEIR.hpp"
 #include "../CurveBiquadratic.hpp"
 #include "../CurveQuadratic.hpp"
+#include "../CurveQuadratic_Impl.hpp"
+#include "../CurveCubic.hpp"
+#include "../CurveCubic_Impl.hpp"
 #include "../Mixer.hpp"
 #include "../Mixer_Impl.hpp"
 #include "../Splitter.hpp"
@@ -657,3 +660,57 @@ TEST_F(ModelFixture, ChillerElectricEIR_PlantLoopConnections_addToNodeOverride)
   ASSERT_TRUE(chiller.heatRecoveryLoop());
   EXPECT_EQ(hrLoop, chiller.heatRecoveryLoop().get());
 }
+
+TEST_F(ModelFixture, ChillerElectricEIR_ElectricInputToCoolingOutputRatioFunctionOfPLR) {
+  // Test for #4611 - Allow non-Quadratic curves for the EIR-f-PLR for the Chiller:Electric:EIR object
+
+  model::Model model;
+
+  // test ctor 1
+  {
+    // ctor maintains backward compatibility
+    model::ChillerElectricEIR chiller(model);
+    ASSERT_TRUE(chiller.electricInputToCoolingOutputRatioFunctionOfPLR().optionalCast<model::CurveQuadratic>());
+  }
+
+  // test ctor 2
+  {
+    // ctor maintains backward compatibility
+    model::CurveBiquadratic ccFofT(model);
+    model::CurveBiquadratic eirToCorfOfT(model);
+    model::CurveQuadratic eirToCorfOfPlr(model);
+    model::ChillerElectricEIR chiller(model, ccFofT, eirToCorfOfT, eirToCorfOfPlr);
+    ASSERT_TRUE(chiller.electricInputToCoolingOutputRatioFunctionOfPLR().optionalCast<model::CurveQuadratic>());
+    EXPECT_EQ(ccFofT, chiller.coolingCapacityFunctionOfTemperature());
+    EXPECT_EQ(eirToCorfOfT, chiller.electricInputToCoolingOutputRatioFunctionOfTemperature());
+    EXPECT_EQ(eirToCorfOfPlr, chiller.electricInputToCoolingOutputRatioFunctionOfPLR());
+  }
+  {
+    // ctor can now handle cubic curves
+    model::CurveBiquadratic ccFofT2(model);
+    model::CurveBiquadratic eirToCorfOfT2(model);
+    model::CurveCubic eirToCorfOfPlr2(model);
+    model::ChillerElectricEIR chiller(model, ccFofT2, eirToCorfOfT2, eirToCorfOfPlr2);
+    ASSERT_TRUE(chiller.electricInputToCoolingOutputRatioFunctionOfPLR().optionalCast<model::CurveCubic>());
+    EXPECT_EQ(ccFofT2, chiller.coolingCapacityFunctionOfTemperature());
+    EXPECT_EQ(eirToCorfOfT2, chiller.electricInputToCoolingOutputRatioFunctionOfTemperature());
+    EXPECT_EQ(eirToCorfOfPlr2, chiller.electricInputToCoolingOutputRatioFunctionOfPLR());
+  }
+
+  // test new setter/getter
+  {
+    model::ChillerElectricEIR chiller(model);
+
+    // setter maintains backward compatibility
+    model::CurveQuadratic curveQuadratic(model);
+    EXPECT_TRUE(chiller.setElectricInputToCoolingOutputRatioFunctionOfPLR(curveQuadratic));
+    ASSERT_TRUE(chiller.electricInputToCoolingOutputRatioFunctionOfPLR().optionalCast<model::CurveQuadratic>());
+    EXPECT_EQ(curveQuadratic, chiller.electricInputToCoolingOutputRatioFunctionOfPLR());
+
+    // setter can now handle cubic curves
+    model::CurveCubic curveCubic(model);
+    EXPECT_TRUE(chiller.setElectricInputToCoolingOutputRatioFunctionOfPLR(curveCubic));
+    ASSERT_TRUE(chiller.electricInputToCoolingOutputRatioFunctionOfPLR().optionalCast<model::CurveCubic>());
+    EXPECT_EQ(curveCubic, chiller.electricInputToCoolingOutputRatioFunctionOfPLR());
+  }
+}