Tuesday, May 15, 2012

Calculating savings

Now that I am a couple of months in, I am finding that PG&E does not make it easy to calculate the savings from.  I started trying to calculate savings using a simple spreadsheet, and found that it wasn't simple enough.  I then decided to write a quick program in C to do it for me.  It took only about an hour to have something that was usable and accurate.  Then I tried to share it with a few friends.  Microsoft apparently doesn't make it easy to just share a program, you need to pack up various pieces to make it work.  This got me to thinking there had to be a better way.  So, I started poking around, and found that it was possible to do it as a webpage.  Unfortunately, making a webpage to do the calculations involved learning Javascript, which was a bit frustrating.  After a few days, I managed to get a slightly less featured program to work.  It doesn't allow for easily modifying the rates, but I can add that eventually if I need it.  Otherwise, it has the functionality of the program I wrote in C.  In fact, it has the same basic algorithm.  I just wish I knew of a better way to debug javascript.  Not being a compiled language, I didn't have a compiler to help spot typo's, which was very annoying.  Anyway, I have it done, and if you are interested in trying it out, click here to give it a try.  I would appreciate any feedback or questions.

2 comments:

  1. pretty cool. i had to toggle the winter/summer in order to get it to calculate, otherwise it worked like a charm.

    ReplyDelete
  2. Latest version has a calculate button :)

    ReplyDelete