陡坡水面线计算 basic源码
flyfun
flyfun Lv.3
2006年01月01日 14:46:28
来自于水利软件
只看楼主

5 CLEAR : LPRINT TAB(3);"陡坡水面线计算 DP-3(1993.9)GD" 7 LPRINT " - - - - - - - - -": 14 OPEN"I",#1,"DP-3.DAT" 100 INPUT#1,B0,N0,A,N,M,T 110 DIM M(N),J(N),L(N,M),B(N,M),HC(N,M) 120 FOR I=1 TO N:INPUT#1,J(I): NEXT I

5 CLEAR : LPRINT TAB(3);"陡坡水面线计算 DP-3(1993.9)GD"
7 LPRINT " - - - - - - - - -":
14 OPEN"I",#1,"DP-3.DAT"
100 INPUT#1,B0,N0,A,N,M,T
110 DIM M(N),J(N),L(N,M),B(N,M),HC(N,M)
120 FOR I=1 TO N:INPUT#1,J(I): NEXT I
125 FOR I=1 TO N:INPUT#1,M(I): NEXT I
128 IF T=1 THEN 132
130 FOR I=1 TO N: FOR I1=1 TO M(I):INPUT#1, L(I,I1),B(I,I1): NEXT I1: NEXT I: GOTO 135
132 FOR I=1 TO N: FOR I1=1 TO M(I):INPUT#1, L(I,I1):B(I,I1)=B0: NEXT I1: NEXT I
134 CLOSE#1
135 B(1,0)=B0: IF N=1 THEN 150
140 FOR I=2 TO N:B(I,0)=B(I-1,M(I-1)): NEXT I
150 INPUT "打印原始数据吗(Y/N)";A$
155 IF A$="N" OR A$="n" THEN 200
156 IF A$="Y" OR A$="y" THEN 160
160 LPRINT "起始槽宽 B0=";B0;"(m)"
164 LPRINT "糙率 N0=";N0;" 动能修正系数A=";A
168 LPRINT "分段数 N=";N;" M=";M;" T=";T;"(T=1/2(等宽/不等宽))"
175 LPRINT TAB(2);"I";TAB(6);"J(I)";TAB(12);"M(I)";TAB(17);"DL(m)";TAB(23);"B(m)";TAB(30);"L(m)": LPRINT
180 FOR I=1 TO N: LPRINT TAB(1);I;TAB(5);J(I);TAB(12);M(I);
185 FOR I1=1 TO M(I):L=L+L(I,I1): LPRINT TAB(16); INT (10*L(I,I1)+.5)/10
190 LPRINT TAB(22); INT (100*B(I,I1)+.5)/100;TAB(29);L: NEXT I1: NEXT I
195 LPRINT : LPRINT " - - - - - - - - -":L=0
200 INPUT "Q=";Q: LPRINT "计算流量 Q=";Q;"(m/s)"
210 B=B0: GOSUB 470: LPRINT "临界水深 hk="; INT (1000*HK+.5)/1000;"(m)"
215 LPRINT TAB(2);"I";TAB(8);"L(m)";TAB(18);"H(m)";TAB(28);"V(m/s)"
218 PRINT "hk="; INT (1000*HK+.5)/1000;"(m)"
220 INPUT "HC(1,0)=";H0: IF H0=0 THEN LET H0=HK
222 LPRINT "起推水深 HC(1,0)="; INT (1000*H0+.5)/1000
225 LPRINT TAB(1);1;TAB(7);0;TAB(17); INT (1000*HK+.5)/1000;TAB(27); INT (100*Q/B/HK+.5)/100
226 LPRINT : CLS
230 HC(1,0)=H0:L=0: FOR I=1 TO N:J1= SQR (1+J(I)^2)
232 FOR I1=1 TO M(I)
235 H=HC(I,I1-1):B=B(I,I1-1): GOSUB 400
240 P1=H/J1+(A/W^2/19.6-L(I,I1)/K^2/2)*Q^2+L(I,I1)*J(I)
241 B=B(I,I1): GOSUB 400
242 IF I=1 AND I1=1 THEN A1=1.5: GOTO 245
243 A1=1
245 CH=HK-HC(I,I1-1)
246 IF P1-H/J1/A1-L(I,I1)*Q^2/K^2/2<=0 THEN 360
248 H2=Q/B/ SQR (19.6*(P1-H/J1/A1-L(I,I1)*Q^2/K^2/2))
249 IF H2>=HK-CH/3 THEN 360
250 DH=HC(I,I1-1)-H2:H=H2: GOSUB 420:F2=P2
255 IF J(I)<=0 AND F2>P1 THEN 360
257 H0=H2+DH*2/3:H=H0: GOSUB 420:F0=P2
260 H1=H2+DH/3:H=H1: GOSUB 420:F1=P2
265 P=P1: GOSUB 440: GOSUB 420
270 IF ABS (P1-P2)<=0.001 THEN 330
275 R1=H:L1=P2:H1=H:F1=L1
280 H0=H1+DH/10:H=H0: GOSUB 420:F0=P2
285 H2=H1-DH/10:H=H2: GOSUB 420:F2=P2
290 GOSUB 440: GOSUB 420
295 IF ABS (P1-P2)<=0.001 THEN 330
300 R2=H:L2=P2
305 H=R1+(R2-R1)/(L2-L1)*(P1-L1)
310 GOSUB 420
315 IF ABS (P1-P2)<=0.001 THEN 330
320 R1=R2:L1=L2:R2=H:L2=P2: GOTO 305
330 IF H>=HK THEN PRINT "H>=HK"
332 HC(I,I1)=H:L=L+L(I,I1)
333 LPRINT TAB(7);L;TAB(17); INT (1000*H+.5)/1000;TAB(27); INT (100*Q/B/H+.5)/100
334 LPRINT
335 NEXT I1: IF I=N THEN 342
337 LPRINT TAB(1);I+1:
340 HC(I+1,0)=HC(I,M(I)): NEXT I
342 GOTO 200
360 H3=HK:H=H3: GOSUB 420
365 IF P2>P1 THEN PRINT "H>HK"
366 IF P2=P1 THEN PRINT "H=HK"
370 H2=(H3+HC(I,I1-1))/2:H=H2: GOSUB 420
375 IF P2<P1 THEN H3=H2: GOTO 370
380 H2=H3:CH=H2-HC(I,I1-1):H=H2: GOSUB 420:F2=P2
382 H1=H2-CH/2:H=H1: GOSUB 420:F1=P2
384 H0=H2-CH:H=H0: GOSUB 420:F0=P2
386 P=P1: GOSUB 440: GOSUB 420:DH=H2-H0: GOTO 270
400 W=B*H:R=W/(B+2*H):K=W*R^(2/3)/N0
405 RETURN
420 GOSUB 400:P2=H/J1+(A/W^2/19.6+L(I,I1)/K^2/2)*Q^2
425 RETURN
440 Y0=H0*(P-F1)*(P-F2)/(F0-F1)/(F0-F2)
441 Y1=H1*(P-F0)*(P-F2)/(F1-F0)/(F1-F2)
442 Y2=H2*(P-F0)*(P-F1)/(F2-F0)/(F2-F1)
443 H=Y0+Y1+Y2
445 RETURN
460 Y0=H0*(P-F1)*(P-F2)*(P-F3)/(F0-F1)/(F0-F2)/(F0-F3)
461 Y1=H1*(P-F0)*(P-F2)*(P-F3)/(F1-F0)/(F1-F2)/(F1-F3)
462 Y2=H2*(P-F0)*(P-F1)*(P-F3)/(F2-F0)/(F2-F1)/(F2-F3)
463 Y3=H3*(P-F0)*(P-F1)*(P-F2)/(F3-F0)/(F3-F1)/(F3-F2)
464 H=Y0+Y1+Y2+Y3
465 RETURN
470 HK=0.467*(A*(Q/B)^2)^(1/3): RETURN
ebb4f6b2e750fffa838c.rar
0 B
立即下载
免费打赏

相关推荐

APP内打开