Solar Program for Flat Plate Collectors

Developer(s): Ed Buttenhoff
Date: 1982
Type: Program
Platform(s): ZX81, TS 1000
Tags: Science

SOL estimates the solar energy, in BTUs per square foot per day, that falls on a flat plate collector in each month of the year. Enter your latitude, the tilt of the collector and its azimuth (its angle away from true south), all in decimal degrees. The program runs its calculation 132 times, once for each daylight hour of a sample day in each month, so it takes about five minutes in FAST mode before the table appears. The table lists the twelve months and a total; type CONT to draw a graph of the year, and CONT again to go back to the table.

The figures are for one clear day per month with no shade. The article suggests adding 20 percent for months with snow cover, and says the results come within 2 percent of those from a larger computer. It is based on “Adapting the Sun’s Energy” by Jerry Berry in BYTE, June 1982. The article says SOL runs in 3K and up, or in 2K without the graph routine (lines 640-890).

Published in Syntax November 1982 (Solar Program for Flat Plate Collectors).

Related Articles

If you're using solar technology to reduce your energy bills, a computer can help maximize your benefits. SOL will help you orient that flat plate collector.

Image Gallery

Source Code

  10 REM "SOL"
  20 GOTO 0220
  30 REM SUBR TO CALC BTUS
  40 FAST
  50 LET I=429*(J+(.034*COS (360*N/365*F)))
  60 LET D=23.45*SIN (360*(284+N)/365*F)
  70 LET D=D*F
  80 LET S=(SIN L*SIN D+(COS L*COS D*COS H1))
  90 LET M=SQR (1229+(614*ABS S)**2)-(614*S)
 100 IF M>94.976 THEN LET X=0
 110 IF M<=94.976 THEN GOTO 0130
 120 GOTO 0140
 130 LET X=EXP (-.65*M)
 140 LET Y=EXP (-.095*M)
 150 LET I=I*.56*(X+Y)
 160 LET C=SIN D*(SIN L*COS T-(COS L*SIN T*COS A))
 170 LET C=C+COS D*COS H1*(COS L*COS T+(SIN L*SIN T*COS A))
 180 LET C=C+COS D*SIN T*SIN A*SIN H1
 190 LET I=I*C
 200 IF I<0 THEN LET I=0
 210 RETURN
 220 DIM I(12)
 230 DIM G(12)
 240 LET J=1
 250 LET K=20
 260 LET F=PI/180
 270 SLOW
 280 PRINT "SOLAR ENERGY,BTU/SQFT/DAY"
 290 PRINT ,,"FOR FLAT PLAT COLLECTOR"
 300 PRINT ,,"USE DECIMAL DEGREES"
 310 PRINT ,,"LATITUDE?"
 320 INPUT LL
 330 PRINT ,,"TILT ANGLE?"
 340 INPUT TT
 350 PRINT ,,"AZIMUTH?"
 360 INPUT AA
 370 LET L=LL*F
 380 LET T=TT*F
 390 LET A=AA*F
 400 LET V=0
 410 LET N=21
 420 FOR Q=J TO 12
 430 LET H=75
 440 LET P=0
 450 FOR B=J TO 11
 460 LET H1=H*F
 470 GOSUB 0040
 480 LET I(B)=I
 490 LET H=H-15
 500 LET P=P+I(B)
 510 NEXT B
 520 LET N=N+30.36
 530 LET G(Q)=INT (P+.5)
 540 LET V=V+P
 550 NEXT Q
 560 CLS
 570 PRINT TAB 10;"SOLAR TABLE",,"   LAT= ";LL;"    TILT= ";TT;"      AZ= ";AA
 580 PRINT ,,"  MONTH          BTU/DAY/SQFT"
 590 PRINT
 600 FOR I=J TO 12
 610 PRINT TAB 5-LEN STR$ I;I;TAB 25-LEN STR$ G(I);G(I)
 620 NEXT I
 630 PRINT ,,"   TOTAL(1 DAY/MO)=";TAB K;INT (V+.5)
 640 PRINT ,,"    (FOR GRAPH,USE ""CONT"")"
 650 POKE 16418,J
 660 STOP
 670 SLOW
 680 LET A$="  +------------+"
 690 FOR I=J TO K+J+J
 700 PRINT A$
 710 NEXT I
 720 PRINT AT K,J;" 5";AT 15,J;"10";AT 10,J;"15";AT 5,J;"20";AT 0,J;"25"
 730 PRINT AT K,15;"5";AT 15,15;"10";AT 10,15;"15";AT 5,15;"20";AT 0,15;"25"
 740 FOR R=J TO 12
 750 IF G(R)<376 THEN GOTO 0770
 760 PLOT R*2+5,((G(R))/50)-8
 770 NEXT R
 780 POKE 16418,J
 790 PRINT AT J+J+K,0;"   JFMAMJJASOND     (MONTH"
 800 PRINT AT 0,K;"SOLAR RAD"
 810 PRINT AT J+J,K;"BTU/DAY";AT 0,7; "X100"
 820 PRINT AT 4,K;"PER SQ FT"
 830 PRINT AT 6,K;"LAT = ";LL
 840 PRINT AT 8,K;"TILT= ";TT
 850 PRINT AT 10,K;"AZIM= ";AA
 860 PRINT AT 14,K;"(FOR TABLE,";AT 16,K;"USE ""CONT"")"
 870 STOP
 880 FAST
 890 GOTO 0560

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.