Web pdp-10.trailing-edge.com

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50110/netwrk.eng
There are 2 other files named netwrk.eng in the archive. Click here to see a list.
```100'  NAME--NETWORK
110'
120'  DESCRIPTION--SOLVES THE FLOW OF WATER THROUGH A NETWORK
130'  OF PIPES BY THE HARDY CROSS METHOD.
140'
150'  SOURCE--UNKNOWN
160'
170'  INSTRUCTIONS--FOR INSTRUCTIONS LIST THE PROGRAM "N.W.INS".
180'
190'
200'  *  *  *  *  *  *  *  MAIN PROGRAM  *  *  *  *  *  *  *  *  *  *  *
210'
220 DIM P(25),L(25,25),D(25,25),C(25,25),Q(25,25),K(25,25)
230 DIM G(25,25),T(25,25),S(200)
250 DATA 0
260 PRINT"IF YOU WANT INSTRUCTIONS OF HOW TO RUN THIS PROGRAM"
270 PRINT"TYPE '1' THEN CALL AND LIST   N.W.INS*** FROM THE"
280 PRINT"PROGRAM LIBRARY...... "
290 PRINT"IF NOT, TYPE  '0'  AND I'LL SOLVE YOUR NET WORK PROBLEM"
300 INPUT Z1
310 IF Z1=1 THEN 1400
320 PRINT
330 PRINT
350 PRINT" DO YOU WANT THE TRIAL ITERATIONS TYPED?"
360 PRINT"TYPE  '1'  FOR YES,  '0'  FOR NO."
370 INPUT Z2
380 LET Z3=1
390 IF Z2=1 THEN 450
400 PRINT
410 PRINT
420 PRINT"DO YOU WANT THE DATA DESCRIBING YOUR NETWORK"
430 PRINT"AND THE ASSUMED FLOW TYPED?   TYPE '1' FOR YES, '0' FOR NO."
440 INPUT Z3
450 PRINT"**********************"
460 PRINT
470 PRINT
480 PRINT"NOMENCLATURE :-"
490 PRINT"LP = LOOP NUMBER               PP = PIPE NUMBER"
500 PRINT"L  =LENGTH IN FEET             D  = DIAMETER IN INCHES"
510 PRINT"C  = CONSTANT IN HAZEN WILLIAMS EQUATION FOR FLOW IN PIPES"
520 PRINT"H  = HEAD LOSS IN FEET         S  = HEAD LOSS PER 1000 FEET"
530 PRINT"Q  =FLOW IN MGD              DELTA= CORRECTION FACTOR"
540 PRINT
550 PRINT
560 PRINT
570 IF Z3<>1 THEN 620
580 PRINT"ASSUMED FLOW**************"
590 PRINT"LP PP           L             D               C              Q"
600 PRINT
610 PRINT
620 FOR I=1 TO M
640 FOR J=1 TO P(I)
660 LET S(K(I,J))=L(I,J)*(.000405*C(I,J))^-1.85
670 LET S(K(I,J))=S(K(I,J))*D(I,J)^-4.87
680 IF Z3<>1 THEN 700
690 PRINT I;K(I,J),L(I,J),D(I,J),C(I,J),Q(I,J)
700 NEXT J
710 IF Z3<>1 THEN 730
720 PRINT
730 NEXT I
740 LET G=0
750 LET G=G+1
760 FOR I=1 TO M
770 FOR J=1 TO P(I)
780 LET T(I,J)=0
790 NEXT J
800 NEXT I
810 FOR I=1 TO M
820 LET F1=0
830 LET F2=0
840 FOR J=1 TO P(I)
850 LET H=S(K(I,J))*Q(I,J)*(ABS(Q(I,J)))^.85
860 LET G(I,J)=H
870 LET F1=F1+H
880 LET F2=F2+ABS(H/Q(I,J))
890 NEXT J
900 LET X=F1/(F2*1.85)
910 FOR J=1 TO P(I)
920 LET T(I,J)=T(I,J)-X
930 FOR I1=1 TO M
940 IF I1=I THEN 1030
950 FOR J1=1 TO P(I1)
960 IF K(I1,J1)=K(I,J) THEN 980
970 GO TO 1020
980 IF Q(I1,J1)=Q(I,J) THEN 1010
990 LET T(I1,J1)=T(I1,J1)+X
1000 GO TO 1020
1010 LET T(I1,J1)=T(I1,J1)-X
1020 NEXT J1
1030 NEXT I1
1040 NEXT J
1050 NEXT I
1060 IF Z2<>1 THEN 1130
1070 PRINT
1080 PRINT"NEXT CORRECTION******NUMBER"G
1090 PRINT
1100 PRINT"LP PP          Q               H             H/Q        DELTA"
1110 PRINT
1120 PRINT
1130 FOR I=1 TO M
1140 FOR J=1 TO P(I)
1150 IF Z2<>1 THEN 1170
1160 PRINT I;K(I,J),Q(I,J),G(I,J),ABS(G(I,J)/Q(I,J)),T(I,J)
1170 LET Q(I,J)=Q(I,J)+T(I,J)
1180 NEXT J
1190 IF Z2<>1 THEN 1210
1200 PRINT
1210 NEXT I
1220 FOR I=1 TO M
1230 FOR J=1 TO P(I)
1240 IF ABS(T(I,J))>ABS(R) THEN 1390
1250 NEXT J
1260 NEXT I
1270 PRINT
1280 PRINT"THE FINAL SOLUTION IS***** AFTER"G;"ITERATIONS:"
1290 PRINT
1300 PRINT"LP PP            Q               S             H"
1310 PRINT
1320 FOR I=1 TO M
1330 FOR J=1 TO P(I)
1340 PRINT I;K(I,J),Q(I,J),ABS(G(I,J)/L(I,J))*1000,G(I,J)
1350 NEXT J
1360 PRINT
1370 NEXT I
1380 GO TO 1400
1390 GO TO 750
1400 END

```