I used Excel to enter the power calculations on a simulated data set (voltage and current). I later wanted something more responsive to what-ifs and designed for mathematical computation. I stumbled on a MatLab like open source tool cal GNU-Octave. I decided to download and install the tool to enter basic power calculations.

What I like about this tool and like Matlab is the ability to manipulate matrices and vectors. I can set up calculations for my power without resorting to annoying for loops. With my short attention span, I liked this.

Earlier I described the basic math and reduced the following salient equations:

For giggles, I wanted to use Octave to calculate and plot power curves. I know from sampling theory that we need to sample at least at the Nyquist frequency to be able to reconstruct the signal.The reality is we don’t live in an ideal world with perfect filters. More about sampling rate later.

I created functions in Octave to generate a waveform. I can also import a text file with data values and compute the various types of powers as well. I wanted to test a couple of sunny day scenarios to ensure that my calculations were correct. I took two approaches. One I actually defined the function and let Octave integrate it. The other was to sample the function like I would in the software. Both yielded the same results. The table below outlines the expected and actual results.

Package/Tool | URL | Description | Installation |
---|---|---|---|

log4js | log4js | log4js based logging services for node.js | npm install log4js -S |

monk | monk | wrapper to mongodb that is simpler yet not as powerful as mongoose | npm install monk -S |

nodemon | nodemon | listens for file changes and restarts server | npm install nodemon -g |

dummy-json | dummy-son | tool to generate JSON files used for my testing | npm install dummy-json -g |

Robomongo | robomongo | MongoDB manager | download and point to mongoDB instance (default localhost:27017) |

Bluebird | bluebird | promise library implementation | npm install bluebird -S |

SerialPort | serial port | serial port driver for node.js | npm install serialport -S # have 4.0.7 |

xbee-api | xbee-api | xbee API for node.js | npm install xbee-api -S |

I also generated an odd current waveform that could occur in speed control via a triac or something and ploted the graph below.

Intuitively one would expect the average power to be half of the sunny day scenario. The other half is reactive power. The following shows the power calculations for varying sampling rates.

[table “3” not found /]