# Convert CAPFT and EIRFT curve coefficients from SI to IP

Let’s set up the problem. You are building an energy model for a chiller and would like to use the Modified DOE-2 model. In that model, there are 3 curves that need to be defined. They are

`CAPFT`

, Capacity as a function of temperature`EIRFT`

, Energy efficiency ratio as a function of temperature`EIRFPLR`

, Energy energy ratio as a function of PLR

The first two curves are described as *biquadratic*. The *bi* portion
is there because the curve is actually a function of 2 temperatures, the
chilled water supply temperature and the condenser water return
temperature. The *quadratic* portion is there because we will have terms
for each temperature up until the squared value, plus one interaction
term. This means we have 6 total coefficients when we include a constant.

In the Modified DOE-2 chiller model, the two temperatures are the chilled water supply temperature, \(T_{chws}\), and the condenser water return temperature, \(T_{cwr}\). Other similar formulations use the condenser water supply temperature instead of the return, \(T_{cws}\). What matters for us is that it is two temperature values in a biquadratic form.

There are many ways to get these coefficients. You can simply do the regression yourself if you have the required data, or you can look up values for typical chillers.

A great resource for typical coefficients of common chillers is from the chillers.idf file that comes with EnergyPlus. One issue that can arise though is that everything in EnergyPlus is in the SI unit system (as is should be). In many cases, however, it ends up being more convenient to have these coefficients in the IP unit system.

To convert these coefficients from SI to IP we are going to do some hard core algebra. But it’s still just algebra.

We first do a substitution for every Celsius temperature in the first equation.

\[\textrm{C} = \frac{5}{9}\left(\textrm{F}-32\right)\]When we complete this substitution, we get the following form, where are coefficients are for SI units and the temperatures are in Fahrenheit.

\(\textrm{CAPFT}(T_{chws}, T_{chwr}) = C_{0} + C_{1} \left(\frac{5\left(T_{chws} - 32\right)}{9}\right) + C_{2} \left(\frac{5\left(T_{chws} - 32\right)}{9}\right)^{2} + \ldots\) \(C_{3} \left(\frac{5\left(T_{cwr} - 32\right)}{9}\right) + C_{4} \left(\frac{5\left(T_{cwr} - 32\right)}{9}\right)^{2} + C_{5} \left(\frac{5\left(T_{chws} - 32\right)}{9}\right) \left(\frac{5\left(T_{cwr} - 32\right)}{9}\right)\)

What we do now is expand this gnarly guy and then recollect terms to match the original form.

I’ll let you try this on your own, but here’s the correct expansion. I personally used Maxima to help me out.

\[\textrm{CAPFT}(T_{chws}, T_{chwr}) = \ldots\] \[\left(C_{0} - \frac{160}{9}C_{1} + \frac{25600}{81}C_{2} - \frac{160}{9}C_{3} + \frac{25600}{81}C_{4} + \frac{25600}{81}C_{5}\right)+\ldots\] \[\left(\frac{5}{9}C_{1}\ - \frac{1600}{81} C_{2} - \frac{800}{81} C_{5} \right) T_{chws} + \ldots\] \[\left( \frac{25}{81}C_{2} \right) {T_{chws}}^{2} +\ldots\] \[\left(\frac{5}{9}C_{3}\ - \frac{1600}{81} C_{4} - \frac{800}{81} C_{5} \right) T_{cwr} + \ldots\] \[\left( \frac{25}{81}C_{4} \right) {T_{cwr}}^{2} +\ldots\] \[\left( \frac{25}{81} C_{5} \right) T_{chws} T_{cwr}\]It should be clear that the term in the parenthesis are the new, converted coefficients. In other words, if our new coefficients are \(C'\)

\[C'_{0} = C_{0} - \frac{160}{9}C_{1} + \frac{25600}{81}C_{2} - \frac{160}{9}C_{3} + \frac{25600}{81}C_{4} + \frac{25600}{81}C_{5}\] \[C'_{1} = \frac{5}{9}C_{1}\ - \frac{1600}{81} C_{2} - \frac{800}{81} C_{5}\] \[C'_{2} = \frac{25}{81}C_{2}\] \[C'_{3} = \frac{5}{9}C_{3}\ - \frac{1600}{81} C_{4} - \frac{800}{81} C_{5}\] \[C'_{4} = \frac{25}{81}C_{4}\] \[C'_{5} = \frac{25}{81} C_{5}\]Here’s what that looks like in Matlab.

```
function [ newCoefficients ] = capeirftconvert(coeff)
%CURVECONVERT Converts SI CAPFT and EIRFT performance curves to IP.
% Celsius to Fahrenheit
newCoefficients = zeros(size(coeff));
newCoefficients(1) = coeff(1) - 160/9*coeff(2) + (25600/81)*coeff(3) - ...
160/9*coeff(4) + (25600/81)*coeff(5) + ...
25600/81*coeff(6);
newCoefficients(2) = coeff(2)*5/9 - 1600/81*coeff(3) - 800/81*coeff(6);
newCoefficients(3) = 25/81*coeff(3);
newCoefficients(4) = coeff(4)*5/9 - 1600/81*coeff(5) - 800/81*coeff(6);
newCoefficients(5) = 25/81*coeff(5);
newCoefficients(6) = 25/81*coeff(6);
end
```