i use this:
cost := watt*24*elecost/100000; // electricity cost in cents
money := btccost*50*24*60*60/(difficulty*Power(2,32) / (hash*1024*1024) ); // where hash = hashrate in Mhash/s and btccost = price of 1 btc in usd.
profit := money-cost;
that's your daily profit.
furthermore, i use this to calculate the average time for each retarget in days:
procedure getdays();
var bt, bs: double; // where bt = time to solve 1 block and bs = number of blocks solved
begin
bt := 600;
bs := 0; days := 0;
while (true) do
begin
bt := bt/(1+0.01*increase); // increase = the daily increase in total network hashing power in %
bs := bs + 24*60*60/bt;
if bs > 2016 then break;
days := days+1;
increase := increase*0.96; // i assume increase is going down by 4% per day. you can leave it out if you don't believe in this.
end;
end;
then i use this number of average days for my difficulty formula:
difficulty := difficulty*Power((1+0.01*increase),days);
with these calculations i can simulate my profit over a period of time. although i can only assume a constant bitcoin value, because nobody can predict the future, right? :/
edit: i know it's not too precise, because i "round" everything to days, but i don't think it makes that much of a difference. not sure, though.