This is an instance of the translation of an Excel spreadsheet formula into the Python equivalent.
EXCEL:
#AH2=Sun Azimuth degrees clockwise from North
=IF(AC2>0,MOD(DEGREES(ACOS(((SIN(RADIANS(Lat))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS(Lat))*SIN(RADIANS(AD2)))))+180,360),MOD(540-DEGREES(ACOS(((SIN(RADIANS(Lat))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS(Lat))*SIN(RADIANS(AD2))))),360))
PYTHON:
#AH2=Sun Azimuth degrees clockwise from North
AH2a1=math.acos(((math.sin((B3/r)) * math.cos((AD2/r))) - math.sin((T2/r))) / ((math.cos((B3/r)) * math.sin(AD2/r))))*r + 180
AH2b1=360
AH2a2=540-math.acos(((math.sin(B3/r)*math.cos(AD2/r))-math.sin(T2/r))/((math.cos(B3/r)*math.sin(AD2/r))))*r
AH2b2=AH2b1
if AC2 > 0 : AH2=AH2a1-int(AH2a1/AH2b1)*AH2b1
else : AH2=AH2a2-int(AH2a2/AH2b2)*AH2b2
Subscribe to:
Post Comments (Atom)
Major update
A lot has been done since the last post. Previously, I had 580 watts of solar panel power. One of the panels, on examination, had lost a s...
-
This java script makes sure the date is correctly interpreted between PHP and HTML. I found this on the web: CODE //<script> /** ...
-
In a recent post I presented the equation for energy incident on a solar panel (Sm). Here I present the set of equations used to calcu...
-
The new web page, for monitoring the solar power station activity, has two charts, one above the other. There are links to a copy of my ol...
No comments:
Post a Comment