Here are some calculators (written in JavaScript) that are mostly related to conservation and renewable energy.
Some of these have help available, and of course, the source is embedded in the html source, so you can view it using your browser's "view page source" function.
As an exercise in learning the Java programming language, I wrote an applet (also executable as an application) called WinCalc. It calculates the solar radiation that falls on, and is transmitted through a window.
Here is a paper that I wrote for the 2000 American Solar Energy Society conference, describing the Java and JavaScript work.
Sometimes, even without a fancy calculator, simple calculations can illuminate a problem. This page shows some calculations related to renewable energy.