Site hosted by Angelfire.com: Build your free website today!

[Image]


Centre of pressure programme (By Dave Thomson)

[Image] Many software packages are available today to determine rocket performance and centre of pressure calculations. But they do cost money. I have started to develop my own 'as user friendly as possible' programme to determine centre of pressure. This programme is written in QBASIC and can be run in DOS or in a DOS window so long as you have QBASIC loaded. Only one file is required and can be 'cut and pasted' from the bottom of this page. Create as a file with a name of your choice in MS Word etc. and save as a text file in a directory of your choice and then log into QBASIC. Goto the directory where the file is held and click on it and then follow then RUN the programme. You may get one or two errors coming up but this is due to some of the string lengths wrapping over to the next line when pasted into Word. You may have to rebuild a line or two by a back space and insertion of a commer or two. QBASIC will advise what is wrong.

You will first be asked if you wish to use a model from the database or a new one. The ones in the database are some of my own but you may overwrite these by going into the QBASIC file and modifying the values against each rocket and re-saving the file.

If you choose to create a new one then you will asked to input the dimensions in order. A dummy rocket is drawn at the side to make clear what the dimensions are. When complete the programme will work out the Centre of pressure and the optimum centre of gravity. It will then display the values and draw a scaled version of your rocket along side to visually show the values that you put in. CP and CG are marked on the rocket also.

I am constantly developing the programme and hope to add more features. You may copy this programme and develop it yourself and pass it on to other amateur's. I am offering the information as freeware; commercial use of the code or diagrams is prohibited.

Please E-mail me on DATSCOPE@aol.com if you find any bugs or have any developments/ideas.

SCREEN 1

This screen shows the 'dummy' rocket outline and dimentions required by the programme. I t will first ask you if you are to use one from the database or a new one. Enter 1 or 2. If a new design then follow the instructions. You may enter whatever units you like so long as they are consistant thoughout!

[Image]

SCREEN 2

This screen shows the database rockets to choose from

[Image]

SCREEN 3

This screen gives the output values and a drawing of the rocket you requeted. This particular screen shows the type 4 from my database. This is the camera rocket from elsewhere in these pages.

[Image]


RETURN TO THE MAIN HOME PAGE


THE PROGRAMME

100 SCREEN 12

120 CLS

149 REM draw generic rocket outline

168 LINE (100, 100)-(150, 400), 12, B

170 LINE (100, 100)-(125, 20), 12

172 LINE (150, 100)-(125, 20), 12

174 LINE (100, 300)-(50, 350), 12

176 LINE (50, 350)-(50, 400), 12

178 LINE (50, 400)-(100, 390), 12

180 LINE (150, 300)-(200, 350), 12

182 LINE (200, 350)-(200, 400), 12

184 LINE (200, 400)-(150, 390), 12

190 REM plot rocket dimension letter inputs

200 LOCATE 10, 15: PRINT ; "D/DR"

210 LOCATE 15, 3: PRINT ; "XB"

220 LOCATE 21, 3: PRINT ; "XR"

230 LOCATE 24, 3: PRINT ; "CT"

240 LOCATE 23, 9: PRINT ; "LF"

250 LOCATE 28, 10: PRINT ; "S"

260 LOCATE 22, 16: PRINT ; "CR"

270 LOCATE 5, 8: PRINT ; "LN"

300 REM plot letter input dimension lines

310 LINE (90, 20)-(0, 20), 10

320 LINE (40, 100)-(90, 100), 10

330 LINE (0, 300)-(90, 300), 10

340 LINE (0, 350)-(40, 350), 10

350 LINE (0, 400)-(40, 400), 10

360 LINE (50, 410)-(50, 450), 10

370 LINE (100, 410)-(100, 450), 10

380 LINE (110, 300)-(110, 390), 9

382 LINE (102, 300)-(120, 300), 10

384 LINE (102, 390)-(120, 390), 10

390 LINE (98, 350)-(52, 375), 9

400 LINE (10, 20)-(10, 300), 9

410 LINE (102, 170)-(148, 170), 9

420 LINE (10, 300)-(10, 350), 9

430 LINE (10, 350)-(10, 400), 9

440 LINE (50, 20)-(50, 100), 9

450 LINE (50, 430)-(100, 430), 9

460 LINE (90, 20)-(0, 20), 10

470 LINE (90, 20)-(0, 20), 10

490 GOTO 1000

500 REM input values for drawing scaled rocket as a test before inputting to programme

502 SCREEN 12

505 CLS

510 LOCATE 2, 30: PRINT "MODEL TYPE", MODEL

511 LOCATE 4, 30: PRINT "LALL: OVERALL LENGTH"

512 LOCATE 4, 75: PRINT lall

520 LOCATE 5, 30: PRINT "NC: NOSE CONE TYPE, CONICAL 1 OR OGIVE 2"

522 LOCATE 5, 75: PRINT NC

530 LOCATE 6, 30: PRINT "LN: NOSE CONE LENGTH"

532 LOCATE 6, 75: PRINT LN

540 LOCATE 7, 30: PRINT "F : FINS?, IF 3 THEN 12 IF 4 THEN 16"

542 LOCATE 7, 75: PRINT F

550 LOCATE 8, 30: PRINT "XB: LENGTH, NOSE TIP TO FRONT EDGE OF FIN"

552 LOCATE 8, 75: PRINT XB

560 LOCATE 9, 30: PRINT "D : OVERALL DIAMETER"

562 LOCATE 9, 75: PRINT D

570 LOCATE 10, 30: PRINT "CR: LENGTH OF FIN TO SIDE OF BODY"

572 LOCATE 10, 75: PRINT CR

580 LOCATE 11, 30: PRINT "XR: LENGTH OF FIN LEADING EDGE SWEEP BACK"

582 LOCATE 11, 75: PRINT xr

583 LOCATE 12, 30: PRINT "CT: LENGTH OF OUTSIDE FIN EDGE"

584 LOCATE 12, 75: PRINT CT

585 LOCATE 13, 30: PRINT "S : WIDTH OF FIN PERPENDICULAR TO BODY"

586 LOCATE 13, 75: PRINT S

587 LOCATE 14, 30: PRINT "LF: FIN MID-CHORD LENGTH"

588 LOCATE 14, 75: PRINT LF

589 LOCATE 15, 30: PRINT "R : RADIUS OF BODY TUBE AT BASE"

590 LOCATE 15, 75: PRINT R

594 LET lallx = lall

595 IF lall < (XB + xr + CT) THEN LET lall = (XB + xr + CT)

600 REM draw actual rocket outline from data inputed

610 REM this draws a scaled box LINE (0, 0)-(((D / lall) * 460), 460), 12, B

650 REM draw nose cone ogive

651 IF NC = 1 THEN GOTO 668

652 CIRCLE (150, ((LN / lall) * 460)), (((LN / lall) * 460)), 10, 0, 3.142, (LN / (D / 2))

666 GOTO 674

667 REM draw nose cone conical

668 LINE (150, 0)-((150 - (((D / lall) * 460) / 2)), ((LN / lall) * 460)), 10

670 LINE (150, 0)-((150 + (((D / lall) * 460) / 2)), ((LN / lall) * 460)), 10

672 LINE ((150 - (((D / lall) * 460) / 2)), ((LN / lall) * 460))-((150 + (((D / lall) * 460) / 2)), ((LN / lall) * 460)), 10

674 REM draw body

675 LINE ((150 - (((D / lall) * 460) / 2)), ((LN / lall) * 460))-((150 + (((D / lall) * 460) / 2)), ((lallx / lall) * 460)), 10, B

677 REM draw left fin

678 LINE ((150 - (((D / lall) * 460) / 2)), (XB / lall) * 460)-(150 - ((S / lall) * 460), (((XB + xr) / lall) * 460)), 10

679 LINE (150 - ((S / lall) * 460), (((XB + xr + CT) / lall) * 460))-(150 - ((S / lall) * 460), (((XB + xr) / lall) * 460)), 10

680 LINE (150 - ((S / lall) * 460), (((XB + xr + CT) / lall) * 460))-((150 - (((D / lall) * 460) / 2)), ((XB + CR) / lall) * 460), 10

700 REM draw right fin

710 LINE ((150 + (((D / lall) * 460) / 2)), (XB / lall) * 460)-(150 + ((S / lall) * 460), (((XB + xr) / lall) * 460)), 10

720 LINE (150 + ((S / lall) * 460), (((XB + xr + CT) / lall) * 460))-(150 + ((S / lall) * 460), (((XB + xr) / lall) * 460)), 10

730 LINE (150 + ((S / lall) * 460), (((XB + xr + CT) / lall) * 460))-((150 + (((D / lall) * 460) / 2)), ((XB + CR) / lall) * 460), 10

800 RETURN

1000 GOTO 1500

1500 LOCATE 1, 30:

INPUT "CHOOSE FROM DATABASE 1=Y, 2=N : ", DB

IF DB = 2 THEN

GOTO 1505

END IF

IF DB = 1 THEN

GOTO 8001

END IF

GOTO 1505

1505 LOCATE 3, 30: PRINT "INPUT: STANDARD 1, NON-STANDARD 2"

1507 LOCATE 3, 75: INPUT T

1510 LOCATE 4, 30: PRINT "LALL: INPUT OVERALL LENGTH"

1512 LOCATE 4, 75: INPUT lall

1520 LOCATE 5, 30: PRINT "NC: NOSE CONE TYPE, CONICAL 1 OR OGIVE 2"

1522 LOCATE 5, 75: INPUT NC

1530 LOCATE 6, 30: PRINT "LN: NOSE CONE LENGTH"

1532 LOCATE 6, 75: INPUT LN

1545 LET XN = LN * .466

1540 LOCATE 7, 30: PRINT "F : FINS?, IF 3 THEN 12 IF 4 THEN 16"

1542 LOCATE 7, 75: INPUT F

1550 LOCATE 8, 30: PRINT "XB: LENGTH, NOSE TIP TO FRONT EDGE OF FIN"

1552 LOCATE 8, 75: INPUT XB

1560 LOCATE 9, 30: PRINT "D : OVERALL DIAMETER"

1562 LOCATE 9, 75: INPUT D

1570 LOCATE 10, 30: PRINT "CR: LENGTH OF FIN TO SIDE OF BODY"

1572 LOCATE 10, 75: INPUT CR

1580 LOCATE 11, 30: PRINT "XR: LENGTH OF FIN LEADING EDGE SWEEP BACK"

1582 LOCATE 11, 75: INPUT xr

1590 LOCATE 12, 30: PRINT "CT: LENGTH OF OUTSIDE FIN EDGE"

1592 LOCATE 12, 75: INPUT CT

1600 LOCATE 13, 30: PRINT "S : WIDTH OF FIN PERPENDICULAR TO BODY"

1622 LOCATE 13, 75: INPUT S

1630 LOCATE 14, 30: PRINT "LF: FIN MID-CHORD LENGTH"

1632 LOCATE 14, 75: INPUT LF

1640 LOCATE 15, 30: PRINT "R : RADIUS OF BODY TUBE AT BASE"

1642 LOCATE 15, 75: INPUT R

3000 LET Z1 = S + R

3010 LET Z2 = R / Z1

3020 LET Z3 = Z2 + 1

3030 LET Z4 = S / D

3040 LET Z5 = Z4 * Z4

3050 LET Z6 = Z5 * F

3060 LET Z7 = LF * 2

3070 LET Z8 = CR + CT

3080 LET Z9 = Z7 / Z8

3090 LET Z10 = Z9 * Z9

3100 LET Z11 = Z10 + 1

3110 LET Z12 = SQR(Z11)

3120 LET Z13 = Z12 + 1

3130 LET Z14 = Z6 / Z13

3140 LET CNF = Z3 * Z14

3150 LET Z15 = xr / 3

3160 LET Z16 = CT * 2

3170 LET Z17 = Z16 + CR

3180 LET Z18 = CR + CT

3190 LET Z19 = Z17 / Z18

3200 LET Z20 = Z15 * Z19

3210 LET Z21 = CR * CT

3220 LET Z22 = Z21 / Z18

3230 LET Z23 = Z18 - Z22

3240 LET Z24 = Z23 * .1667

3250 LET Z25 = Z24 + Z20

3260 LET XF = Z25 + XB

3270 LET CNR = CNF + 2

3280 LET Z26 = XN * 2

3290 LET Z27 = CNF * XF

3300 LET Z28 = Z26 + Z27

3310 LET Z29 = Z28 / CNR

4000 GOSUB 500

5000 LOCATE 17, 30: PRINT "CENTRE OF PRESSURE FROM NOSE TIP IS"

5002 LOCATE 17, 70: PRINT Z29

5005 LOCATE 19, 30: PRINT "C OF G MUST BE < OR = TO FROM NOSE TIP"

5006 LET CG = Z29 - D

5007 LOCATE 19, 55: PRINT CG

5010 LOCATE 21, 30: PRINT "FIRST CHECK: Is the center of pressure closer to "

5020 LOCATE 22, 30: PRINT "the tail of the rocket than the center of gravity."

5030 LOCATE 23, 30: PRINT "If NO then it is unstable and you will have to "

5035 LOCATE 24, 30: PRINT "add weight to the nose."

5040 LOCATE 26, 30: PRINT "SECOND CHECK: Is distance between CP and CG greater"

5050 LOCATE 27, 30: PRINT "than at least ONE body tube diameter. If not add "

5060 LOCATE 28, 30: PRINT "weight to the nose untill it is."

5070 CIRCLE (150, ((Z29 / lall) * 460)), 6

5750 CIRCLE (150, ((CG / lall) * 460)), 6

5760 LINE (90, 0)-(0, 0), 10

5780 LINE (90, ((Z29 / lall) * 460))-(0, ((Z29 / lall) * 460)), 10

5095 LINE (90, ((CG / lall) * 460))-(30, ((CG / lall) * 460)), 10

5100 LINE (40, 0)-(40, ((CG / lall) * 460)), 9

5110 LINE (20, 0)-(20, ((Z29 / lall) * 460)), 9

5120 LINE ((150 - 6), ((Z29 / lall) * 460))-((150 + 6), ((Z29 / lall) * 460)), 12

5130 LINE ((150 - 6), ((CG / lall) * 460))-((150 + 6), ((CG / lall) * 460)), 12

5140 LINE (150, (((Z29 / lall) * 460) - 6))-(150, (((Z29 / lall) * 460) + 6)), 12

5150 LINE (150, (((CG / lall) * 460) - 6))-(150, (((CG / lall) * 460) + 6)), 12

5180 LOCATE 12, 5: PRINT ; "CG"

5190 LOCATE 9, 3: PRINT ; "CP"

6000 LOCATE 30, 30:

INPUT "INPUT ANOTHER = 1, QUIT = 2: ", QQ

IF QQ = 2 THEN

GOTO 8000

END IF

IF QQ = 1 THEN

GOTO 100

END IF

GOTO 8000

8000 END

8001 REM DATABASE MODELS

8003 LOCATE 4, 30: PRINT "CHOOSE FROM MODELS BEOLW"

8005 LOCATE 6, 30: PRINT "MINIMUM DIAMETER TEST ROCKET '1x29mm G' =1"

8006 LOCATE 8, 30: PRINT "SILVER 50MM DIAMETER '1x29mm G' ROCKET =2"

8007 LOCATE 10, 30: PRINT "1/3 SCALE PATRIOT ROCKET '4x29MM G' =3"

8008 LOCATE 12, 30: PRINT "5 INCH DIAMETER '1x38mm I211W' =4"

8009 LOCATE 14, 30: PRINT "EXPERIMENTAL WITH REAR FIN SWEEP =5"

8010 LOCATE 16, 30: PRINT "SPARE =6"

8026 LOCATE 4, 75: INPUT MODEL

8027 IF MODEL = 1 THEN GOTO 8120

8028 IF MODEL = 2 THEN GOTO 8220

8029 IF MODEL = 3 THEN GOTO 8320

8030 IF MODEL = 4 THEN GOTO 8420

8031 IF MODEL = 5 THEN GOTO 8520

8032 IF MODEL = 6 THEN GOTO 8620

8119 REM "MINIMUM DIAMETER TEST ROCKET '1x29mm G' =1"

8120 LET T = 1

8121 LET lall = 800

8122 LET NC = 1

8123 LET LN = 100

8124 LET XN = LN * .466

8125 LET F = 12

8126 LET XB = 650

8127 LET D = 33

8128 LET CR = 130

8129 LET xr = 100

8130 LET CT = 0

8131 LET S = 66

8132 LET LF = 90

8133 LET R = 66

8134 GOTO 3000

8219 REM "SILVER 50MM DIAMETER '1x29mm G' ROCKET =2"

8220 LET T = 1

8221 LET lall = 1200

8222 LET NC = 2

8223 LET LN = 150

8224 LET XN = LN * .466

8225 LET F = 12

8226 LET XB = 920

8227 LET D = 50

8228 LET CR = 270

8229 LET xr = 170

8230 LET CT = 90

8231 LET S = 100

8232 LET LF = 120

8233 LET R = 50

8234 GOTO 3000

8319 REM "1/3 SCALE PATRIOT ROCKET '4x29MM G' =3"

8320 LET T = 1

8321 LET lall = 2000

8322 LET NC = 2

8323 LET LN = 300

8324 LET XN = LN * .466

8325 LET F = 16

8326 LET XB = 1700

8327 LET D = 130

8328 LET CR = 300

8329 LET xr = 200

8330 LET CT = 100

8331 LET S = 220

8332 LET LF = 180

8333 LET R = 130

8334 GOTO 3000

8419 REM "5 INCH DIAMETER '1x38mm I211W' =4"

8420 LET T = 1

8421 LET lall = 2200

8422 LET NC = 2

8423 LET LN = 400

8424 LET XN = LN * .466

8425 LET F = 12

8426 LET XB = 1650

8427 LET D = 102

8428 LET CR = 500

8429 LET xr = 300

8430 LET CT = 150

8431 LET S = 200

8432 LET LF = 290

8433 LET R = 102

8434 GOTO 3000

8519 REM "EXPERIMENTAL WITH REAR FIN SWEEP' =5"

8520 LET T = 1

8521 LET lall = 1000

8522 LET NC = 2

8523 LET LN = 200

8524 LET XN = LN * .466

8525 LET F = 12

8526 LET XB = 600

8527 LET D = 100

8528 LET CR = 400

8529 LET xr = 300

8530 LET CT = 200

8531 LET S = 200

8532 LET LF = 250

8533 LET R = 100

8534 GOTO 3000

8619 REM "SPARE =6"

8620 LET T = 1

8621 LET lall = 1000

8622 LET NC = 2

8623 LET LN = 200

8624 LET XN = LN * .466

8625 LET F = 12

8626 LET XB = 600

8627 LET D = 100

8628 LET CR = 400

8629 LET xr = 300

8630 LET CT = 200

8631 LET S = 200

8632 LET LF = 250

8633 LET R = 100

8634 GOTO 3000