Solar Program for Flat Plate Collectors

Author(s): Ed Buttenhoff
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v3 n11 (Volume 3, Issue 11)
Date: November 1982
Pages: 8-9

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.

You need the following information: your latitude, vertical tilt of the collector, and azimuth (deviation from true south)–all in decimal degrees. You can adjust the tilt to receive minimum heat in summer or equalize the tilt (vertical); add 20 percent for months of snow cover. Because of screen limitations, hourly totals are not printed out. They are available while the program is running–I(B). Changes made to run in the ZX81 cause slight inaccuracy, but the results are within 2% of those obtained with a larger computer.

SOL runs with 3K RAM and up. If you omit the graph routine (lines 640-890), it should run in 2K. The program takes about 3.5 minutes to run–it goes through the subroutine 132 times. The graph gives an easy-to-interpret picture of year-around performance. Remember that the monthly figures are for one day only and that they assume no shade.

Based on “Adapting the Sun’s Energy” by Jerry Berry appearing in the June, 1982, issue of BYTE magazine. Copyright (c) 1982 BYTE Publications, Inc. Used with permission of BYTE Publications Inc.

  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 SYNTATIC SUM: 54737, 8K ROM

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