Anda di halaman 1dari 266

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
acceleration
ms

A
cross-sectional area
m

cm

centre of mass
m
c

centre of pressure
m
C

drag coecient

d
main body diameter
m
I
impulse
Ns
g
gravitational acceleration
m s2

l
rocket length
m
m
mass
kg
mc

motor casing mass


kg
mp

propellant mass
kg
mr

rocket mass
kg


air density
3

1.2 kg m

r
rocket radius
m
t
time
s
ta

apogee time
s
tb

burn time
s
tc

coast time
s
t

descent time
s
tf

flight time
s
T
thrust
N
v
velocity
ms

y
altitude
m

ya

altitude at apogee
m

altitude at end of burn


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

d y
= m g + T k
dy

dy

,
(1)

dt

dt

dt

where
1

k=

Cd A,

(2)

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

2 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 +

mp.

(3)
2

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

Burn Phase

In the burn phase Equation 1 may be rewritten as,

d y

,
for
0
t
tb,

= m g + T k
dy

dt

dt

and when T m g (i.e. the motor is powerful enough to lift the rocket), has
general solution

log
cos
h

m
r

C2

T
mg

!.

y = C1 +

The boundary conditions of Equation 4 are

y (
0)
=
0,

y(0
)=
0.

The solution is

log
cos
h
m

mg

mg

r
Tmg

tan
h

k
k

m
T

mg

y00

g sech2

or
mor
e
sim
ply

y
=
g
1

log cosh ( t)

y0

=
g

tanh ( t)

y00

=
g

sec
2

h
(
t) ,

(4)

(5)

(6)

(7)

(10
)

(8)
(11
)
(9)
(12
)
3

2 Constant Mass and Thrust assumption

where
p
k (T m g)

(13)

k g
m .

(14)

Coast Phase

In the coast phase Equation 1 may be rewritten as,

2
2

dt
m

= m g
2

d y

dy

dt

and has general solution

The boundary
conditions of
Equation 15 are

for tb t ta,

k
y = C1 +

(15)

mg

log cos C2

t .

(16)

y(t
)=
y
0

y (t

,
0

)=y
,

k
for

C2

mg

b
b

y =

The general solution is

C1 +

mg
k
mg

log cos

tan
C2

k
mg

y00

g sec

C2

t .

Sol
vin
g
for
the
bou
nda
ry
con
diti
ons
,

mg

tb

yb

C1 +

log cos C2

yb

r
mg

tan C2

r
mg

tb ,

r
gk

gives

C2

!
m

tb +

tan
1

yb

yb
+
mg

1+

log

s
k
02

yb

C1

mg

and hence the solution is

gk

yb +

s1 +
k y02

log

b
cos

(t tb) + tan

!!

mg

gk

y
=
r

tan

mg

(t
tb)
+
tan
1

yb

r
gk

mg

!! .

y00
m

=
g sec

(t
1

tb) + tan

mg

yb

s
!!

y0
k

(23)
(19)

(20)

(24)

(21)

(25)

mg

(17)
(22)
(26)

(18)
(27)

2 Constant Mass and Thrust assumption

Simplifying,

y
=
g
1

log cos ( (t tb)) cosh ( tb) +

sin ( (t tb)) sinh ( tb)

tanh
(
tb)

tan
( (t

tb))

=
g

+
tanh

1 +

tb)

tan( (t tb)) tanh( tb)

sec
( (t

(
2

tb))

y00

=
g

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

At apogee y (ta) = 0, hence

0
=

tanh ( tb) tan ( (ta tb))

ta
=
tb +
1
tan

tanh ( tb) ,

and
the
coa
st
tim
e is
giv
en
by

(30)

(28)

(29)

(31)

(32)

tc =
ta tb

tanh ( tb) .
(33)

=
1
tan

(34)

The altitude at apogee is

y
a

y
a

y
a

k
yb
02

=
yb +

log
1+

mg

(3
5)

=
yb +

m
log

k T

mg

tanh2

tb!

T
mg

(36)

1+mg

tb!

k T
mg

m
log

k
T

m
g
tanh
2

k
T
m
g

(37)

k log cosh

1+

mg

ya = g

log
1+

sinh ( tb)

(38)

mg

Descent Phase (Freefall)


2

d y
In the descent phase Equation 1 may be rewritten as,

dy

= m g + k

y = C1

log cosh
2

dt

dt

and has general solution

The boundary conditions of Equation 39 are

, for
ta t tf ,
m

(39)

t .

C2

r
m

kg

(40)

y (ta) = 0, y(ta) = ya.


(41)

2 Constant Mass and Thrust assumption

The solution is

t)

y
=
ya
m

log cosh

r
kg

(ta

(42)

kg

mg

y0

=
r

tanh

(ta t)

(43)

(ta t) ,

y00

=
2

g sech
r
kg

(44)

or more simply

log cosh ( (ta t))


(45)

ya g

y
=
1

tanh ( (ta t))

(46)

y00

=
2

g sech ( (ta t)) .

(47)

The flight time, tf , is given by

0
=
ya g

log cosh ( (ta tf ))


(48)

y 2

tf

=
ta +

cosh
exp

(49)

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

tf ta

exp

y 2

cosh

s
g

Substituting,

td
=

cosh

1+
T
2

sinh ( tb)

y0

mg

Terminal velocity is given by


.

(50)

(51)

(52)

(53)

3 Variable Mass and Thrust


6

3 Variable Mass and Thrust

dy

k
dy

= m g + T

(54)

dt

dt

Consider m to have the form

tb t

m = mr + mp

(55)

tb

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
7

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

Centre of Mass

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


cm =
2 l R(x)

x %(r, x, ) r dr dx d

R(x)

%(r, x, ) r
dr dx d
0
0

R
0

R0

R0

R
x %(r, x) r dr dx

l R (x)

(56)

=
R0 R0
l

R(x)

%(r, x) r dr dx

(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

l R(x)

% (r
R(x)) r dr dx

cm =
R
0

R0

0R(x)

%0 (r

R(x)) r dr dx

(59)

R0 R
l x R(x) dx

=
R
0
l

R(x) dx

(60)

R
0

Alternatively, it may be more convenient to calculate the centre of mass of the rocket
components separately to find cm,
cm =
c

mn

m +c

+c

mm

mb

+c

+c

mi

mf

(61)

mn
+ mb + m f + m m + m i

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.

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)

A rigid body has downwash given by


W (x) = v

Thus
n(x) = v2

S(x)

The normal force coecient, CN is defined by

CN (x) =
n(x)
=
2
S(
x)

v2

A
x

(63
)

=
8 S(x)

(64
)

(65
)

(66
)
d

(67
)

By the definition of the normal force curve slope

CN

CN (x) =

=0

=
8

8 S(x)

d2 x

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

(S(l
)
S(0
))

Zl

CN (x) dx

d
0

By definition the pitching moment of the local normal aerodynamic force about the nose
tip (x = 0) is
(70
)

(68)

(69)

(71
)

M(x) =
xn(x)

(72)

=
2

x v
S(x)
(73)

4 Stability

2
x
S(
x)

By definition the aerodynamic pitching moment coecient is

Cm(x) =
M(x)

Ad
x

v2

Ad

=
8
x
S(
x)

x
x

dx

By the definition of the moment coecient curve slope

Cm

Cm (x) =

8 x S(x)

=0

d3 x

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

C
Z

=
x

8
l

S(x)

Cm (x) dx

=
=

[x S(x)]0

S(x) dx

S(l)

S(x
)

dx

=
8

{l
S(l)
V
}

The centre of pressure, cp, is defined as,

=
d
C

l
S(l)
V

(74
)
S(l) S(0)
(75
)

(76
)

(77
)

(78
)

(79
)

(80
)

(81
)

(82)

(83)

(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
resis-tance 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 ))

(86)

= A v t v (1 + cos(2 ))
(87)

2 A v cos () t

(88)

Hence,

Fd = m
dv

= 2 A v cos ()

(89)

dt

Now consider a curved surface such that the area dA is varying over the surface,

Fd
=

ZZ
2

2 v cos () dA

(90)

2v

ZZ

cos2() dA

(91)

2v

ZZ

cos3() dS

(92)

From Equation 1 and Equation 2 we note that,

Cd
=
4

ZZ

cos2() dA

(93)

=
4

ZZ

cos3() dS

(94)

Noting that

cos() =

(95)

1+

yz
2

then

xz

Cd =
4

ZZ

dx dy
(96)

1+
z

+
z

We define the nose aspect ratio parameter =


nose radius at the base.

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

5 Nose Shape
11

Radial Nose Cones

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

Cd =

Z0
Z0

dr d

(97)

1+

r
r

dr

(98)

1+

Z0

dr

(99)

R2

1+

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

Cd =

(100)

1+
2

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) =

r , then

+ 4
2

Cd

=
log 12

(101)

Example 5.3
2

(Ogive Nose). Consider an ogive nose (z + h)


+ r+
h

R
2

R
2

, then

2R

2R

Cd
=

1+2

(102)

2 2

3 (1 + )

+R

Example 5.4
(Hemispherical Nose). Consider an hemispherical nose

= 1, then

Cd

=
2

(103)

+h

Example 5.5
(Elliptical Nose). Consider an elliptical nose

= 1 where h > R, then

Cd

= 4
2

1 + (2 log 1)

2 2

(1 )

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

( 1) +
2 2


h(r R)

)R

then

(104)

0 r R R
<rR

( 1) +

(1

= 4
(105)
The optimal [0, 1] that minimises Cd is given by,

opt

=
1+

+4

(106)

dopt

=
2

2+
2

(107)

2 + 4

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

5 Nose Shape

y(x) satisfies the Euler Lagrange equation,

d z

dz

+
dz
3

d z dz

1+
dzdr
2 3

dr

dr

+r

dr2

=0
3r

dr2

dr

2r

dz

dr

=0

dr

1+
dz

dr

dz

2r

dr

= C1

Letti
ng u
=
,

dz

1+

dzdr

2 2

dr

2ru

= C1

(1 +
2 2

u )

1+
u

1
r
=

2 C1

u3 +
2u +

2 C1

Using the chain rule


=u

dr

dz

du
du

dz

du

2 C1

du

z =

1
u

u3 + 2u +

u 3u2 + 2

1
du

2 C1

2 C1

z =

3u3 + 2u

du
3
4

+u
log
|u| +
C2

u3

r =

2 C1

+ 2u
+
Hence the parametric equations with the gradient as the parameter are,

2 C1

2 C1

z
=

Appl
ying
bou
ndar
y
cons
train
ts

u + u log |u| + C2

u(RT
)=
1,
z(RT
)=0

C1
=

C2
=

RT 7

u3 + 2u +
1

r =

+u

log u
|1

RT

z =
4
34

42

=
RT

1 u+
3

4 log |u|

16

12

(114)

(115)

(116)
(108)
(117)

(109)

(118)
(110)
(119)

(111)

(120)

(121)
(112)
(122)
(113)
(123)

(124)

5 Nose Shape

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

1)

2
7

uR
log |
uR|

1 + uR

R (uR

uR +

3 uR
h

+ 4 uR4 +

4 uR

3
2

+ 8 uR 7 uR + 4 4 uR log |uR| = 0
(1 +

and then

2 2

u )

RT = 4 R
uR

13

(126)

(127)

(125)

(128)

6 Useful Links
14

Useful Links

Variable Force and Mass: Rocket Lifto

Petes Rockets

Estes Rockets

NASA Tutorial

Stability Analysis

Aerodynamic Links

Altimeter

A Estes Astrocam
15

Estes Astrocam

Length:
18.38 (46.7 cm)
Diameter:
1.34 (34.0 mm)
Weight:
2.7 oz (76 g)
Recovery:
12 (30 cm) parachute
Fins:
Plastic molded
Maximum Altitude:
500 ft (152 m)
Recommended Engines:
C6-7

Astrocam Altitude

Astrocam Velocity

250

100

B4 Motor

B4 Motor

B6 Motor

B6 Motor

C6 Motor

C6 Motor

200

50

150

ms

100

50

10

12

14

16

50

10

12

14

16

(a) Altitude

(b) Velocity

Astrocam Acceleration

80

B4 Motor

B6 Motor

C6 Motor

60

40

20

ms

20

40

60

10

12

14

16

(c) Acceleration

Figure 3: Astrocam Kinematics

B Estes Bandit
16

Estes Bandit

Length:
16.6 (42.2 cm)
Diameter:
1.0 (25.4 mm)
Weight:
1.6oz (45 g)
Recovery:
12 (30 cm) parachute
Fins:
T3 plastic molded
Maximum Altitude:
1000 ft (305 m)
Recommended Engines:
A8-3(First Flight), B4-4, B6-4, B6-6, C6-5, C6-7

Bandit Velocity

400

Ba
nd
it
Alt
itu
de

A8 Motor

14
0

A8
M
ot
or

B4
M
ot
or

350

B4
M
ot
or

120

B6
M
ot
or

B6 Motor

100

C
6
M
ot
or

300

C6
M
ot
or

250

60

80

40

200

m
s

150

20

100

20

50

40

10

12

14

16

18

20

60

10

12

14

16

18

20

(a) Altitude
(b) Velocity

Bandit Acceleration

200

A8 Motor

B4 Motor

B6 Motor

150

C6 Motor

100

50

ms

50

100

150

10

12

14

16

18

20

(c) Acceleration

Figure 4: Bandit Kinematics

C Estes Banshee
17

Estes Banshee

Length:
16.6 (42.2 cm)
Diameter:
1.0 (25.4 mm)
Weight:
1.6oz (45 g)
Recovery:
12 (30 cm) parachute
Fins:
T3 plastic molded
Maximum Altitude:
1100 ft (335 m)
Recommended Engines:
A8-3(First Flight), B4-4, B6-4, B6-6, C6-5, C6-7

Banshee Velocity

400

Ba
ns
he
e
Alt
itu
de

A8 Motor

14
0

B4 Motor

A8
M
ot
or

350

B4
M
ot
or

120

B6
M
ot
or

C6 Motor

B6
M
ot
or

100

C
6
M
ot
or

300

80

250

60

200

40

m
s

150

20

100

20

50

4
0

10

12

14

16

18

20

60

10

12

14

16

18

20

(a) Altitude
(b) Velocity

Banshee Acceleration

200

A8 Motor

B4 Motor

B6 Motor

150

C6 Motor

100

50

ms

50

100

150

10

12

14

16

18

20

(c) Acceleration

Figure 5: Banshee Kinematics

D Estes Echostar
18

Estes Echostar

Length: 29 (73.7 cm)

Diameter:

1.33 (33.8 mm)

Weight: 3.6 oz (102.1 g)

Recovery:

Fins:

18 (46 cm) parachute

Die cut balsa

Maximum Altitude:

3074 ft (937 m)

Recommended Engines: 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

B4 Motor

B6 Motor

B6 Motor

400

C6 Motor

100

C6 Motor

C6+C6 Motor

C6+C6 Motor

350

80

300

60

250

40

ms

200

20

150

100

20

50

40

10

15

20

25

60

10

15

20

25

(a) Altitude (b) Velocity

ms2

Echostar Acceleration

60

20

B4
Motor
0

B6
Motor

C6
Motor

20

40

C6+C
6
Motor

60

0 5 10 15 20 25

40

(c) Acceleration

Figure 6: Echostar Kinematics

E Estes Engines
19

Estes Engines

Length:

1.73 (4.4 cm)

Diameter:
0.5 (12.7 mm)

No.
Type
Stage
I (N s)
td (s)
ml (g)

Tmax (N)
tb (s)
me (g)
mp (g)

1503
1

A3-2T

Single
1.25
2
56.6

7.8
0.36
5.6
1.75

1507
2

Single
2.50
4
56.6

7.8
0.86
7.6
3.50

A3-4T

1511
A10-3T
Single
2.50
3
141.5

13.3
0.26
7.9
3.78

1504
2

A3-4T

Upper
1.25
4
28.3

7.8
0.36
6.0
1.75

1510
A10-0T
Booster
2.50
0
141.5

13.3
0.26
6.7
3.70

Table 2: Estes Blackpowder Mini Motors

Length:

2.76 (7.0 cm)

Diameter:
0.69 (17.5 mm)

No.
Type
Stage
I (N s)

td (s)
ml (g)
Tmax (N)

tb (s)
me (g)
mp (g)

1593
1

A6-2

Single
1.25
2
70.8

12.8

0.20
15.0
1.56

1598
2

Single

2.50
3
113.2

13.3

0.32
16.2
3.12

A8-3

1601
B4-2
Single

5.00
2
113.2

13.3

1.20
19.8
8.33

1602
B4-4
Single
5.00
4
99.1

13.3

1.20
21.0
8.33

1605
B6-2
Single

5.00
2
127.4

13.3

0.83
19.3
6.24

1606
B6-4
Single
5.00
4
113.2

13.3

0.83
20.1
6.24

1620
B8-5
Single

5.00
5
141.5

22.2

0.60
19.3
6.24

1617
C5-3
Single
10.00
3
226.4

22.2

2.10
25.5
12.70

1613
C6-3
Single

10.00
3
113.3

13.3

1.70
24.9
12.48

1614
C6-5
Single
10.00
5
113.2

13.3

1.70
25.8
12.48

1599
A8-5
Upper

2.50
5
56.6

13.3

0.32
17.6
3.12

1604
B4-6
Upper
5.00
6
42.5

13.3

1.20
22.1
8.33

1607
B6-6
Upper

5.00
6
56.6

13.3

0.83
22.1
6.24

1615
C6-7
Upper
10.00
7
70.8

13.3

1.70
26.9
12.48

1608
B6-0
Booster

5.00
0
113.2

13.3

0.80
16.4
6.24

1616
C6-0
Booster
10.00
0
113.3

13.3

1.68
22.7
12.48

Table 3: Estes Blackpowder Motors

Length:

2.76 (7.0 cm)

Diameter:
0.94 (24.0 mm)

No.
Type
Stage
I (N s)
td (s)
ml (g)
Tmax (N)

tb (s)
me (g)
mp (g)

1666
D12-3
Single
20.00
3
396.2

28.5

1.70
42.2
24.93

1667
D12-5
Single
20.00
5
283.0

28.5

1.70
43.1
24.93

1668
D12-7
Upper
20.00
7
226.4

28.5

1.70
44.0
24.93

1665
D12-0
Booster
20.00
0
396.2

28.5

1.70
40.9
24.93

1669
D11-P
Plugged
20.00
0
453.1

27.6

1.82
44.0
24.93

Table 4: Estes Blackpowder size D Motors

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 Database

mtype = [ A
A
A
A
B
B
B
C
C
D
D
E];
mTave
=[
3
6
8
10
4
6
8
5
6
6
12
25];

mtb
= [0.36 0.20 0.32
0.26 1.20 0.83 0.60 2.10 1.70
3.40 1.70 1.70];
mmc
= [];

mmp
= [];

index = intersect(find(str2num(motor(2:length(motor)))==mTave),find(motor(1)==mtype));
% Constants

rho
= 1.2;

% Air Density

g
= 9.81;

% Gravitational Accleration

ts
= 0.01;

% Time Step

% Formulas

A
= pi*d*d/4;

% Rocket Cross-sectional Area

k
= 0.5*rho*Cd*A;
% Drag Constant

T
= mTave(index);
% Average Thrust

tb
= mtb(index);

% Burn Time

theta
= sqrt(k*(T-m*g))/m;

phi
= sqrt(k*g/m);

% 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 Phase

tc
= (1/phi)*atan((theta/phi)*tanh(theta*tb));

ta
= tb+tc;

t2
= tb:ts:ta;

yc
= g*(1/phi^2)*log(cos(phi*(t2-tb))*cosh(theta*tb) + (theta/phi)*sin(phi*(t2-tb))*sinh(theta*tb));
vc
= g*(theta/phi^2)*(tanh(theta*tb) - (phi/theta)*tan(phi*(t2-tb)))./ ...

(1 + (theta/phi)*tan(phi*(t2-tb))*tanh(theta*tb));

ac
= -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;

ya
= 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

Anda mungkin juga menyukai