10 REM********************Thinfoil********************* 20 SCREEN 1: COLOR 0, 1: KEY OFF: pi = 3.1415927#: CLS 30 PRINT "Program Thinfoil: calculations for airfoils are" 40 PRINT "carried out using thin airfoil theory. The thin" 50 PRINT "airfoil is assumed to have a mean camber line " 60 PRINT "given by the following cubic equation": PRINT 70 PRINT " z = 4h[x - (k+1)x^2 + kx^3]": PRINT 80 PRINT "For a circular arc airfoil k = 0, whereas for " 90 PRINT "a reflexed trailing edge k > 0. The constant h " 100 PRINT "corresponds to the maximun camber divided by " 110 PRINT "the chord for the case of a circular arc profile." 120 PRINT : INPUT "What value do you wish to consider for the nondimensional constant k(value from 0 to 3)"; k: PRINT 130 IF k < 0 OR k > 3 THEN 120 140 INPUT "What value do you wish to consider for the nondimensional constant h(value from 0 to .15)"; h: PRINT 150 IF h < 0 OR h > .15 THEN 140 160 INPUT "Do you wish to consider the trailing edge flap ( y or n )"; a$: PRINT 170 IF a$ = "n" OR a$ = "N" THEN flap = 0: GOTO 240 180 IF a$ = "Y" OR a$ = "y" THEN flap = 1 ELSE GOTO 160 190 INPUT "What is the flap length as a fraction of the chord length (value <.5)? ", lf: PRINT 200 IF lf < 0 OR lf > .5 THEN 190 210 INPUT "What is the flap defection angle in degrees (value from -10 to 20)"; d1: d = d1 * pi / 180: PRINT 220 IF d1 < -10 OR d1 > 20 THEN 210 225 CLS : PRINT "Note: All lengths are nondimensionalized by the airfoil chord length" 230 LOCATE 5, 7: PRINT "z = "; 4 * h; "(x -"; k + 1; "x^2 +"; k; "x^3)" 240 CLS : IF flap THEN LOCATE 7, 2: PRINT "Flap Length ="; lf; " Angle ="; d1; "deg" 250 REM****************************************airfoil profile 260 sf1 = 240: sf2 = 200 270 PSET (40, 100) 280 FOR x0 = 0 TO 1.01 STEP .02 290 z = 4 * h * (x0 - (k + 1) * x0 ^ 2 + k * x0 ^ 3) 300 IF flap THEN IF x0 > 1 - lf THEN z = z + (1 - lf - x0) * TAN(d) 305 REM IF x0 = 0 THEN PSET (40 + sf1 * x0, 100 - sf2 * z) 310 LINE -(40 + sf1 * x0, 100 - sf2 * z), 2 320 NEXT 330 REM****************************************lift and moment coefficients 340 l1 = 2 * pi: l2 = (4 - 3 * k) * pi * h'lift coeff. parameters 350 th = pi - ATN(SQR(4 * lf * (1 - lf)) / (1 - 2 * lf)) 360 IF flap THEN dl = 2 * (pi - th + SIN(th)) * d: l2 = l2 + dl 370 LOCATE 17, 11: PRINT "cl = "; : PRINT USING "#.###"; l1; : IF l2 > 0 THEN PRINT "a + "; ELSE PRINT "a - "; 380 PRINT USING "#.###"; ABS(l2) 390 a0 = -l2 / l1'zero lift angle 400 LOCATE 19, 2: PRINT "zero lift angle ="; : PRINT USING "###.##"; a0; : PRINT "rad ="; : PRINT USING "###.##"; a0 * 180 / pi; : PRINT "deg" 410 cm = (7 * k / 8 - 1) * pi * h: IF flap THEN cm = cm + .5 * SIN(th) * (COS(th) - 1) * d 420 LOCATE 21, 14: PRINT "cmac="; : PRINT USING "###.##"; cm 430 LOCATE 24, 2: PRINT "Press p for pressure coefficient plot."; 440 LOCATE 25, 1: PRINT "rerun dos basica "; 450 i$ = INKEY$: IF i$ = "p" OR i$ = "P" THEN 480 460 IF i$ = CHR$(32) THEN CLS : GOTO 120 ELSE IF i$ = CHR$(27) THEN CLS : SYSTEM ELSE IF i$ = "b" OR i$ = "B" THEN SCREEN 0: WIDTH 80: END ELSE 450 470 REM*****************************************Pressure coefficient 480 CLS : INPUT "What is the angle of attack in degrees (value from -5 to 20)"; a1: PRINT 490 IF a1 < -5 OR a1 > 20 THEN 480 ELSE CLS 500 LOCATE 1, 24: PRINT "a ="; a1; "deg" 510 a = a1 * pi / 180: cl = l1 * a + l2 520 LOCATE 3, 24: PRINT "cl ="; : PRINT USING "##.###"; cl 530 xp = .25 - cm / cl: LOCATE 5, 24: PRINT "x(c.p.)/l ="; : PRINT USING "##.###"; xp 540 LOCATE 17, 4: PRINT "0 x/l .5 1"; 550 FOR y = 0 TO 7 560 LOCATE 22 - 3 * y, 2 570 PRINT y - 2; : NEXT 580 PSET (0, 86): LINE -(7, 86): LINE -(3, 80): LINE -(0, 86) 590 LOCATE 11, 2: PRINT "cp" 600 LINE (27, 123)-(315, 123): LINE (27, 3)-(27, 171) 610 FOR y = 3 TO 171 STEP 24 620 LINE (25, y)-(29, y): NEXT 630 LINE (171, 121)-(171, 125): LINE (315, 121)-(315, 125) 640 x1 = 315: cp1 = 123: PSET (x1, cp1), 2 650 FOR t = .96 * pi TO 0 STEP -.04 * pi 660 x = .5 * (1 - COS(t)) 670 cp = 2 * (2 * a - k * h) * (1 + COS(t)) / SIN(t) + 8 * (2 - k) * h * SIN(t) + 6 * k * h * SIN(2 * t) 680 IF flap = 0 THEN 730 690 cp = cp + 4 * d * (1 - th / pi) * (1 + COS(t)) / SIN(t) 700 FOR n = 1 TO 40 710 cp = cp + 8 * d * SIN(n * th) * SIN(n * t) / (n * pi): NEXT 720 x2 = 27 + 288 * x: cp2 = 123 - 24 * cp 730 IF cp2 < 0 THEN LINE -(x1 - cp1 * (x2 - x1) / (cp2 - cp1), 0), 2: GOTO 770 740 LINE -(x2, cp2), 2 750 x1 = x2: cp1 = cp2 760 NEXT 770 LOCATE 25, 1: PRINT "rerun dos basica ": 780 i$ = INKEY$: IF i$ = CHR$(32) THEN CLS : GOTO 120 ELSE IF i$ = CHR$(27) THEN CLS : SYSTEM ELSE IF i$ = "b" OR i$ = "B" THEN SCREEN 0: WIDTH 80: END ELSE 780