Pages

Saturday 18 October 2014

New version and bug fixes for LED lights savings calculator application

Hi everyone, I found some naive bugs and some improvements which I could add to my application, therefore here they are:

Bug fixed:
-A bug which did not let the user calculate savings in case the plant was fully financed and yearly net savings were negative
-Other minor bugs

Functionalities added:
-Now you can select the number of yearly payments should you decide to ask for a full financing for your LED lights. You can leave this field blank, in that case a default number of payments is calculated according to costs and annual energy savings.

Click here to download the improved version.

Hope this was useful.

Monday 13 October 2014

A simple program to calculate LED lights savings

 

EDIT: For the most updated application, please check the following page:
New version and bug fixes for LED lights savings calculator application


A week ago, a friend asked for a simple program which could help him calculate savings consumptions fast and give a glance at the overall picture.

If you did not know, by replacing your old bulbs and lamps with LED lights you can save up to 90% depending on the replaced lamp. For instance, if you replace neon with LED, savings are at least 45%, however they might be higher due to neon maintenance and hidden consumptions. If you replace incandescent bulbs with LED you save at least 80%.

Although initial price may be higher, LED lamps will surely pay off in the long run, since they are expected to last 50.000 hours!

This simple program lets you enter the data on your actual lights and the LED, then it calculates:
-Savings
-Savings at each year, for 10 years
-Amortization time if the lamps are paid in one shot
-Financing of the LED lamps with a basic constant pay-out mortgage assuming a 5% interest rate
-Immediate savings if the LED lamps are financed

Click here for the python source code. Again, the program is pretty simple since only a sketch is needed. It surely can be improved. If you have any suggestion please let me know.

Here are some screenshots and a calculation example

Immagine 2

The result of a simple replacement: 200 neon tubes with 200 LED tubes (assuming a cost of 26 euro/pc for LED tube.


Looks really like LEDs are the lights of the future.


Note: some data may be incorrect in your country (for example energy cost, tube cost, etc..), if you should ever use this program please check each data you input.

Sunday 5 October 2014

A simple approximating algorithm for Financial Mathematics

Today while I was applying some of my knowledge of Financial Mathematics, I came across a weird problem. Ok I guess that’s not that weird after all, however I did not find at first, a formula or some trick to get to my goal and therefore I decided to use a simple approximating algorithm.

Say you have some data on a fixed-rate mortgage, a really basic mortgage where both the interest rate and the annual payment are fixed. By the way, if you’d like to know more on these mortgage check the wikipedia page here.

Apparently, the expression used to determine the annual payment, given the initial conditions, should be the following:

clip_image002

clip_image002[6]

clip_image002[12]

Now, suppose that you have everything, the annual constant payment (R), the initial capital (C0), the number of years (n) and you want to find the interest rate applied (i).

At first, it may appear difficult to deal with this problem analytically, so my first idea to get around this was the following: first, define k as the ratio of the initial capital to the annual payment C0/R, then rearrange the equation in terms of k as follows

clip_image002[14]

Now the problem sums up to this: find the i that satisfies the following system of equations

clip_image002[16]

Eventually, here is an algorithm in python to solve the system above


And here is the final plot


plot


Hope this was interesting. Here is Wolfram Alpha’s answer for your reference. For some reason it outputs 0.079 while I get 0.0724 which was the random rate I used to build this simple example. Perhaps some mistake occurred. If you find out please let me know.


Disclaimer
This article is for educational purpose only. The numbers are invented. The article may well contain mistakes and errors. You should never use this article for purposes different from the educational one. The author is not responsible for any consequence or loss due to inappropriate use.