You are on page 1of 21

Rocket Science

Steve R. Gunn
Image, Speech and Intelligent Systems Group
Department of Electronics and Computer Science
University of Southampton
August 29, 2001
Version 0.6

Nomenclature
a
A
cm
cp
Cd
d
I
g
l
m
mc
mp
mr

r
t
ta
tb
tc
td
tf
T
v
y
ya
yb

acceleration
cross-sectional area
centre of mass
centre of pressure
drag coefficient
main body diameter
impulse
gravitational acceleration
rocket length
mass
motor casing mass
propellant mass
rocket mass
air density
rocket radius
time
apogee time
burn time
coast time
descent time
flight time
thrust
velocity
altitude
altitude at apogee
altitude at end of burn

m s2
m2
m
m
m
Ns
m s2
m
kg
kg
kg
kg
1.2 kg m3
m
s
s
s
s
s
s
N
m s1
m
m
m

Introduction

Assuming a vertical trajectory and no external wind forces the dynamical problem can be reduced to one
dimension. Applying Newtons second law the dynamics of the rocket satisfy

d2 y
dy dy
m 2 = m g + T k
,
(1)
dt
dt dt

2 Constant Mass and Thrust assumption

where
k=

1
Cd A,
2

(2)

is the density of air (1.2 kg m3 ), Cd is the drag coefficient (about 0.75 for a model rocket), m is the rocket
mass and A is the cross-sectional area of the rocket.

Constant Mass and Thrust assumption

The changing mass of the propellant is approximated by its mean value, and m has the form
m = mr + mc + 12 mp .

(3)

The thrust of the motor, T , is assumed to be constant over the burn time, tb .

2.1

Burn Phase

In the burn phase Equation 1 may be rewritten as,


d2 y
m 2 = m g + T k
dt

dy
dt

2
,

for 0 t tb ,

and when T m g (i.e. the motor is powerful enough to lift the rocket), has general solution
!
r
k T mg
m
log cosh
t C2 .
y = C1 +
k
m
k

(4)

(5)

The boundary conditions of Equation 4 are


y 0 (0) = 0,

y(0) = 0.

(6)

The solution is
y
y0
y 00

!
r
m
T mg
k
=
log cosh
t
k
m
k
!
r
r
T mg
k
T mg
=
tanh
t
k
m
k
!
r


T
k
T mg
2
=
g sech
t
m
m
k

(7)

(8)

(9)

or more simply
y
y0
y 00

1
log cosh ( t)
2

= g 2 tanh ( t)

2
= g 2 sech2 ( t) ,

= g

(10)
(11)
(12)

2 Constant Mass and Thrust assumption

where
p
k (T m g)
=
m
r
kg
=
.
m

2.2

(13)
(14)

Coast Phase

In the coast phase Equation 1 may be rewritten as,


d2 y
m 2 = m g k
dt

dy
dt

2
,

for tb t ta ,

(15)

and has general solution


y = C1 +

r


m
k mg
log cos C2
t .
k
m
k

(16)

The boundary conditions of Equation 15 are


y 0 (tb ) = yb0 ,

y(tb ) = yb ,

for tb t ta .

(17)

The general solution is


r


m
k mg
= C1 +
log cos C2
t
k
m
k
r
r


mg
k mg
=
tan C2
t
k
m
k
r


k mg
2
t .
= g sec C2
k
m

y
y0
y 00

(18)
(19)
(20)

Solving for the boundary conditions,


yb
yb0

r


m
k mg
= C1 +
log cos C2
tb
k
m
k
r
r


mg
k mg
=
tan C2
tb ,
k
m
k

(21)
(22)

gives
s
!
k
gk
1
0
=
tb + tan
yb
mg
m
s
k yb02
m
= yb +
log 1 +
,
k
mg
r

C2

C1

(23)

(24)

and hence the solution is


s

y0
y 00

k yb02

gk
(t tb ) + tan1
m
s
!!
r
r
k
mg
gk
1
0
=
tan
(t tb ) + tan
yb
mg
k
m
s
!!
r
g
k
k
= g sec2
(t tb ) + tan1 yb0
.
m
mg

= yb +

m
log 1 +
cos
k
mg

yb0

!!
k

mg

(25)

(26)

(27)

2 Constant Mass and Thrust assumption

Simplifying,
y

= g

y0

= g

y 00



1

log
cos
(
(t

t
))
cosh
(
t
)
+
sin
(
(t

t
))
sinh
(
t
)
b
b
b
b
2

tanh ( tb ) tan ( (t tb ))



2 1 + tan( (t t )) tanh( t )
b
b

 2

2

2
2 2 + tanh ( tb ) sec ( (t tb ))
= g 2 
2 .

1 + tan ( (t tb )) tanh ( tb )

(28)
(29)

(30)

At apogee y 0 (ta ) = 0, hence


0
ta

= tanh ( tb ) tan ( (ta tb ))




1

= tb + tan1
tanh ( tb ) ,

(31)

= ta tb


1

1
=
tan
tanh ( tb ) .

(33)

(32)

and the coast time is given by


tc

(34)

The altitude at apogee is


ya

ya

ya
ya

2.3

02
k
y
m
b
= yb +
log 1 +
k
mg
v
u
u
m
k T mg
= yb +
log t1 +
tanh2
k
mg
k

(35)
r

!
T mg
tb
k

k
m
v
!
r
u
u
m
k
T mg
m
k T mg

=
log cosh
t +
log t1 +
tanh2
k
m
k
k
mg
k


1
T
2
= g
log
1
+
sinh
(
t
)
b
2 2
mg

(36)

k
m

!
T mg
tb (37)
k
(38)

Descent Phase (Freefall)

In the descent phase Equation 1 may be rewritten as,


d2 y
m 2 = m g + k
dt

dy
dt

2
,

for ta t tf ,

(39)

!
kg
t .
m

(40)

and has general solution


m
y = C1
log cosh C2
k

The boundary conditions of Equation 39 are


y 0 (ta ) = 0,

y(ta ) = ya .

(41)

2 Constant Mass and Thrust assumption

The solution is
!
r
m
kg
= ya
log cosh
(ta t)
k
m
!
r
r
mg
kg
=
tanh
(ta t)
k
m
!
r
kg
2
= g sech
(ta t) ,
m

y
y0
y 00

(42)

(43)

(44)

or more simply
y

= ya g

y0

= g

1
log cosh ( (ta t))
2

1
tanh ( (ta t))

= g sech2 ( (ta t)) .

y 00

(45)
(46)
(47)

The flight time, tf , is given by


1
log cosh ( (ta tf ))
2



1
ya 2
= ta + cosh1 exp
,

g
= ya g

0
tf

(48)
(49)

where we choose the principal range of cosh1 (x) such that cosh1 (x) 0, and the descent time is given by
td

= tf ta

(50)


1
cosh1 exp

ya
g


.

(51)

Substituting,
td

1
cosh1

s
1+

Terminal velocity is given by


yt0 =

T
sinh2 ( tb )
mg

g
.

(52)

(53)

3 Variable Mass and Thrust

Variable Mass and Thrust


m

d2 y
= m g + T k
dt2

Consider m to have the form


m = mr + mp

tb t
tb

dy
dt

2
(54)

(55)

General solution for velocity and acceleration can be recovered in the form of Bessel functions, but the altitude
cannot be written down explicitly due to the integral of the velocity being intractable.

4 Stability

Stability

The stability of a rocket is governed by the centre of mass, cm , and the centre of pressure, cp . Defining the
origin as the nose tip of the rocket, the rocket is stable if cp > cm , (i.e. the centre of pressure is behind the
centre of mass). To calculate cm and cp we consider the axially symmetric part of the rocket, Figure 1, and the
fins separately.

Figure 1: Rocket Cross section

Figure 2 illustrates the case for a stable rocket, where the lift force is denoted by a purple arrow and the drag
force by a red arrow. These forces act about the centre of pressure. It can be seen that the three examples are
stable since the lift forces act to restore the rocket to vertical flight, if it is perturbed. Consequently determining
stability requires the calculation of cm and cp .

Figure 2: Rocket Stability

4.1

Centre of Mass

The centre of mass for an axially symmetric rocket is given by


R 2 R l R R(x)

cm

x %(r, x, ) r dr dx d
0
0 0
R 2 R l R R(x)
%(r, x, ) r dr dx d
0
0 0
R l R R(x)
x %(r, x) r dr dx
0 0
R l R R(x)
%(r, x) r dr dx
0 0

(56)

(57)

where R(x) is the radius of the rocket, and % is the rocket density.
Example 4.1 (Shell).
%(r, x) = %0 (r R(x))

(58)

4 Stability

8
R l R R(x)
cm

x %0 (r R(x)) r dr dx
0 0
R l R R(x)
%0 (r R(x)) r dr dx
0 0
Rl
x R(x) dx
0
Rl
R(x) dx
0

(59)

(60)

Alternatively, it may be more convenient to calculate the centre of mass of the rocket components separately
to find cm ,
cmn mn + cmb mb + cmf mf + cmm mm + cmi mi
cm =
(61)
mn + mb + mf + mm + mi
where here we choose to separate the rocket into its nose, body, fins, motor and internals (recovery system
and/or payload). However, once a rocket has been built it is trivial to find the cm by finding its balance point.
N.B. typically the cm will decrease slightly during flight due to the combustion of the propellant.

4.2

Centre of Pressure

Following the work of Barrowman (?):


For an axially symmetric body of revolution, the subsonic steady state aerodynamic running normal load is
given by

n(x) = v
[S(x) W (x)]
(62)
x
A rigid body has downwash given by
W (x) = v
(63)
Thus
n(x) = v 2

S(x)
x

(64)

The normal force coefficient, CN is defined by


CN (x)

n(x)
v2 A
2 S(x)
A x
8 S(x)
d2 x

1
2

=
=

(65)
(66)
(67)

By the definition of the normal force curve slope


CN (x)

=
=


CN
=0
8 S(x)
d2 x

(68)
(69)

In order to obtain the total CN we integrate over x,


Z
CN

CN (x) dx

(70)

8
(S(l) S(0))
d2

(71)

By definition the pitching moment of the local normal aerodynamic force about the nose tip (x = 0) is
M (x) = xn(x)
S(x)
= x v 2
x

(72)
(73)

4 Stability

By definition the aerodynamic pitching moment coefficient is


M (x)
v2 A d
2 x S(x)
A d x
8 x S(x)
d3 x

Cm (x) =

1
2

=
=

(74)
(75)
(76)

By the definition of the moment coefficient curve slope


Cm (x)

=
=


Cm
=0
8 x S(x)
d3 x

(77)
(78)

In order to obtain the total Cm we integrate over x,


Z
Cm

Cm (x) dx

(79)

=
=

=
=

8
d3

S(x)
dx
x
0
(
)
Z l
8
l
[x S(x)]0
S(x) dx
d3
0
(
)
Z l
8
l S(l)
S(x) dx
d3
0
x

8
{l S(l) V }
d3

(80)
(81)

(82)
(83)

The centre of pressure, cp , is defined as,


cp

Cm
CN
l S(l) V
S(l) S(0)

= d

(84)

(85)

5 Nose Shape

10

Nose Shape

Following the work of ?? we consider the optimal form for the nose shape. Newton reasoned that the air resistance was caused by particles of air hitting the moving object and used the conservation of momentum. In the
following we consider only convex noses which avoids complications due to multiple impacts from air molecules.
(However, there are non-convex local optima that have a single impact form ()). Using the conservation of
momentum,
mv

= ma v (1 + cos(2 ))
= A v t v (1 + cos(2 ))
= 2 A v 2 cos2 () t

(86)
(87)
(88)

Hence,
Fd = m

dv
= 2 A v 2 cos2 ()
dt

(89)

Now consider a curved surface such that the area dA is varying over the surface,
ZZ
Fd =
2 v 2 cos2 () dA
ZZ
= 2 v2
cos2 () dA
ZZ
2
= 2v
cos3 () dS

(90)
(91)
(92)

From Equation 1 and Equation 2 we note that,


Cd

=
=

ZZ
4
cos2 () dA
A
ZZ
4
cos3 () dS
A

(93)
(94)

Noting that
cos() = r
1+

z
x

1
2

z
y

2

(95)

then
Cd

4
A

We define the nose aspect ratio parameter =


radius at the base.

ZZ
1+
h
R,

z
x

1
2

z
y

2 dx dy

(96)

where h is the nose height from tip to base and R is the nose

5 Nose Shape

5.1

11

Radial Nose Cones

Now consider a radially symmetric nose cone of profile z(r), then


Cd

4
A

1+

8
A

8
R2

1+
R

1+

r
 2 dr d

(97)

z
r

r
 2 dr

(98)

r
 2 dr

(99)

z
r

z
r

h
Example 5.1 (Conical Nose). Consider a conical nose z(r) = R
r, then

Cd

4
1 + 2

(100)

In limh0 we obtain the solution for a flat nose, Cd = 4 and in limh we obtain the solution for an infinitely
pointed nose, Cd = 0.
Example 5.2 (Parabolic Nose). Consider a parabolic nose z(r) = Rh2 r2 , then

log 1 + 4 2
Cd =
2

2
Example 5.3 (Ogive Nose). Consider an ogive nose (z + h) + r +
Cd

h2
2R

Cd

2

h2
2R

R
2

2

, then
(102)


z+R 2
R


r 2
R

= 1, then
(103)

= 2

z+h 2
h

Example 5.5 (Elliptical Nose). Consider an elliptical nose


=

R
2

8 1 + 2 2
3 (1 + 2 )2

Example 5.4 (Hemispherical Nose). Consider an hemispherical nose

Cd

(101)


r 2
R

= 1 where h > R, then

1 + (2 log 1) 2

(104)

(1 2 )

(
Example 5.6 (Conical Frustrum Nose). Consider an conical frustrum nose z(r) =

0
h(rR)
(1)R

0 r R
,
R < r R

then
Cd

= 4

( 1)2 + 2 2
( 1)2 + 2

(105)

The optimal [0, 1] that minimises Cd is given by,


opt
Cdopt


p
1 2
= 1+
2 + 4

 2
p
= 2 2 + 2 2 + 4

(106)
(107)

To find the shape with the minimum drag, we can use calculus of variations. The minimiser with respect to

5 Nose Shape

12

y(x) satisfies the Euler Lagrange equation,


2

dz
dr


dz 3
dr

+ r ddrz2 3 r

 2 3
1 + dz
dr

d

dr

d2 z
dr 2

=0

(108)

2 = 0

2
dz

(109)

2r
1+

dz
dr

dr

2r

Letting u =

1+


dz 2
dr

dz
dr

 2
dz 2
dr

= C1

(110)

dz
dr ,

2ru
2

(1 + u2 )
r

=
=

Using the chain rule

dz
du

= C1

2
1 + u2
1
2 C1
u


1
1
3
u + 2u +
2 C1
u

(111)
(112)
(113)

dr
= u du

dz
du



1
d
1
u
u3 + 2u +
2 C1 du
u


Z
1
1
u 3u2 + 2 2 du
2 C1
u
Z
1
1
3u3 + 2u du
2 C1
u

1
3 4
u + u2 log |u| + C2
2 C1 4

Hence the parametric equations with the gradient as the parameter are,


1
1
3
r =
u + 2u +
2 C1
u

1
3 4
z =
u + u2 log |u| + C2
2 C1 4

(114)
(115)
(116)
(117)

(118)
(119)

Applying boundary constraints u(RT ) = 1, z(RT ) = 0


2
RT
RT 7
4 4 

RT
1
3

u + 2u +
4
u

RT 3 4

u + u2 74 log |u|
4
4



3
u2 1 u2 + 73 14 log |u|
RT 16

C1

(120)

C2

(121)

=
=

(122)
(123)
(124)

5 Nose Shape

13

The tip radius, RT , can be found by first solving for the gradient at the base, uR ,
R

2
1 + u2R

7
3
2
2
4 uR (uR 1) uR + 3 uR log |uR |
3 u5R + 4 u4R + 4 u3R + 8 u2R 7 uR + 4 4 uR log |uR | = 0

and then
RT = 4 R

uR
2

(1 + u2R )

(125)
(126)
(127)

(128)

6 Useful Links

Useful Links
Variable Force and Mass: Rocket Liftoff
Petes Rockets
Estes Rockets
NASA Tutorial
Stability Analysis
Aerodynamic Links
Altimeter

14

A Estes Astrocam

Estes Astrocam

Length:
Diameter:
Weight:
Recovery:
Fins:
Maximum Altitude:
Recommended Engines:

18.38 (46.7 cm)


1.34 (34.0 mm)
2.7 oz (76 g)
12 (30 cm) parachute
Plastic molded
500 ft (152 m)
C6-7

Astrocam Altitude

Astrocam Velocity

250

100

B4 Motor
B6 Motor
C6 Motor

B4 Motor
B6 Motor
C6 Motor

200

50

ms1

150

m
100

50

8
s

10

12

14

50

16

(a) Altitude

8
s

(b) Velocity
Astrocam Acceleration

80
B4 Motor
B6 Motor
C6 Motor
60

40

20
ms2

15

20

40

60

8
s

10

12

(c) Acceleration

Figure 3: Astrocam Kinematics

14

16

10

12

14

16

B Estes Bandit

Estes Bandit

Length:
Diameter:
Weight:
Recovery:
Fins:
Maximum Altitude:
Recommended Engines:

16.6 (42.2 cm)


1.0 (25.4 mm)
1.6oz (45 g)
12 (30 cm) parachute
T3 plastic molded
1000 ft (305 m)
A8-3(First Flight), B4-4, B6-4, B6-6, C6-5, C6-7

Bandit Altitude

Bandit Velocity

400

140

A8 Motor
B4 Motor
B6 Motor
C6 Motor

350

A8 Motor
B4 Motor
B6 Motor
C6 Motor

120

100

300
80

250

ms1

60

200

40

20

150

100
20

50
40

10
s

12

14

16

18

20

60

(a) Altitude

10
s

(b) Velocity
Bandit Acceleration

200
A8 Motor
B4 Motor
B6 Motor
C6 Motor

150

100

50
2

ms

16

50

100

150

10
s

12

14

16

(c) Acceleration

Figure 4: Bandit Kinematics

18

20

12

14

16

18

20

C Estes Banshee

Estes Banshee

Length:
Diameter:
Weight:
Recovery:
Fins:
Maximum Altitude:
Recommended Engines:

16.6 (42.2 cm)


1.0 (25.4 mm)
1.6oz (45 g)
12 (30 cm) parachute
T3 plastic molded
1100 ft (335 m)
A8-3(First Flight), B4-4, B6-4, B6-6, C6-5, C6-7

Banshee Altitude

Banshee Velocity

400

140

A8 Motor
B4 Motor
B6 Motor
C6 Motor

350

A8 Motor
B4 Motor
B6 Motor
C6 Motor

120

100

300
80

250

ms1

60

200

40

20

150

100
20

50
40

10
s

12

14

16

18

20

60

(a) Altitude

10
s

(b) Velocity
Banshee Acceleration

200
A8 Motor
B4 Motor
B6 Motor
C6 Motor

150

100

50
2

ms

17

50

100

150

10
s

12

14

16

(c) Acceleration

Figure 5: Banshee Kinematics

18

20

12

14

16

18

20

D Estes Echostar

Estes Echostar

Length:
Diameter:
Weight:
Recovery:
Fins:
Maximum Altitude:
Recommended Engines:

29 (73.7 cm)
1.33 (33.8 mm)
3.6 oz (102.1 g)
18 (46 cm) parachute
Die cut balsa
3074 ft (937 m)
Single Stage Flights: B4-4, B6-4 (First Flight), C6-5
Single Stage Flights with Payload: B4-2 (First Flight), C6-3
Two Stage Flights: C6-0 + B6-6 (First Flight), C6-0 + C6-7

Echostar Altitude

Echostar Velocity

450

120

B4 Motor
B6 Motor
C6 Motor
C6+C6 Motor

400

B4 Motor
B6 Motor
C6 Motor
C6+C6 Motor

100

80

300

60

250

40
ms1

350

m
200

20

150

100

20

50

40

10

15

20

60

25

10

15

(a) Altitude

(b) Velocity
Echostar Acceleration

60
B4 Motor
B6 Motor
C6 Motor
C6+C6 Motor
40

20

ms2

18

20

40

60

10

15

20

(c) Acceleration

Figure 6: Echostar Kinematics

25

20

25

E Estes Engines

19

Estes Engines
Length:
Diameter:
No.
1503
1507
1511
1504
1510

Type
1
2 A3-2T

A3-4T
A10-3T
1
2 A3-4T
A10-0T

Stage
Single
Single
Single
Upper
Booster

I (N s)
1.25
2.50
2.50
1.25
2.50

td (s)
2
4
3
4
0

ml (g)
56.6
56.6
141.5
28.3
141.5

1.73 (4.4 cm)


0.5 (12.7 mm)

Tmax (N)
7.8
7.8
13.3
7.8
13.3

tb (s)
0.36
0.86
0.26
0.36
0.26

me (g)
5.6
7.6
7.9
6.0
6.7

mp (g)
1.75
3.50
3.78
1.75
3.70

Table 2: Estes Blackpowder Mini Motors

Length:
Diameter:

No.
1593
1598
1601
1602
1605
1606
1620
1617
1613
1614
1599
1604
1607
1615
1608
1616

Type
1
2 A6-2

A8-3
B4-2
B4-4
B6-2
B6-4
B8-5
C5-3
C6-3
C6-5
A8-5
B4-6
B6-6
C6-7
B6-0
C6-0

Stage
Single
Single
Single
Single
Single
Single
Single
Single
Single
Single
Upper
Upper
Upper
Upper
Booster
Booster

I (N s)
1.25
2.50
5.00
5.00
5.00
5.00
5.00
10.00
10.00
10.00
2.50
5.00
5.00
10.00
5.00
10.00

td (s)
2
3
2
4
2
4
5
3
3
5
5
6
6
7
0
0

ml (g)
70.8
113.2
113.2
99.1
127.4
113.2
141.5
226.4
113.3
113.2
56.6
42.5
56.6
70.8
113.2
113.3

2.76 (7.0 cm)


0.69 (17.5 mm)

Tmax (N)
12.8
13.3
13.3
13.3
13.3
13.3
22.2
22.2
13.3
13.3
13.3
13.3
13.3
13.3
13.3
13.3

tb (s)
0.20
0.32
1.20
1.20
0.83
0.83
0.60
2.10
1.70
1.70
0.32
1.20
0.83
1.70
0.80
1.68

me (g)
15.0
16.2
19.8
21.0
19.3
20.1
19.3
25.5
24.9
25.8
17.6
22.1
22.1
26.9
16.4
22.7

mp (g)
1.56
3.12
8.33
8.33
6.24
6.24
6.24
12.70
12.48
12.48
3.12
8.33
6.24
12.48
6.24
12.48

Table 3: Estes Blackpowder Motors

Length:
Diameter:

No.
1666
1667
1668
1665
1669

Type
D12-3
D12-5
D12-7
D12-0
D11-P

Stage
Single
Single
Upper
Booster
Plugged

I (N s)
20.00
20.00
20.00
20.00
20.00

td (s)
3
5
7
0
0

ml (g)
396.2
283.0
226.4
396.2
453.1

2.76 (7.0 cm)


0.94 (24.0 mm)

Tmax (N)
28.5
28.5
28.5
28.5
27.6

Table 4: Estes Blackpowder size D Motors

tb (s)
1.70
1.70
1.70
1.70
1.82

me (g)
42.2
43.1
44.0
40.9
44.0

mp (g)
24.93
24.93
24.93
24.93
24.93

F MATLAB Code

20

MATLAB Code

function [a, v, y, t] = rocket(m,d,motor,Cd)


%ROCKET
%
% Usage: [a, v, y, t] = rocket(m,d,motor,Cd)
%
% Parameters: m
- Rocket Mass
%
d
- Rocket Diameter
%
motor - Motor Type (e.g. C6)
%
Cd
- Drag Coefficient (default 0.75)
%
% Author: Steve Gunn (srg@ecs.soton.ac.uk)
if (nargin <3 | nargin>4) % check correct number of arguments
help rocket
else
if (nargin<4) Cd = 0.75;, end
% Motor
mtype =
mTave =
mtb
=
mmc
=
mmp
=
index =

Database
[ A A A
A B B B C C
D D E];
[
3
6
8
10
4
6
8
5
6
6
12
25];
[0.36 0.20 0.32 0.26 1.20 0.83 0.60 2.10 1.70 3.40 1.70 1.70];
[];
[];
intersect(find(str2num(motor(2:length(motor)))==mTave),find(motor(1)==mtype));

% Constants
rho
= 1.2;
g
= 9.81;
ts
= 0.01;
% Formulas
A
= pi*d*d/4;
k
= 0.5*rho*Cd*A;
T
= mTave(index);
tb
= mtb(index);
theta = sqrt(k*(T-m*g))/m;
phi
= sqrt(k*g/m);

% Air Density
% Gravitational Accleration
% Time Step

%
%
%
%

Rocket Cross-sectional Area


Drag Constant
Average Thrust
Burn Time

% Burn Phase
t1
= 0:ts:tb;
yb
= g*(1/phi^2)*log(cosh(theta*t1));
vb
= g*(theta/phi^2)*tanh(theta*t1);
ab
= g*(theta/phi)^2*sech(theta*t1).^2;
% Coast
tc
=
ta
=
t2
=
yc
=
vc
=
ac
ya

Phase
(1/phi)*atan((theta/phi)*tanh(theta*tb));
tb+tc;
tb:ts:ta;
g*(1/phi^2)*log(cos(phi*(t2-tb))*cosh(theta*tb) + (theta/phi)*sin(phi*(t2-tb))*sinh(theta*tb));
g*(theta/phi^2)*(tanh(theta*tb) - (phi/theta)*tan(phi*(t2-tb)))./ ...
(1 + (theta/phi)*tan(phi*(t2-tb))*tanh(theta*tb));
= -g*(theta/phi)^2*((phi/theta)^2 + tanh(theta*tb)^2)*sec(phi*(t2-tb)).^2./ ...
(1 + (theta/phi)*tan(phi*(t2-tb))*tanh(theta*tb)).^2;
= m/(2*k)*log(1 + T/(m*g)*sinh(theta*tb).^2);

% Descent Phase
td
= (1/phi)*acosh(exp(k*ya/m)); % Note Matlab returns positive x for x = acosh(y)
tr
= ta+td;
t3
= ta:ts:tr;
yd
= ya - g*(1/phi^2)*log(cosh(phi*(ta-t3)));
vd
= g*(1/phi)*tanh(phi*(ta-t3));
ad
= -g*sech(phi*(ta-t3)).^2;
% Augment Intervals
t
= [t1 t2 t3];
y
= [yb yc yd];
v
= [vb vc vd];
a
= [ab ac ad];
end

Listing 1: Rocket Kinematics MATLAB Code

F MATLAB Code

21

function plotkinematics(name,mass,diameter,motors,Cd)
%PLOTKINEMATICS
%
% Usage: plotkinematics(name,mass,diameter,motors,Cd)
%
% Parameters: name
- Rocket Name
%
mass
- Rocket Mass
%
diameter - Rocket Diameter
%
motors
- List of Motor Types (e.g. {A8,C6})
%
Cd
- Drag Coefficient (default 0.75)
%
% Author: Steve Gunn (srg@ecs.soton.ac.uk)
if (nargin <4 | nargin>5) % check correct number of arguments
help plotkinematics
else
if (nargin<5) Cd = 0.75;, end
lw = 2;
c = [k r g m b y c];
yf = figure;, hold on
vf = figure;, hold on
af = figure;, hold on
for i=1:length(motors)
[a v y t] = rocket(mass,diameter,char(motors(i)),Cd);
figure(yf), plot(t,y,c(mod(i,length(c))+1),LineWidth,lw)
figure(vf), plot(t,v,c(mod(i,length(c))+1),LineWidth,lw)
figure(af), plot(t,a,c(mod(i,length(c))+1),LineWidth,lw)
end
figure(yf)
eval(legendstring(motors))
title([name Altitude])
xlabel(s), ylabel(m)
eval([print -depsc2 -f name y.eps])
figure(vf)
eval(legendstring(motors))
title([name Velocity])
xlabel(s), ylabel(ms^{-1})
eval([print -depsc2 -f name v.eps])
figure(af)
eval(legendstring(motors))
title([name Acceleration])
xlabel(s), ylabel(ms^{-2})
eval([print -depsc2 -f name a.eps])
end
function s = legendstring(motors)
s = legend(;
sep = ;
for i=1:length(motors)
switch(char(motors(i)))
case D6
s = [s sep C6+C6 Motor];
otherwise
s = [s sep char(motors(i)) Motor];
end
sep = ,;
end
s = [s )];
end

Listing 2: Plot Kinematics MATLAB Code

You might also like