Author Topic: Calculate maximum solar radiation  (Read 335 times)

0 Members and 1 Guest are viewing this topic.

Offline hiljo

  • Senior Contributor
  • ****
  • Posts: 257
    • Weerstation Hattem
Calculate maximum solar radiation
« on: February 10, 2023, 09:59:11 AM »
Hi everyone,

I'm thinking about a comparison between the measured solarradiation from my WS90 unit with the potential maximum solarradiation during the day. So i get a nice bell shaped graph merged with the real measurements of the WS90. Does anybody know how to calculate the potential maximum solarradiation based on my LAT/LON and the (any) time of the day?

Thanks for your answers!
Ecowitt HP2550C v1.9.3
2x GW2000 v3.1.1
WittBoy WS90 v1.3.8
Smart Sensors (WFC01 & AC1100) beta tester
3x WH31, WH32, WH40, WH41, WH57
WN34L, 2x WH51, WN35, WN34D

Dutch translator for Ecowitt.

https://www.weerstationhattem.nl/
  |
  |
  |
  | 
  |
  |
  |

Offline broadstairs

  • Forecaster
  • *****
  • Posts: 853
Re: Calculate maximum solar radiation
« Reply #1 on: February 10, 2023, 11:42:33 AM »
Both Weather Display and CumulusMX do this and is available on both in webtags.

Stuart
Ecowitt GW1003 with ultrasonic wind gauge, lightning sensor and PM2.5 sensor with Personal Weather Tablet as a console.

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Calculate maximum solar radiation
« Reply #2 on: February 10, 2023, 01:13:51 PM »
Meteotemplate uses this simplified php function ( don't know the origin ):

Code: [Select]
function solarMax($time,$lat,$lon,$elevation,$elevationUnits){

if($elevationUnits=="ft"){
$z = 0.3048 * $elevation;
}
else{
$z = $elevation;
}

$atc = 0.8;

$lw  = (M_PI / 180) * -$lon;
$phi = (M_PI / 180) * $lat;
$d   = ($time / (60 * 60 * 24) - 0.5 + 2440588) - 2451545;

$M = (M_PI / 180) * (357.5291 + 0.98560028 * $d);
$L = ((M_PI / 180) * (1.9148 * sin($M) + 0.02 * sin(2 * $M) + 0.0003 * sin(3 * $M))) + $M + (M_PI / 180) * 102.9372 + M_PI;
$declin = asin(sin(0) * cos(((M_PI / 180) * 23.4397)) + cos(0) * sin(((M_PI / 180) * 23.4397)) * sin($L));
$rightAsc = atan2(sin($L) * cos(((M_PI / 180) * 23.4397)) - tan(0) * sin(((M_PI / 180) * 23.4397)), cos($L));

$H   = ((M_PI / 180) * (280.16 + 360.9856235 * $d) - $lw) - $rightAsc;
$altitude = asin(sin($phi) * sin($declin) + cos($phi) * cos($declin) * cos($H));
$altitude = $altitude * 180 / M_PI;

$JD = $time / (60 * 60 * 24) - 0.5 + 2440588;

$dayTime = ($time - strtotime(date("Y",$time)."-".date("m",$time)."-".date('d',$time)." 00:00"))/(24*60*60*1000);

$t = ($JD + $dayTime -2451545.0)/36525;
$eccentricity = 0.01678634 + 0.000042037*$t + 0.0000001267*$t*$t;

$mean_anomaly =  357.52911+ 35999.05029*$t + 0.0001537*$t*$t;
if($mean_anomaly<0){
$mean_anomaly=$mean_anomaly%360+360;
}
if($mean_anomaly>360){
$mean_anomaly=intval($mean_anomaly)%360;
}

$c = (1.914602 - 0.004817*$t + 0.000014*$t*$t)*sin($mean_anomaly*(M_PI / 180));
$c =$c+ (0.019993 - 0.000101*$t)*sin(2*$mean_anomaly*(M_PI / 180));
$c =$c+ 0.000289 *sin(3*$mean_anomaly*(M_PI / 180));

$true_anomary = $mean_anomaly + $c;

$radius = (1.000001018*(1-$eccentricity*$eccentricity))/(1 + $eccentricity*cos($true_anomary*(M_PI / 180)));
$distance= $radius * 149598000;

$el = $altitude;
$R = $radius;

$nrel = 1367.0;
$sinal = sin(deg2rad($el));
if($sinal >= 0){
$rm = pow((288.0 - 0.0065 * $z) / 288.0, 5.256) / ($sinal + 0.15 * pow($el + 3.885, -1.253));
$toa = $nrel * $sinal / ($R * $R);
$sr = $toa * pow($atc, $rm);
}
else{
$sr = 0;
}

return $sr;
}

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
Re: Calculate maximum solar radiation
« Reply #3 on: February 10, 2023, 02:54:17 PM »
CumulusUtils (based on CumulusMX) and  weewx also have that as a selectable variable to be plotted.
Have a look at http://www.meshka.eu/CUtils48 and http://www.meshka.eu/weewx
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

 

anything