The Sun's position follows from the declination delta = 23.45 deg sin(360 (284 + n)/365) and the hour angle H = 15 deg (t - 12 h): sin(el) = sin(lat) sin(delta) + cos(lat) cos(delta) cos(H). Sunrise is where el = 0: cos(H0) = -tan(lat) tan(delta), giving a day length of 2 H0 / 15 deg hours (24 h or 0 h beyond the polar circles).
Direct irradiance uses a simple clear-sky model DNI = 1353 * 0.7^(AM^0.678) with air mass AM = 1/sin(el) (Meinel), plus 10% diffuse light; the panel receives DNI * max(0, cos(incidence)) where the incidence cosine is the dot product of the sun vector with the panel normal (tilted towards the equator). Daily energy integrates this in 6-minute steps.
Rows run east-west. In the plane perpendicular to the rows, shadows follow the profile angle tan(alpha_p) = tan(el) / cos(azimuth offset); with panel length L and tilt b a row is shade-free when pitch >= L (cos b + sin b / tan alpha_p). Simplifications: no clouds, no ground reflection, no temperature or inverter model, no tracking, flat terrain.