to run a regression analysis using collected power data for calibration. Microsoft
Excel's ... a version of Microsoft Excel which has the LINEST built-in function.
Regression Using the Excel LINEST Function This application note is intended to serve as a companion to the Using Measured Current as a Proxy for Power application note. To calculate power using collected current data you will need to run a regression analysis using collected power data for calibration. Microsoft Excel's LINEST function makes this task relatively simple. You will need the following things: x collected current data (1 or 2 weeks' data in most cases) x collected power data (24 or 48 hours' data in most cases) x a version of Microsoft Excel which has the LINEST built-in function This application note uses graphics from a PC environment with Excel version 7.0. The instructions, however, apply to older versions of Excel and to Macintosh environments, also. This application note will not explain every detail about the LINEST function. For further information about LINEST, refer to the Excel manual or HELP tools. This application note also assumes that the reader knows how to use the Excel application.
Regression Using Excel LINEST 1. Import your current and power data into Excel spreadsheet format. 2. Create a new Excel spreadsheet. 3. Copy time and true-RMS power columns from original file into new file. For this example, we will call these columns A and B. 4. Copy the time and total current column from original file into new file. These will be columns C and D. 5. Crop the data so that the times for the power data and the times for the current data are as close as possible. If there are different time intervals, they will need to be aligned before continuing onto the next step. 6. When the true-RMS power data is aligned with the total current data, delete the time column which was imported with the current data (column C). There should be three columns- time, true-RMS power, and current. 7. Create another column for (total current2) data. 8. The next column (column E in this example) will contain the calculated power. For now, simply label it. The spreadsheet should look similar to Figure 1.
Regression Using the Excel LINEST Function Copyright©, Pacific Gas and Electric Company, all rights reserved
Page 1 of 4 www.pge.com/pec
Figure 1: Calculated power spreadsheet
9. The LINEST function will calculate the values A, B and C to be used in the quadratic equation P = A + BI + CI2. On another part of the spreadsheet (a few columns to the right), label three columns as C, B and A...in this order. 10. Click on the cell immediately below the cell labeled C and insert the LINEST function into that cell. Do this by using the insert function button in the toolbar or by using the Insert pull-down menu. A new window will appear. The LINEST function is located in the right hand list of functions, however the list on the left will need to be highlighted, either all or some representative data. 11. Once the LINEST function in the right hand column has been highlighted, click the [Next >] button.
Figure 2: Linest function
12. Select the true-RMS data for the known-y's and the current and current2 data for known-x's. Type in "true" for the remaining two boxes.
Regression Using the Excel LINEST Function Copyright©, Pacific Gas and Electric Company, all rights reserved
Page 2 of 4 www.pge.com/pec
13. Click the Finish button. The cell should have a value which may or may not be negative. 14. While still selecting that cell, copy the LINEST equation ( or from the Edit pull-down menu). Starting with the cell under the letter C, highlight two more cells to the right and go down two more rows. You should have a total of nine cells highlighted with the original cell being in the upper left corner.
Figure 3: Copying the Linest Equation
15. With these nine cells highlighted, place the cursor in the formula bar, hold down the keys and hit . This will paste the same equation into all nine highlighted cells while making it into an array.
Figure 4: Pasting the Linest Equation
16. You will use the top row values in the equation P = A + BI + CI2 You can disregard the other two rows. 17. In the column labeled "calculated power", insert the equation = A + BI + CI2, substituting the appropriate cell references for the variables. Remember that the cell contents are relative, while the A, B and C values must be absolute or fixed. To fix a value, use dollar signs. In this example, the equation for the first cell under "calculated power" will look like this: =$I$3+$H$3*C3+$G$3*D3. 18. Paste above equation, or similar one down the rest of the column. 19. Graph both sets of data and compare. This example shows very good correlation between measured true-RMS power and calculated power from measured current.
Regression Using the Excel LINEST Function Copyright©, Pacific Gas and Electric Company, all rights reserved
Page 3 of 4
www.pge.com/pec
Figure 5: Graph of Measured and True RMS power
20. If there is insufficient representative data, the results may be misleading. The dataset collected should reflect the full range of the load.
Regression Using the Excel LINEST Function Copyright©, Pacific Gas and Electric Company, all rights reserved
Page 4 of 4 www.pge.com/pec