Guest User

calculate

a guest
Sep 23rd, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. --print("How much HvSolars do you have?")
  2. --a = read()
  3.  
  4. a=10
  5. x=1
  6. hv=12500
  7. t=0
  8. tt1=0
  9. tt2=0
  10. tt3=1
  11. wert=0
  12.  
  13.   tt1=1000000/512/20/x*hv
  14.   t=t+tt1
  15.   x=x+1
  16.  
  17. function calculate2()
  18.   while x<a do
  19.     tt1=1000000/512/20/x*hv
  20.     tt2=tt1-30
  21.     tt3=tt2/tt1
  22.     x=x+1
  23.     wert=1000000/512/20*tt3/x*hv
  24.     t=t+wert+tt1
  25.   end
  26. end
  27.  
  28. function chegcalculate2fortt3()
  29.   if tt3>0 do
  30.     calculate2
  31.   else
  32.     print("Ab "..x.." ist tt3 kleiner als 0")
  33.     stop=1
  34.  end
  35. end
  36.  
  37. stop=0
  38.  
  39. while stop=0 do
  40.   chegcalculate2fortt3
  41. end
  42.  
  43. print (""..t.." sec")
  44.  
  45. tinm=t/60
  46. print (""..tinm.." min")
  47.  
  48. tinh=tinm/60
  49. print (""..tinh.." h")
  50.  
  51. tind=tinh/24
  52. print (""..tind.." d")
Advertisement
Add Comment
Please, Sign In to add comment