TEST(ZoneHVACPackagedTerminalAirConditioner,ZoneHVACPackagedTerminalAirConditioner_ZoneHVACPackagedTerminalAirConditioner)
{
    ::testing::FLAGS_gtest_death_test_style = "threadsafe";

    ASSERT_EXIT (
    {
        model::Model m;

        model::ScheduleCompact availabilitySchedule(m);

        model::FanConstantVolume fan(m,availabilitySchedule);

        model::CoilHeatingWater heatingCoil(m,availabilitySchedule);

        model::CurveBiquadratic coolingCurveFofTemp = CurveBiquadratic(m);
        coolingCurveFofTemp.setCoefficient1Constant(0.42415);
        coolingCurveFofTemp.setCoefficient2x(0.04426);
        coolingCurveFofTemp.setCoefficient3xPOW2(-0.00042);
        coolingCurveFofTemp.setCoefficient4y(0.00333);
        coolingCurveFofTemp.setCoefficient5yPOW2(-0.00008);
        coolingCurveFofTemp.setCoefficient6xTIMESY(-0.00021);
        coolingCurveFofTemp.setMinimumValueofx(17.0);
        coolingCurveFofTemp.setMaximumValueofx(22.0);
        coolingCurveFofTemp.setMinimumValueofy(13.0);
        coolingCurveFofTemp.setMaximumValueofy(46.0);

        CurveQuadratic coolingCurveFofFlow = CurveQuadratic(m);
        coolingCurveFofFlow.setCoefficient1Constant(0.77136);
        coolingCurveFofFlow.setCoefficient2x(0.34053);
        coolingCurveFofFlow.setCoefficient3xPOW2(-0.11088);
        coolingCurveFofFlow.setMinimumValueofx(0.75918);
        coolingCurveFofFlow.setMaximumValueofx(1.13877);

        CurveBiquadratic energyInputRatioFofTemp = CurveBiquadratic(m);
        energyInputRatioFofTemp.setCoefficient1Constant(1.23649);
        energyInputRatioFofTemp.setCoefficient2x(-0.02431);
        energyInputRatioFofTemp.setCoefficient3xPOW2(0.00057);
        energyInputRatioFofTemp.setCoefficient4y(-0.01434);
        energyInputRatioFofTemp.setCoefficient5yPOW2(0.00063);
        energyInputRatioFofTemp.setCoefficient6xTIMESY(-0.00038);
        energyInputRatioFofTemp.setMinimumValueofx(17.0);
        energyInputRatioFofTemp.setMaximumValueofx(22.0);
        energyInputRatioFofTemp.setMinimumValueofy(13.0);
        energyInputRatioFofTemp.setMaximumValueofy(46.0);

        CurveQuadratic energyInputRatioFofFlow = CurveQuadratic(m);
        energyInputRatioFofFlow.setCoefficient1Constant(1.20550);
        energyInputRatioFofFlow.setCoefficient2x(-0.32953);
        energyInputRatioFofFlow.setCoefficient3xPOW2(0.12308);
        energyInputRatioFofFlow.setMinimumValueofx(0.75918);
        energyInputRatioFofFlow.setMaximumValueofx(1.13877);

        CurveQuadratic partLoadFraction = CurveQuadratic(m);
        partLoadFraction.setCoefficient1Constant(0.77100);
        partLoadFraction.setCoefficient2x(0.22900);
        partLoadFraction.setCoefficient3xPOW2(0.0);
        partLoadFraction.setMinimumValueofx(0.0);
        partLoadFraction.setMaximumValueofx(1.0);

        CoilCoolingDXSingleSpeed coolingCoil = CoilCoolingDXSingleSpeed( m,
        availabilitySchedule,
        coolingCurveFofTemp,
        coolingCurveFofFlow,
        energyInputRatioFofTemp,
        energyInputRatioFofFlow,
        partLoadFraction );


        model::ZoneHVACPackagedTerminalAirConditioner ptac( m,
        availabilitySchedule,
        fan,
        heatingCoil,
        coolingCoil );

        ptac.availabilitySchedule();

        ptac.supplyAirFan();

        ptac.heatingCoil();

        ptac.coolingCoil();

        exit(0);
    } ,
TEST_F(ModelFixture,ZoneHVACPackagedTerminalHeatPump_ZoneHVACPackagedTerminalHeatPump)
{
  ::testing::FLAGS_gtest_death_test_style = "threadsafe";

  ASSERT_EXIT (
  {
     model::Model m;

     model::ScheduleCompact availabilitySchedule(m);

     model::FanConstantVolume fan(m,availabilitySchedule);

     model::CoilHeatingElectric supplementalHeatingCoil(m,availabilitySchedule);

     model::CurveBiquadratic coolingCurveFofTemp = CurveBiquadratic(m);
     coolingCurveFofTemp.setCoefficient1Constant(0.42415);
     coolingCurveFofTemp.setCoefficient2x(0.04426);
     coolingCurveFofTemp.setCoefficient3xPOW2(-0.00042);
     coolingCurveFofTemp.setCoefficient4y(0.00333);
     coolingCurveFofTemp.setCoefficient5yPOW2(-0.00008);
     coolingCurveFofTemp.setCoefficient6xTIMESY(-0.00021);
     coolingCurveFofTemp.setMinimumValueofx(17.0);
     coolingCurveFofTemp.setMaximumValueofx(22.0);
     coolingCurveFofTemp.setMinimumValueofy(13.0);
     coolingCurveFofTemp.setMaximumValueofy(46.0);

     CurveQuadratic coolingCurveFofFlow = CurveQuadratic(m);
     coolingCurveFofFlow.setCoefficient1Constant(0.77136);
     coolingCurveFofFlow.setCoefficient2x(0.34053);
     coolingCurveFofFlow.setCoefficient3xPOW2(-0.11088);
     coolingCurveFofFlow.setMinimumValueofx(0.75918);
     coolingCurveFofFlow.setMaximumValueofx(1.13877);

     CurveBiquadratic energyInputRatioFofTemp = CurveBiquadratic(m);
     energyInputRatioFofTemp.setCoefficient1Constant(1.23649);
     energyInputRatioFofTemp.setCoefficient2x(-0.02431);
     energyInputRatioFofTemp.setCoefficient3xPOW2(0.00057);
     energyInputRatioFofTemp.setCoefficient4y(-0.01434);
     energyInputRatioFofTemp.setCoefficient5yPOW2(0.00063);
     energyInputRatioFofTemp.setCoefficient6xTIMESY(-0.00038);
     energyInputRatioFofTemp.setMinimumValueofx(17.0);
     energyInputRatioFofTemp.setMaximumValueofx(22.0);
     energyInputRatioFofTemp.setMinimumValueofy(13.0);
     energyInputRatioFofTemp.setMaximumValueofy(46.0);

     CurveQuadratic energyInputRatioFofFlow = CurveQuadratic(m);
     energyInputRatioFofFlow.setCoefficient1Constant(1.20550);
     energyInputRatioFofFlow.setCoefficient2x(-0.32953);
     energyInputRatioFofFlow.setCoefficient3xPOW2(0.12308);
     energyInputRatioFofFlow.setMinimumValueofx(0.75918);
     energyInputRatioFofFlow.setMaximumValueofx(1.13877);

     CurveQuadratic partLoadFraction = CurveQuadratic(m);
     partLoadFraction.setCoefficient1Constant(0.77100);
     partLoadFraction.setCoefficient2x(0.22900);
     partLoadFraction.setCoefficient3xPOW2(0.0);
     partLoadFraction.setMinimumValueofx(0.0);
     partLoadFraction.setMaximumValueofx(1.0);

     CoilCoolingDXSingleSpeed coolingCoil = CoilCoolingDXSingleSpeed( m,
                                                                      availabilitySchedule,
                                                                      coolingCurveFofTemp,
                                                                      coolingCurveFofFlow,
                                                                      energyInputRatioFofTemp,
                                                                      energyInputRatioFofFlow,
                                                                      partLoadFraction );

     CurveBiquadratic  totalHeatingCapacityFunctionofTemperatureCurve(m);
     totalHeatingCapacityFunctionofTemperatureCurve.setCoefficient1Constant(0.758746);
     totalHeatingCapacityFunctionofTemperatureCurve.setCoefficient2x(0.0);
     totalHeatingCapacityFunctionofTemperatureCurve.setCoefficient3xPOW2(0.0);
     totalHeatingCapacityFunctionofTemperatureCurve.setCoefficient4y(0.027626);
     totalHeatingCapacityFunctionofTemperatureCurve.setCoefficient5yPOW2(0.000148716);
     totalHeatingCapacityFunctionofTemperatureCurve.setCoefficient6xTIMESY(0.0);

     CurveQuadratic  totalHeatingCapacityFunctionofFlowFractionCurve(m);
     totalHeatingCapacityFunctionofFlowFractionCurve.setCoefficient1Constant(0.84);
     totalHeatingCapacityFunctionofFlowFractionCurve.setCoefficient2x(0.16);
     totalHeatingCapacityFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0);
     totalHeatingCapacityFunctionofFlowFractionCurve.setMinimumValueofx(0.5);
     totalHeatingCapacityFunctionofFlowFractionCurve.setMaximumValueofx(1.5);

     CurveBiquadratic  energyInputRatioFunctionofTemperatureCurve(m);
     energyInputRatioFunctionofTemperatureCurve.setCoefficient1Constant(1.19248);
     energyInputRatioFunctionofTemperatureCurve.setCoefficient2x(-0.0300438);
     energyInputRatioFunctionofTemperatureCurve.setCoefficient3xPOW2(0.00103745);
     energyInputRatioFunctionofTemperatureCurve.setCoefficient4y(0.0);
     energyInputRatioFunctionofTemperatureCurve.setMinimumValueofx(-20.0);
     energyInputRatioFunctionofTemperatureCurve.setMaximumValueofx(20.0);

     CurveQuadratic  energyInputRatioFunctionofFlowFractionCurve(m);
     energyInputRatioFunctionofFlowFractionCurve.setCoefficient1Constant(1.3824);
     energyInputRatioFunctionofFlowFractionCurve.setCoefficient2x(-0.4336);
     energyInputRatioFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0512);
     energyInputRatioFunctionofFlowFractionCurve.setMinimumValueofx(0.0);
     energyInputRatioFunctionofFlowFractionCurve.setMaximumValueofx(1.0);

     CurveQuadratic  partLoadFractionCorrelationCurve(m);
     partLoadFractionCorrelationCurve.setCoefficient1Constant(0.85);
     partLoadFractionCorrelationCurve.setCoefficient2x(0.15);
     partLoadFractionCorrelationCurve.setCoefficient3xPOW2(0.0);
     partLoadFractionCorrelationCurve.setMinimumValueofx(0.0);
     partLoadFractionCorrelationCurve.setMaximumValueofx(1.0);

     CoilHeatingDXSingleSpeed heatingCoil( m,
                                           availabilitySchedule,
                                           totalHeatingCapacityFunctionofTemperatureCurve,
                                           totalHeatingCapacityFunctionofFlowFractionCurve,
                                           energyInputRatioFunctionofTemperatureCurve,
                                           energyInputRatioFunctionofFlowFractionCurve,
                                           partLoadFractionCorrelationCurve );

     model::ZoneHVACPackagedTerminalHeatPump pthp( m,
                                                   availabilitySchedule,
                                                   fan,
                                                   heatingCoil,
                                                   coolingCoil,
                                                   supplementalHeatingCoil );

     pthp.availabilitySchedule();

     pthp.supplyAirFan();

     pthp.heatingCoil();

     pthp.coolingCoil();

     pthp.supplementalHeatingCoil();

     exit(0);
  } ,
boost::optional<IdfObject> ForwardTranslator::translateCurveBiquadratic( 
    CurveBiquadratic & modelObject)
{
  IdfObject idfObject(IddObjectType::Curve_Biquadratic);

  m_idfObjects.push_back(idfObject);

  OptionalString s;
  OptionalDouble d;

  if ((s = modelObject.name())) {
    idfObject.setName(*s);
  }

  idfObject.setDouble(Curve_BiquadraticFields::Coefficient1Constant,modelObject.coefficient1Constant());
  idfObject.setDouble(Curve_BiquadraticFields::Coefficient2x,modelObject.coefficient2x());
  idfObject.setDouble(Curve_BiquadraticFields::Coefficient3x_POW_2,modelObject.coefficient3xPOW2());
  idfObject.setDouble(Curve_BiquadraticFields::Coefficient4y,modelObject.coefficient4y());
  idfObject.setDouble(Curve_BiquadraticFields::Coefficient5y_POW_2,modelObject.coefficient5yPOW2());
  idfObject.setDouble(Curve_BiquadraticFields::Coefficient6x_TIMES_y,modelObject.coefficient6xTIMESY());
  idfObject.setDouble(Curve_BiquadraticFields::MinimumValueofx,modelObject.minimumValueofx());
  idfObject.setDouble(Curve_BiquadraticFields::MaximumValueofx,modelObject.maximumValueofx());
  idfObject.setDouble(Curve_BiquadraticFields::MinimumValueofy,modelObject.minimumValueofy());
  idfObject.setDouble(Curve_BiquadraticFields::MaximumValueofy,modelObject.maximumValueofy());
  if ((d = modelObject.minimumCurveOutput())) {
    idfObject.setDouble(Curve_BiquadraticFields::MinimumCurveOutput,*d);
  }
  if ((d = modelObject.maximumCurveOutput())) {
    idfObject.setDouble(Curve_BiquadraticFields::MaximumCurveOutput,*d);
  }
  if (!modelObject.isInputUnitTypeforXDefaulted()) {
    idfObject.setString(Curve_BiquadraticFields::InputUnitTypeforX,modelObject.inputUnitTypeforX());
  }
  if (!modelObject.isInputUnitTypeforYDefaulted()) {
    idfObject.setString(Curve_BiquadraticFields::InputUnitTypeforY,modelObject.inputUnitTypeforY());
  }
  if (!modelObject.isOutputUnitTypeDefaulted()) {
    idfObject.setString(Curve_BiquadraticFields::OutputUnitType,modelObject.outputUnitType());
  }

  return idfObject;
}