Article 6648 of rec.models.rockets:
Path: murdoch!uvaarpa!darwin.sura.net!newsserver.jvnc.net!howland.reston.ans.net!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!sequent!muncher.sequent.com!coryc
From: coryc@sequent.com (Cory Carpenter)
Newsgroups: rec.models.rockets
Subject: SHOCK.BAS source code for SHOCK.EXE (QuickBasic 4.5 ASCII source)
Message-ID: <1993Feb19.080233.9405@sequent.com>
Date: 19 Feb 93 08:02:33 GMT
Article-I.D.: sequent.1993Feb19.080233.9405
Sender: usenet@sequent.com (usenet )
Organization: Sequent Computer Systems, Inc.
Lines: 97
Nntp-Posting-Host: crg8.sequent.com

'============================================================================
' Shock cord design program (for connecting parachute to rocket).
'============================================================================
'
'This is a public domain program which you are encouraged to copy and give
'to your friends. A complete rocket design program which takes into account
'real, commercially available engines and real aerodynamic drag is available
'from:
'
' Cambridge Group
' 1921 N Gaffey #D
' San Pedro
' CA 90731
' (310) 832 8836
'
' The program allows you to design your own engines and handles supersonic
' flight.
'
'===========================================================================
'
'SHOCK CORD DESIGN
'
' Given the rocket mass and the rocket velocity, calculate the length
' and maximum load of a suitable shock cord.
'
' Print header page
CLS
PRINT "Another public domain shareware program by:-"
LOCATE 5, 32
PRINT "CAMBRIDGE GROUP"
LOCATE 7, 16
PRINT "AUTHOR OF CAMBRIDGE GROUP ROCKET DESIGN PROGRAM"
LOCATE 8, 10
PRINT "All you need to predict rocket performance - high altitude, low"
LOCATE 9, 10
PRINT "altitude, multi stage, supersonic - you name it."
LOCATE 11, 10
PRINT "We provide source code in Quick Basic - easily moved to another machine"
LOCATE 15, 10
PRINT "1921 N Gaffey #D"
LOCATE 16, 10
PRINT "San Pedro"
LOCATE 17, 10
PRINT "CA 90731"
LOCATE 25, 1
PRINT "Hit any key to continue";
DO
LOOP WHILE INKEY$ = ""
'
' Start shock cord design program
'
g = 9.81
CLS
PRINT SPACE$(27); "SHOCK CORD DESIGN PROGRAM"
PRINT
PRINT "You need to do a simple test on your shock cord. Measure a length of shock"
PRINT "cord, then tie a weight to it. The weight should be enough to give about 50%"
PRINT "stretch. Measure the weight and the stretched length."
PRINT "Next, enter the weight and speed of the rocket and check the maximum force and"
PRINT "extension of the shock cord. Be sure that the parachute and shock cord can "
PRINT "withstand the force involved. If not, try a longer shock cord."
PRINT
INPUT "Unstretched length (inch), stretched length (inch)", l1, l2
INPUT "Weight (lbs)", wt
'Convert to kg
wt = wt * .4536
'Calculate spring constant
k = (l1 * wt * g) / (l2 - l1)
PRINT "Spring Constant = "; k; "Newton"
Start:
PRINT
INPUT "Velocity (ft/sec), Weight of rocket (lbs)"; v, m
INPUT "Length of shock cord (inches)"; l
'Convert to kilograms and meters/sec
m = m * .4536
v = v * .3048
l = l * .0254
'Calculate maximum extension using stored energy method.
a = k / (2 * l)
b = -m * g
c = -m * v * v * .5
'Solve quadratic equatuin to find extension x.
x = (-b + SQR(b * b - 4 * a * c)) / (2 * a)
'Calculate maximum force
f = (k * x) / l
'Calculate percentage extension
Pc = 100 * x / l
PRINT "Maximum Force = "; f * .22046; "pounds"
PRINT "Stretched Length = "; ((x + l) / .0254); "inches"
PRINT USING "Percentage Extension = #### %"; Pc
GOTO Start

-- 
|     >> Disclaimer: I speak for Sequent only in our hardware manuals <<     |
| Cory R. Carpenter, Tech Writer | "Never trust ale from a god-fearing       |
| Sequent Computer Systems, Inc. |  people..."                               |
|  coryc@sequent.com             |        --Quark, Deep Space Nine           |


