home *** CD-ROM | disk | FTP | other *** search
- 10 ' ############ VENTED BOX DESIGN PROGRAM ##############
- 20 ' written by Jeffrey E. Bollinger with additions by Rollins Brook
- 30 ' of BBN Laboratories and Drew Daniels of JBL Professional
- 40 ' based on algorithms developed by Don Keele at JBL, between 1976 and 1977
- 50 ' results are valid to +-10% or +-1dB for drivers with Qts between .25 & .65
- 60 ' written for IBM or MS BASICA 3.0 running under PC or MS DOS 3.0
- 70 ' contains SHELL commands in lines 34, 73, 239, and 240
- 80 ' SHELL is supported only by BASICA 3.0 or later
- 90 '
- 100 '
- 110 KEY OFF 'turns off function key display on line 25
- 120 EFF=0
- 130 ON ERROR GOTO 660
- 140 '
- 150 '
- 160 'dimension arrays
- 170 DIM FREQ(51)
- 180 FOR K=0 TO 50
- 190 FREQ(K)=INT(15.625*2^(K/10)*10+.5)/10 ' 1/10 oct calc 15 to 500 Hz
- 200 NEXT K
- 210 DIM FREQ.3(15)
- 220 FOR K=1 TO 15
- 230 READ FREQ.3(K) 'one-third octave 20 to 500 Hz
- 240 DATA 20,25,31,40,50,63,80,100,125,160,200,250,300,400,500
- 250 NEXT K
- 260 '
- 270 '
- 280 'variable definitions
- 290 LOG10=LOG(10) 'for use in log to base 10 calculations (logx=lnx/ln10)
- 300 PI=3.1415927#
- 310 '
- 320 '
- 330 'set display screen and color map
- 340 ' SHELL "GRAPHICS" 'enables graphics mode printscreen function
- 350 SCREEN 0 : WIDTH 80
- 360 CLS : COLOR 15,1,7 : CLS
- 370 '
- 380 '
- 390 '======= main menu =======
- 400 COLOR 15:LOCATE 1,1
- 410 OVERLAY$="N"
- 420 PRINT " BBN LABORATORIES "
- 430 PRINT " D.B. KEELE JR."
- 440 PRINT " VENTED BOX DESIGN PROGRAM"
- 442 COLOR 31
- 450 PRINT : PRINT :PRINT" PLEASE SET CAPS LOCK TO UPPER CASE" :PRINT :PRINT
- 452 COLOR 15
- 460 PRINT TAB(28);"****** MAIN MENU ******"
- 470 PRINT
- 480 PRINT TAB(25);"1 - Enter New Driver"
- 482 COLOR 7
- 490 PRINT TAB(25);"2 - Change Box Volume Vb"
- 500 PRINT TAB(25);"3 - Change -3dB Frequency f3"
- 502 COLOR 15
- 510 PRINT TAB(25);"4 - Draw Response Curve(s)"
- 520 PRINT TAB(25);"5 - Draw Response and Displacement Limits Curve(s)"
- 522 COLOR 7
- 530 PRINT TAB(25);"6 - Change Large-Signal Parameters"
- 532 COLOR 15
- 540 PRINT TAB(25);"7 - Optimum Vent Design"
- 542 COLOR 7
- 550 PRINT TAB(25);"8 - Change Vent Area"
- 560 PRINT TAB(25);"9 - Change Duct Length"
- 570 PRINT TAB(25);"0 - Exit Program"
- 572 COLOR 15
- 580 PRINT : INPUT " Your Choice "; CHOICE
- 590 IF CHOICE=6 THEN EFF=0: CLS
- 600 ON CHOICE GOSUB 770,1000,1120,1500,1500,1820,3680,4050,4330
- 610 IF CHOICE<>0 THEN GOTO 350 'redisplays menu after return from subroutine
- 620 COLOR 15,0,0:CLS:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT " Confirm that you wish to stop the program by typing:"
- 630 PRINT :PRINT :PRINT :PRINT: PRINT TAB(28); "END to exit to BASICA"
- 640 PRINT: PRINT TAB(28); "DOS to exit to DOS"
- 650 INPUT " ? ", EXIT$
- 660 IF EXIT$="END" OR EXIT$="end" THEN COLOR 15,0,0: CLS: END
- 670 IF EXIT$="DOS" OR EXIT$="dos" THEN SYSTEM
- 680 GOTO 350
- 690 '
- 700 '
- 710 '======= error subroutine =======
- 720 PRINT "error";ERR;"at line";ERL
- 730 SHELL "PAUSE"
- 740 GOTO 350 'resets to main menu
- 750 '
- 760 '
- 770 '======= enter new driver ========
- 780 CLS:PRINT:PRINT:PRINT :PRINT :PRINT
- 790 EFF=0: SV.MIN=0
- 800 INPUT " Driver Description "; DRIVER$ : PRINT
- 810 INPUT " Driver Fs in Hz ";FS : PRINT
- 820 IF FS < 1 THEN 810
- 830 INPUT " Driver Qts ";QTS : PRINT
- 840 IF QTS <.01 THEN 830
- 850 PRINT " NOTE: for multiple drivers in
- 860 PRINT " a single box, use Vas multiplied
- 870 PRINT " by n drivers.
- 880 PRINT
- 890 INPUT " Driver Vas in cubic feet";VAS : PRINT
- 900 IF VAS < .1 THEN 890
- 910 CLS: IF CHOICE<>1 THEN RETURN
- 920 VB=20*(QTS^3.3)*VAS 'start max flat calculations
- 930 F3=.28*(QTS^-1.4)*FS
- 940 FB=1.5*(QTS^.44)*F3
- 950 PRINT : PRINT TAB(23);"B4 MAXIMALLY FLAT ALIGNMENT":PRINT
- 960 GOSUB 1240 'printout
- 970 CLS: RETURN
- 980 '
- 990 '
- 1000 '======= change box volume response calculation =======
- 1010 IF FS=0 THEN GOSUB 770
- 1020 CLS:PRINT:PRINT :PRINT :PRINT :PRINT
- 1030 INPUT "New Box Volume Vb in cubic feet"; VB
- 1040 IF VB <.1 THEN 1030
- 1050 CLS:PRINT :PRINT :PRINT
- 1060 F3=FS*(VAS/VB)^.44
- 1070 FB=F3/(VAS/VB)^.13
- 1080 GOSUB 1240 'printout
- 1090 RETURN
- 1100 '
- 1110 '
- 1120 '======= change f3 response calculations =======
- 1130 IF FS=0 THEN GOSUB 770
- 1140 CLS:PRINT:PRINT :PRINT :PRINT :PRINT
- 1150 INPUT " New -3dB point f3";F3
- 1160 IF F3 < 1 GOTO 1150
- 1170 CLS:PRINT :PRINT :PRINT
- 1180 VB=VAS/(F3/FS)^2.27
- 1190 FB=F3/(VAS/VB)^.13
- 1200 GOSUB 1240 'for printout
- 1210 RETURN
- 1220 '
- 1230 '
- 1240 '======= common small-signal response summary calc & printout =======
- 1250 RIPPLE=20*LOG(QTS*(VAS/VB)^.3/.4)/LOG10
- 1260 PRINT TAB(28);DRIVER$
- 1270 PRINT TAB(28) USING"Vb=###.## cubic feet";VB : GOTO 1280
- 1280 IF VB < 25 THEN Q=3 : IF VB < 19 THEN Q=5 : IF VB < 11 THEN Q=7
- 1290 PRINT TAB(28) USING"f3=###.# Hz";F3
- 1300 PRINT TAB(28) USING"Fb=###.# Hz";FB
- 1310 PRINT TAB(28) USING"Ripple= ##.# dB";RIPPLE
- 1320 LOCATE 22,12:COLOR 7: PRINT " enter N for NO press RETURN for YES"
- 1330 COLOR 15: LOCATE 8
- 1340 PRINT: PRINT: PRINT
- 1350 INPUT " Do you wish to draw this alignment"; ANS$ : PRINT
- 1360 IF ANS$="N" OR ANS$="n" THEN RETURN
- 1370 INPUT " Show thermal and displacement limits"; LIMITS$ : PRINT
- 1380 PRINT " The default value of Qb is"; Q : PRINT
- 1390 INPUT " Do you wish to use this value for Qb"; DEFAULT$ : PRINT
- 1400 IF DEFAULT$="N" OR DEFAULT$="n" THEN INPUT " Preferred Qb"; Q
- 1410 VBMAX=VB: VBMIN=VB: VBSTEP=1
- 1420 FBMAX=FB: FBMIN=FB: FBSTEP=1
- 1430 IF LIMITS$<>"N" THEN CHOICE=5: IF EFF=0 THEN GOSUB 1890 'for large signal data input
- 1440 IF LIMITS$="N" THEN CHOICE=4
- 1450 OVERLAY$="N"
- 1460 GOSUB 2170 'for drawing routines
- 1470 RETURN
- 1480 '
- 1490 '
- 1500 '======= box size & tuning input =======
- 1510 IF FS=0 THEN GOSUB 770
- 1520 IF CHOICE=4 THEN LIMITS$="N"
- 1530 IF CHOICE=5 THEN LIMITS$="Y"
- 1540 IF CHOICE=5 AND EFF=0 THEN CLS: GOSUB 1820 'for large-signal data input
- 1550 CLS: LOCATE 1,15:COLOR 15:PRINT " To answer YES/NO questions, enter N for NO press RETURN for YES"
- 1560 COLOR 15: LOCATE 1,,
- 1570 PRINT :PRINT :PRINT
- 1580 INPUT " Compute more than 1 Box Size ";VOL$ : PRINT
- 1590 INPUT " Compute more than 1 Box Tuning ";TUN$ : PRINT
- 1600 IF VOL$="N" OR VOL$="n" THEN INPUT " Box Net Volume in cubic feet";VBMIN : PRINT : VBMAX=VBMIN : VBSTEP=1 : GOTO 1670
- 1610 INPUT " Smallest Box Volume in cubic feet ";VBMIN : PRINT
- 1620 IF VBMIN < .1 THEN 1610
- 1630 INPUT " Largest Box Volume in cubic feet ";VBMAX : PRINT
- 1640 IF VBMAX < .1 THEN 1630
- 1650 INPUT " Volume increment between Box Sizes ";VBSTEP : PRINT
- 1660 IF VBSTEP < .1 THEN 1650
- 1670 IF TUN$="N" OR TUN$="n" THEN INPUT " Box Tuning Fb in Hz ";FBMIN : FBMAX=FBMIN : FBSTEP=1 : PRINT : GOTO 1740
- 1680 INPUT " Lowest Frequency Box Tuning f3 ";FBMIN : PRINT
- 1690 IF FBMIN < .1 THEN 1680
- 1700 INPUT " Highest Frequency Box Tuning f3 ";FBMAX : PRINT
- 1710 IF FBMAX < .1 THEN 1700
- 1720 INPUT " Frequency increment between Box Tunings ";FBSTEP : PRINT
- 1730 IF FBSTEP <.1 THEN 1720
- 1740 INPUT " Do you wish to use the default value for Qb";DEFAULT$
- 1750 IF DEFAULT$="N" OR DEFAULT$="n" THEN PRINT : INPUT " Preferred Qb is ";Q
- 1760 OVERLAY$="N"
- 1770 IF VOL$<>"N" OR TUN$<>"N" THEN INPUT " Overlay drawings";OVERLAY$
- 1780 GOSUB 2170 'for drawing routines
- 1790 RETURN
- 1800 '
- 1810 '
- 1820 '======= large-signal driver parameter input =======
- 1830 IF CHOICE=6 OR CHOICE=5 THEN PRINT:PRINT:PRINT
- 1840 IF EFF<>0 THEN 2040
- 1850 SV.MIN=0
- 1860 PRINT " NOTE: for multiple drivers in a single
- 1870 PRINT " box, use Efficiency multiplied by n drivers.
- 1880 PRINT
- 1890 INPUT " Driver 1/2 Space Efficiency in percent"; EFF : PRINT
- 1900 IF EFF < .01 THEN 1890
- 1910 PRINT " for multiple drivers, multiply Pe by n drivers.
- 1920 PRINT
- 1930 INPUT " Driver Input Power Limit (Pe) in Watts";PE : PRINT
- 1940 IF PE < 1 THEN 1930
- 1950 INPUT " Driver Maximum Peak Linear Excursion (Xmax) in inches";XMAX : PRINT
- 1960 IF XMAX < .01 THEN 1950
- 1970 INPUT " Driver Effective Diameter in inches";DIA : PRINT
- 1980 IF DIA < 1 THEN 1970
- 1990 INPUT " How many drivers "; NUMDRVRS : PRINT
- 2000 IF NUMDRVRS<1 THEN 1990
- 2010 IF NUMDRVRS>1 THEN 2020 ELSE 2030
- 2020 DIA=2*(SQR(((PI*DIA/2)^2)*NUMDRVRS)/PI)
- 2030 IF DIA < 1 THEN 1970
- 2040 CLS
- 2050 THERMPWR=.01*EFF*PE 'midband thermal limit acoustic output power (Watts)
- 2060 PWL=10*LOG(THERMPWR)/LOG10+120
- 2070 XMAXM=XMAX/39.37 'Xmax in meters
- 2080 DIAM=DIA/39.37 'driver diameter in meters
- 2090 SDM=PI*DIAM^2/4 'driver area in square meters
- 2100 SD=PI*DIA^2/4 'driver area in inches
- 2110 VD=XMAX*SD 'driver volume displacement in cubic inches
- 2120 '
- 2130 DISPLACECONST=.4375*FS^4*(XMAXM*SDM)^2 'displ. acoustic output constant
- 2140 RETURN
- 2150 '
- 2160 '
- 2170 '======= drawing setup and response calculations =======
- 2180 FOR VB=VBMIN TO VBMAX STEP VBSTEP
- 2190 IF DEFAULT$<>"N" AND VB>19 THEN Q=3
- 2200 IF DEFAULT$<>"N" AND VB<19 THEN Q=5
- 2210 IF DEFAULT$<>"N" AND VB<11 THEN Q=7
- 2220 FOR FB=FBMIN TO FBMAX STEP FBSTEP
- 2230 IF OVERLAY$="N" OR OVERLAY$="n" THEN GOSUB 2650 'for graph setup
- 2240 IF OVERLAY$="N" OR OVERLAY$="n" THEN 2270
- 2250 IF DRAWCOUNTER=0 THEN GOSUB 2650 'for single graph setup
- 2260 DRAWCOUNTER=1
- 2270 A=(FB^2)/(FS^2) 'start response calculations
- 2280 B=(A/QTS)+(FB/(Q*FS))
- 2290 C=1+A+(FB/(Q*FS*QTS))+(VAS/VB)
- 2300 D=(1/QTS)+(FB/(Q*FS))
- 2310 FOR K=0 TO 50
- 2320 F=FREQ(K)/FS
- 2330 VENTRESP=F^4/SQR((F^4-(C*F^2)+A)^2+F^2*(B-D*F^2)^2)
- 2340 VENTRESP=20*LOG(VENTRESP)/LOG10
- 2350 VENTRESP=CINT(VENTRESP*10+.5)/10
- 2360 GOSUB 3170 'for drawing curve
- 2370 NEXT K
- 2380 IF CHOICE=5 THEN GOSUB 2490 'for displacement calculations
- 2390 IF OVERLAY$="N" OR OVERLAY$="n" THEN SHELL "PAUSE"
- 2400 IF OVERLAY$<>"N" AND FB=FBMAX AND VB=VBMAX THEN SHELL "PAUSE"
- 2410 NEXT FB
- 2420 NEXT VB
- 2430 CLS:SCREEN 0:WIDTH 80
- 2440 DRAWCOUNTER=0
- 2450 COLOR 15,1,9 :CLS
- 2460 RETURN
- 2470 '
- 2480 '
- 2490 '======= displacement limits calculations =======
- 2500 A=(FB^2)/(FS^2)
- 2510 B=(A/QTS)+(FB/(Q*FS))
- 2520 C=1+A+(FB/(Q*FS*QTS))+(VAS/VB)
- 2530 D=(1/QTS)+(FB/(Q*FS))
- 2540 FOR K=0 TO 50
- 2550 F=FREQ(K)/FS
- 2560 VENTRESP=F^8/((A-F^2)^2+(F*FB/(Q*FS))^2) 'mag. of displacement function
- 2570 DISPWR=DISPLACECONST*VENTRESP 'displacement limited output power
- 2580 VENTRESP=10*LOG(DISPWR/THERMPWR)/LOG10
- 2590 VENTRESP=CINT(VENTRESP*100)/100
- 2600 GOSUB 3170 'for drawing curve
- 2610 NEXT K
- 2620 RETURN
- 2630 '
- 2640 '
- 2650 '======= graph setup =======
- 2660 CLS :SCREEN 2 'high resolution B&W graphics
- 2670 IF CHOICE=4 THEN PRINT TAB(26);"Normalized Response"
- 2680 IF CHOICE=5 THEN PRINT TAB(13);"Displacement Limits and Normalized Response"
- 2690 PRINT " +5dB"
- 2700 IF LIMITS$="N" THEN GOSUB 3040 'no large-signal data printout
- 2710 IF LIMITS$="N" THEN GOTO 2900 'skip large-signal data printing
- 2720 IF OVERLAY$<>"N" THEN PRINT: PRINT: PRINT: GOTO 2780 'no vent data printout
- 2730 FBV=FB: VBV=VB: VDV=VD
- 2740 GOSUB 4530 'min vent area calculations
- 2750 PRINT TAB(63) "VENT:"
- 2760 PRINT TAB(64) "Area=";CINT(SV.MIN)
- 2770 PRINT TAB(64) USING"Diam.=###.#";SVMINDIAM
- 2780 PRINT TAB(64) USING"Length=###.#";LV
- 2790 PRINT " 0dB";TAB(63);" (";CINT(PWL);"dBPWL )"
- 2800 PRINT TAB(63);"DRIVER:"
- 2810 PRINT TAB(64);DRIVER$
- 2820 PRINT " -3dB";TAB(64);"Fs=";FS;"Hz"
- 2830 PRINT TAB(64);"Qts=";QTS
- 2840 PRINT TAB(64) USING"Vas=###.# ft^3";VAS
- 2850 PRINT " -6dB";TAB(64);"Eff=";EFF;"%"
- 2860 PRINT TAB(64);"Pe=";PE;"W"
- 2870 PRINT TAB(64);"Xmax=";XMAX;CHR$(34)
- 2880 PRINT TAB(64) USING"Diam=###.#";DIA
- 2890 PRINT "-10dB";TAB(64);"Vd=";CINT(VD);"in^3"
- 2900 PRINT TAB(63);"ENCLOSURE:"
- 2910 IF OVERLAY$<>"N" AND VOL$="N" THEN PRINT TAB(64);"Vb=";CINT(VB*10)/10;"ft^3"
- 2920 IF OVERLAY$<>"N" AND VOL$<>"N" THEN PRINT TAB(64);"Vb=";VBMIN;"-";VBMAX;"ft^3"
- 2930 IF OVERLAY$="N" THEN PRINT TAB(64);"Vb=";CINT(VB*100)/100;"ft^3"
- 2940 IF OVERLAY$<>"N" AND TUN$="N" THEN PRINT TAB(64);"Fb=";CINT(FB*10)/10;"Hz"
- 2950 IF OVERLAY$<>"N" AND TUN$<>"N" THEN PRINT TAB(64);"Fb=";FBMIN;"-";FBMAX;"Hz"
- 2960 IF OVERLAY$="N" THEN PRINT TAB(64);"Fb=";CINT(FB*10)/10;"Hz"
- 2970 PRINT TAB(64);"Qb=";Q
- 2980 PRINT "-15dB"
- 2990 PRINT TAB(10);"20 30 50 100 200 300 500 Hz"
- 3000 GOSUB 3310 'for drawing grid
- 3010 RETURN
- 3020 '
- 3030 '
- 3040 '======= no large-signal grid labels =======
- 3050 PRINT:PRINT:PRINT:PRINT
- 3060 PRINT " 0dB"
- 3070 PRINT TAB(63) "Driver:"
- 3080 PRINT TAB(64) DRIVER$
- 3090 PRINT " -3dB"; TAB(64) "Fs=";FS;"Hz"
- 3100 PRINT TAB(64) "Qts=";QTS
- 3110 PRINT TAB(64) "Vas=";VAS;"ft^3"
- 3120 PRINT " -6dB":PRINT:PRINT:PRINT
- 3130 PRINT "-10dB"
- 3140 RETURN
- 3150 '
- 3160 '
- 3170 '======= draw curve =======
- 3180 XL=44 'left edge of graph
- 3190 YB=172 'bottom edge of graph
- 3200 YT=12 'top edge of graph
- 3210 XR=494 'right edge of graph
- 3220 IF K=0 THEN DRAW "BM=XL; ,=YB;" 'first move to graph lower left corner
- 3230 X=9*K+XL
- 3240 X1=X+9
- 3250 IF VENTRESP<-15 THEN DRAW "BM=X1; ,=YB;":GOTO 3280 'move but don't draw
- 3260 Y=52-(VENTRESP*8)
- 3270 DRAW "C1;M=X; ,=Y;"
- 3280 RETURN
- 3290 '
- 3300 '
- 3310 '======= draw grid =======
- 3320 LINE(44,12)-(494,172),1,B 'draws box
- 3330 LINE(44,52)-(494,52),,,&HCCCC 'dashed 0 db ref line
- 3340 LINE(44,76)-(494,76),,,&HAAAA 'dotted -3db line
- 3350 LINE(44,100)-(494,100),,,&HAAAA 'dotted -6db line
- 3360 LINE(44,132)-(494,132),,,&HAAAA 'dotted -10db line
- 3370 'draw tick marks
- 3380 FOR Y=16 TO 168 STEP 8 '1/2db ticks
- 3390 LINE(42,Y)-(44,Y)
- 3400 NEXT Y
- 3410 FOR Y=20 TO 164 STEP 8 '1db ticks
- 3420 LINE(40,Y)-(44,Y)
- 3430 NEXT Y
- 3440 FOR Y=12 TO 172 STEP 40 '5db ticks
- 3450 LINE(40,Y)-(44,Y)
- 3460 NEXT Y
- 3470 FOR Z=20 TO 100 STEP 10
- 3480 X=LOG(Z/15)/LOG10*295.49299#+44
- 3490 LINE(X,172)-(X,12)
- 3500 NEXT Z
- 3510 FOR Z=200 TO 400 STEP 100
- 3520 X=LOG(Z/15)/LOG10*295.49299#+44
- 3530 LINE(X,172)-(X,12)
- 3540 NEXT Z
- 3550 FOR Z=25 TO 95 STEP 10
- 3560 X=LOG(Z/15)/LOG10*295.49299#+44
- 3570 LINE(X,172)-(X,169)
- 3580 NEXT Z
- 3590 FOR Z=150 TO 450 STEP 100
- 3600 X=LOG(Z/15)/LOG10*295.49299#+44
- 3610 LINE(X,172)-(X,169)
- 3620 NEXT Z
- 3630 '
- 3640 RETURN
- 3650 '
- 3660 '
- 3670 '======= vent design =======
- 3680 GOSUB 3800 'vent design data input
- 3690 GOSUB 4530 'min vent calculations
- 3700 PRINT :PRINT " Minimum Vent Area is";CINT(SV.MIN*10)/10;"square inches"
- 3710 SVMINDIAM = SQR(SV.MIN/PI)*2:SVMINDIAM=CINT(SVMINDIAM*10+.5)/10
- 3720 PRINT " The diameter of a tubular duct would be";CINT(SVMINDIAM*10)/10;"inches"
- 3730 PRINT " Duct length is";CINT(LV*10)/10;"inches, tuning a";CINT(VBV*10)/10;"cubic foot box to";FBV;"Hz"
- 3740 VVMIN=SV.MIN*LV : VVVMIN=VVMIN/1728 : PRINT
- 3750 PRINT " The duct volume is";CINT(VVMIN);"cubic inches or";CINT(VVVMIN*100)/100;"cubic feet."
- 3760 PRINT " THIS VOLUME MUST BE ADDED TO THE DESIRED ENCLOSURE VOLUME."
- 3770 GOTO 3910 'vent menu
- 3780 '
- 3790 '
- 3800 '======= input vent design data =======
- 3810 CLS:PRINT:PRINT:PRINT:PRINT
- 3820 INPUT " Box volume Vb in cubic feet";VBV : PRINT
- 3830 IF VBV < .001 THEN 3820
- 3840 INPUT " Box tuning frequency Fb in Hz";FBV : PRINT
- 3850 IF FBV < .1 THEN 3840
- 3860 INPUT " Driver displacement volume Vd in cubic inches";VDV
- 3870 IF VDV < .1 THEN 3860
- 3880 RETURN
- 3890 '
- 3900 '
- 3910 '======= vent design menu =======
- 3920 LOCATE 20,45: PRINT " VENT DESIGN MENU "
- 3930 '
- 3940 LOCATE 21,45: PRINT " 7 Change Vb or Fb "
- 3950 LOCATE 22,45: PRINT " 8 Change Vent Area or Diameter "
- 3960 LOCATE 23,45: PRINT " 9 Change Duct Length "
- 3970 LOCATE 24,45: PRINT " ENTER for Return to Main Menu "
- 3980 LOCATE 25,45: INPUT " Your Choice";VENT.CHOICE
- 3990 IF VENT.CHOICE=7 THEN 3670
- 4000 IF VENT.CHOICE=8 THEN 4050
- 4010 IF VENT.CHOICE=9 THEN 4330
- 4020 RETURN
- 4030 '
- 4040 '
- 4050 '======= change vent area, find duct length =======
- 4060 IF SV.MIN=0 THEN GOSUB 3800 ELSE 4080 'input data if missing
- 4070 GOSUB 4530 'find minimum vent area
- 4080 CLS:PRINT :PRINT :PRINT :PRINT
- 4090 INPUT " Are you entering vent area (A) or diameter (D)";CALC$ : PRINT
- 4100 IF CALC$="D" OR CALC$="d" THEN 4120 ELSE 4110
- 4110 IF CALC$="A" OR CALC$="a" THEN 4160 ELSE 4090
- 4120 INPUT " Vent diameter Dv in inches";SVDIAM : PRINT
- 4130 IF SVDIAM < 1 THEN 4120
- 4140 SV=PI*(SVDIAM/2)^2
- 4150 PRINT " Vent area Sv is";CINT(SV*100)/100;"square inches" : GOTO 4200 : PRINT
- 4160 INPUT " Vent area Sv in square inches";SV : PRINT
- 4170 IF SV < 1 THEN 4160
- 4180 DV=SQR(SV/PI)*2
- 4190 PRINT " The equivalent diameter of this area is";CINT(DV*10)/10;"inches"
- 4200 IF SV<SV.MIN THEN GOSUB 4650 'for warning message
- 4210 LV=SV/SV.LV-.825*SQR(SV)
- 4220 CUIN=SV*LV : CUIN=CINT(CUIN)
- 4230 CUFT=CUIN/1728 : CUFT=CINT(CUFT*100)/100 :PRINT
- 4240 PRINT " Duct length is";CINT(LV*100)/100;"inches"
- 4250 PRINT " Duct volume is ";CUIN;" cubic inches or ";CUFT;" cubic feet.
- 4260 PRINT " THIS VOLUME MUST BE ADDED TO THE DESIRED ENCLOSURE VOLUME."
- 4270 PRINT " Fb=";FBV;"Hz"
- 4280 PRINT " Vb=";VBV;"cubic feet
- 4290 PRINT : PRINT : PRINT
- 4300 GOTO 3910
- 4310 '
- 4320 '
- 4330 '======= change duct length, find vent area =======
- 4340 IF SV.MIN=O THEN GOSUB 3800 ELSE 4360 'input data if missing
- 4350 GOSUB 4530 'find minimum vent area
- 4360 CLS: PRINT :PRINT :PRINT :PRINT
- 4370 INPUT " Duct length in inches";LV
- 4380 IF LV < .75 THEN 4370
- 4390 IF LV<.75 THEN PRINT " WARNING: DUCT LENGTH IS LESS THAN 3/4 INCH"
- 4400 SV=((SV.LV*.825+SQR((SV.LV*.825)^2+4*SV.LV*LV))/2)^2:SV=CINT(SV*10+.5)/10
- 4410 PRINT " Vent area is";SV;"square inches"
- 4420 VENTDIAM = SQR(SV/PI)*2:VENTDIAM=CINT(VENTDIAM*10+.5)/10
- 4430 PRINT " Vent diameter is";VENTDIAM;"inches" : PRINT
- 4440 CUIN=SV*LV : CUIN=CINT(CUIN)
- 4450 CUFT=CUIN/1728 : CUFT=CINT(CUFT*100)/100
- 4460 PRINT " Duct volume is ";CUIN;" cubic inches or ";CUFT;" cubic feet.
- 4470 IF SV<SV.MIN THEN GOSUB 4650 'for warning message
- 4480 PRINT " Fb=";FBV;"Hz"
- 4490 PRINT " Vb=";VBV;"cubic feet"
- 4500 GOTO 3910
- 4510 '
- 4520 '
- 4530 '======= minimum vent size calculations =======
- 4540 'most accurate for ducts more than 2 inches long
- 4550 L=2350/(FBV^2*VBV)
- 4560 SV.MIN=8.25*VDV/(SQR(FBV))
- 4570 SV.LV=1728*VBV*(6.2832*FBV/13504)^2 'vent area-to-effective-length ratio
- 4580 LV=SV.MIN/SV.LV-.825*SQR(SV.MIN)
- 4590 IF LV<.75 THEN LV=.75 : SV.MIN=((SV.LV*.825+SQR((SV.LV*.825)^2+4*SV.LV*LV))/2)^2
- 4600 SVMINDIAM=SQR(SV.MIN/PI)*2
- 4610 LV=INT(LV*10^2+.5)/10^2
- 4620 RETURN
- 4630 '
- 4640 '
- 4650 '======= warning message =======
- 4660 PRINT: COLOR 7
- 4670 PRINT USING " WARNING this vent area is less than the desired minimum of ###.#";SV.MIN
- 4680 PRINT " square inches as recommended in Small to keep air particle
- 4690 PRINT " velocity in the vent below 2% of the speed of sound, for near-
- 4700 PRINT " lossless system tuning. Acceptably good results will be obtained
- 4710 PRINT " by using one port per driver whose diameter is AT LEAST 1/3 that
- 4720 PRINT " of the driver, or whose area is equal to a circle with that diameter.
- 4730 COLOR 15
- 4740 RETURN
- 4750 END