Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import random
- import statistics
- latitude = int(input("Hello, which latitude do you want me to examine? \nPlease use an integer between 0 and 90.\n"))
- while (latitude < 0) or (latitude > 90):
- print("Your value is out of the valid range. Please write a latitude between 0 and 90.")
- latitude = int(input("Hello, which latitude do you want me to examine? Please use an integer.\n"))
- # LÄGG TILL VALUEERROR-HANTERING
- area = 400
- soltal = 6
- t = 0
- summa_dagsproduktioner = 0
- while t != 361:
- energifunktion = 0
- v_value = ((23.5 * math.sin((math.pi * (t - 80)) / 180) + 90 - latitude) / 90)
- print("v val:", v_value)
- if (v_value < 1) and (v_value > 0):
- energifunktion = v_value ** 2
- if v_value <= 0:
- energifunktion = 0
- if v_value >= 1:
- energifunktion = 1
- print("energifunkt: ", energifunktion)
- solighetsfaktor = random.uniform(0.0001, 1.00)
- print("solfaktor: ", solighetsfaktor)
- dagsproduktion = area * soltal * solighetsfaktor * energifunktion
- print("dagsprod: ", dagsproduktion)
- summa_dagsproduktioner += dagsproduktion
- t += 1
- print(summa_dagsproduktioner)
- arsmedelproduktion = summa_dagsproduktioner / 360
- print(arsmedelproduktion)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement