Você está na página 1de 16

Modeling and Analysis Lab

Session 2: Simulating a Cannonball


Sandeep Prasad Shaw (SC17B039)
Sourabh Pandrey (SC17B048)
August 16, 2019

Instructor: Prof. Kurien Issac

1 Aim
To simulate the flight of a cannonball through atmosphere.

2 Cannonball in Vacuum
Cannonball motion can be taken as projectile motion. In order to simulate vac-
uum conditions, the only force considered while solving the equations of motion
is the uniform gravitational field of Earth.
The effect of atmosphere has been neglected. Also, the gravitational effect of
other heavenly bodies is neglected.

ẍ = 0 (1)
ÿ = −g (2)
Since there is only acceleration in the vertical direction, the velocity in the hor-
izontal direction is constant and the vertical motion of the cannonball is the
motion of a particle during its free fall.
Now, if the initial velocity,

v0 = vx0 x̂ + vy0 ŷ (3)


In a uniform gravitational field, we know that it traces a parabolic trajectory.
Solving (1) and (2) with initial condition (3),

x = v0 tcos(θ) (4)
1
y = v0 tsin(θ) − gt2 (5)
2

1
Figure 1: Height vs Horizontal distance for Flight in Vacuum

where, θ = tan−1 ( ẋẏ )


The time of flight is hence given by,
2 ∗ vy0
T = (6)
g
Substituting in (4), the range can be found out,
2 ∗ vx0 ∗ vy0
R= (7)
g
From (7) it is known that max. range in achieved with θ = 45◦ . In that case,
the initial velocity required can be calculated to be, v0 = 442.85m/s.
The trajectory of cannonball in vacuum was simulated and results were com-
pared. The Numerical solution obtained was fairly accurate compared to the
Analytical solution.

3 Cannonball in Atmosphere
In Earth’s Atmosphere, aerodynamic forces will act on the cannon (mainly drag,
if the cannon is not spinning, acting opposite to the velocity of ball’s center).
Hence, we have the equations of motion as,

2
Figure 2: Free body diagram of cannon in atmospheric flight (made using
draw.io)


mẍ = −D = −D cos γ (8)
v

mÿ = −D − mg = −D sin γ − mg (9)
v
where, v = ẋ2 + ẏ 2 is the net velocity and γ = tan−1 ( ẋẏ ) is the flight path
p
2

angle at any given instant.

Drag is given by,


1 2
D= ρv ∗ CD ∗ S (10)
2
where, ρ = density of medium
CD = drag coefficient
S = πr2 is the projected area of the sphere(cannon)
The Drag model used here is based on the data acquired through experimental
sources.

CD = c1 M 3 R3 + c2 M 3 R2 + c3 M 3 R + c4 M 3 + c5 M 2 R3
+c6 M 2 R2 + c7 M 2 R + c8 M 2 + c9 M R3 + c10 M R2
+c11 M R + c12 M + c13 R3 + c14 R2 + c15 R + c16
where, R = log Re
The Reynold’s no. (Re ) is given by, ρvd
µ ,
and the Mach. no. (M) is given by, M = av = √ 2
v
γRT
where, γ(heatcapacityf orair) = 1.4 and R(specif icgasconstantf orair) = 287J/kg/K
Dynamic viscosity µ of atmosphere is obtained by Sutherland’s formula as,
1.5
µ = βT
T +C

3
where, T = absolute temperature, β = 1.458 ∗ 10−6 andC = 110.4. Variations
of T,p,ρ with altitude are considered for standard atmosphere.
The values of coefficients c1 toc16 are given by,

coefficients = [ 0.0000641 -0.0006166 -0.0075524 0.1175224


-0.0009032 0.0136069 0.0086353 -1.0093621
0.0041238 -0.0858483 0.4289429 1.5431515
-0.0064570 0.1778755 -1.5559375 4.0394577 ]
Observational Plots
The trajectory of cannonball for vacuum condition is plotted. The parameters
of launch velocity and launch angle were chosen to get a range of 20 km (as
calculated earlier). With the same launch velocity and launch angle, we see
that there is drastic decrease in range, if atmospheric model is considered (5.72
km with atmosphere, almost a quarter of the range in vacuum, refer fig.3).
From the variation of Drag Coefficient plot (refer fig.8), we can say that the
ball travels through the air the the CD value drops steadily up to a point and
then increases slightly. This is due to the fact that Drag force decreases with
velocity (refer Eqn. 10) and at the point of maximum ascent the drag acting
on the ball is minimum as most of the velocity is already dissipated while doing
work against drag during the initial stages of flight. This is clearly evident in
figures (5) and (9)
The energy dissipation due to drag overwhelms the kinetic as well as poten-
tial energies due to higher speeds at lower altitudes. By the time it reaches
higher altitudes, where density is low, most of it’s horizontal velocity is already
scrubbed off. This is one of the major limitations of any ballistic projectile,
when there’s no mode of thrust once it’s at higher altitudes, where there is less
drag. The total energy (accounted for dissipated energy) is found to be more
or less constant throughout the flight, while the Kinetic and potential energy is
inter-converted as expected (refer fig.9)

Reaching 20 km Range
On increasing the initial velocity, the cannonball can be made to go greater
ranges. But building such high power cannons is not practically feasible. Hence,
for this problem, initial velocity was taken to be 550 m/s (not much larger than
443 m/s used for vacuum problem).
Given this initial velocity and angle close to 45◦ , getting a horizontal range of
20 kms required a cannonball of mass 5 tonnes ( m=5000 kg ) and radius of 775
mm (given the density of steel).
This gave us a horizontal range of 19,915 m.
For finding the sensitivity of this range with variations in initial launch angle,
the ode solver was put in a loop with initial angle varying from 35◦ to 50◦ .

As seen in figure 12, it can be seen that even in atmosphere, highest range is
achieved from an initial angle of 45◦ . Also, the range drastically decreases at
greater angles beyond 45◦ , not so much if angle is less than 45◦ .

4
Figure 3: Height vs Horizontal distance

Figure 4: Height vs Flight Time

5
Figure 5: Mach no. variation throughout the flight

Figure 6: Reynold’s no. variation throughout the flight

6
Figure 7: Variation of Drag throughout the flight

Figure 8: Drag coefficient variation throughout the flight

7
Figure 9: Kinetic, Potential, Dissipated and Total energy throughout the flight

Figure 10: Trajectory for launch angles close to 45◦ with 20 km range (approx.)

8
Figure 11: Figure zoomed to show difference in ranges

Figure 12: Variation of Max. horizontal range with initial launch angles

9
Now, getting a 5 ton cannonball to launch at an initial launch velocity of 550
m/s will need an initial impulse of 2,750,000 kg m/s is practically impossible.
Initial Mach no. is 1.62 which will have compressibility effects which is not
modelled in this analysis.
If the mass of the cannonball is to be decreased to say, 40 kgs, then initial ve-
locity required will go beyond 5 km/s. At such speeds at low atmosphere would
cause tremendous heating and the cannonball would most likely be ripped off
due to aerodynamic forces.
Also, a artillery gun of 1550 mm caliber is almost twice of the largest ever built
(800mm for Schwerer Gustav used in WW2 by Nazi Germany).
Hence, using a cannonball to large ranges is not feasible as it is a blunt body,
hence experiences high drag, and is unpowered. To reach larger distances, shells
with aerodynamic shapes may be used or a missile with powered flight is pre-
ferred.

4 Appendix
4.1 Scilab code for Atmospheric & Vacuum flight

f u n c t i o n dens=rho ( z ) // i n t e r p o l a t i o n f o r d e n s i t y
dens=i n t e r p 1 ( atmsphr ’ ( 1 , : ) ∗ 1 0 0 0 , atmsphr ’ ( 4 , : ) , z ( 3 ) , ’ s p l i n e ’ ) ;
endfunction

f u n c t i o n tmp=T( z ) // i n t e r p o l a t i o n f o r t e m p e r a t u r e
tmp=i n t e r p 1 ( atmsphr ’ ( 1 , : ) ∗ 1 0 0 0 , atmsphr ’ ( 2 , : ) , z ( 3 ) , ’ s p l i n e ’ ) ;
endfunction

f u n c t i o n reyn=Re ( z ) // c a l c u l a t i n g Reynold ’ s no .
v=s q r t ( z ( 2 ) ˆ 2 + z ( 4 ) ˆ 2 ) ;
reyn =(rho ( z ) ∗ v ∗2∗ r ) /mu( z ) ;
endfunction

f u n c t i o n mach=Ma( z ) // c a l c u l a t i n g Mach no .
v=s q r t ( z ( 2 ) ˆ 2 + z ( 4 ) ˆ 2 ) ;
mach=v/ s q r t ( 1 . 4 ∗ 2 8 7 ∗T( z ) ) ;
endfunction

f u n c t i o n v i s c=mu( z ) // c a l c u l a t i n g Dynamic V i s c o s i t y
b e t a =1.458 e −6;
C= 1 1 0 . 4 ;
v i s c =( b e t a ∗ (T( z ) ) ˆ 1 . 5 ) / (T( z)+C ) ;
endfunction

f u n c t i o n c d r a g=Cd( z ) // c a l c u l a t i n g Drag C o e f f i c i e n t

10
R=l o g ( Re ( z ) ) ;
M=Ma( z ) ;
c f s = [ 0 . 0 0 0 0 6 4 1 −0.0006166 −0.0075524 0 . 1 1 7 5 2 2 4 −0.0009032 0 . 0 1 3 6 0 6 9 0 . 0 0 8 6 3 5 3
mr=[(M. ˆ 3 ) . ∗ ( R. ˆ 3 ) (M. ˆ 3 ) . ∗ ( R. ˆ 2 ) (M. ˆ 3 ) . ∗ ( R) (M. ˆ 3 ) (M. ˆ 2 ) . ∗ ( R. ˆ 3 ) (M. ˆ 2 ) . ∗
c f s=c f s ’ ;
c d r a g=mr∗ c f s ;
endfunction

g l o b a l m r g atmsphr S
m=40; // mass
r =0.155; // r a d i u s
S=(%p i ) ∗ r ∗ r ; // p r o j e c t e d a r e a
g =9.8065; // a c c e l a r a t i o n due t o g r a v i t y
v0 = 4 4 2 . 8 5 ; // i n i t i a l l a u n c h v e l o c i t y
th0 =45∗(% p i ) / 1 8 0 ; // i n i t i a l l a u n c h a n g l e
vx0=v0 ∗ c o s ( th0 ) ; // i n i t i a l h o r i z o n t a l v e l o c i t y
vy0=v0 ∗ s i n ( th0 ) ; // i n i t i a l v e r t i c a l v e l o c i t y
z0 =[0 vx0 0 vy0 ] ’ ; // i n i t i a l z0
t f =2∗vy0 / g ; // f l i g h t time i n vacuum
t =[0:.1: tf ] ;

f u n c t i o n dz=v a c f ( t , z ) // c a l c u l a t i n g t r a j e c t o r y i n vacuum
dz (1)= z ( 2 ) ;
dz ( 2 ) = 0 ;
dz (3)= z ( 4 ) ;
dz(4)=−g ;
i f z (3) <0 then
dz ( 1 ) = 0 ;
dz ( 2 ) = 0 ;
dz ( 3 ) = 0 ;
dz ( 4 ) = 0 ;
end
endfunction

f u n c t i o n dz=atmf ( t , z ) // c a l c u l a t i n g t r a j e c t o r y i n atmosphere
th=atan ( z ( 2 ) / z ( 4 ) ) ; // f l i g h t path a n g l e
v=s q r t ( z (2)ˆ2+ z ( 4 ) ˆ 2 ) ; // i n s t a n t a n o u s v e l o c i t y
dz (1)= z ( 2 ) ;
dz (3)= z ( 4 ) ;
D=0.5∗ rho ( z ) ∗ ( v ˆ 2 ) ∗Cd( z ) ∗ S ; // i n s t i a n t e n o u s drag
dz(2)=−D∗ c o s ( th ) /m;
dz(4)=−g−D∗ s i n ( th ) /m;
i f z (3) <0 then // cannon has h i t t h e ground
dz ( 1 ) = 0 ;
dz ( 2 ) = 0 ;
dz ( 3 ) = 0 ;

11
dz ( 4 ) = 0 ;
end
endfunction

z1=ode ( z0 , 0 , t , 0 . 1 , 0 . 1 , v a c f ) ;
z2=ode ( z0 , 0 , t , 0 . 1 , 0 . 1 , atmf ) ;

figure (1)
p l o t ( z1 ( 1 , : ) / 1 0 0 0 , z1 ( 3 , : ) / 1 0 0 0 , z2 ( 1 , : ) / 1 0 0 0 , z2 ( 3 , : ) / 1 0 0 0 ) ;
l e g e n d ( ” F l i g h t i n Vaccum ” , ” Atmospheric F l i g h t ” ) ;
x l a b e l ( ’ Range (km ) ’ ) ;
y l a b e l ( ’ A l t i t u d e (km ) ’ ) ;

figure (2)
p l o t ( t , z1 ( 3 , : ) / 1 0 0 0 , t , z2 ( 3 , : ) / 1 0 0 0 ) ;
l e g e n d ( ” F l i g h t i n Vaccum ” , ” Atmospheric F l i g h t ” ) ;
x l a b e l ( ’ F l i g h t Time ’ ) ;
y l a b e l ( ’ A l t i t u d e (km ) ’ ) ;

KE=0.5∗m∗ ( z2 ( 2 , : ) . ˆ 2 + z2 ( 4 , : ) . ˆ 2 ) ; // K i n e t i c e n e r g y
PE=m∗ g∗ z2 ( 3 , : ) ; // P o t e n t i a l e n g e r g y

f o r i =1: l e n g t h ( t )
RE( 1 , i )=Re ( z2 ( : , i ) ) ;
MA( 1 , i )=Ma( z2 ( : , i ) ) ;
CD( 1 , i )=Cd( z2 ( : , i ) ) ;
D( 1 , i )=CD( 1 , i ) ∗ 0 . 5 ∗ rho ( z2 ( : , i ) ) ∗ ( z2 ( 2 , i ) ˆ 2 + z2 ( 4 , i ) ˆ 2 ) ∗ S ;
i f i==1 then
DE( 1 , i )=0;
end
i f i >1 then
DE( 1 , i )=DE( 1 , i −1)+D( 1 , i ) ∗ s q r t ( ( z2 ( 1 , i )−z2 ( 1 , i −1))ˆ2 + ( z2 ( 3 , i )−z2 ( 3 , i − 1 ) ) ˆ 2 )
// D i s s i p a t e d e n e r g y
end
end

TE=KE+PE+DE; // T o t a l e n e r g y

figure (3)
p l o t ( t ,RE ) ;
x l a b e l ( ’ Range (km ) ’ ) ;
y l a b e l ( ’ Reynolds no . ’ ) ;

figure (4)
p l o t ( t ,D) ;

12
x l a b e l ( ’ F l i g h t Time ’ ) ;
y l a b e l ( ’ Drag ’ ) ;

figure (5)
p l o t ( t ,CD) ;
x l a b e l ( ’ F l i g h t Time ’ ) ;
y l a b e l ( ’ Drag C o e f f i c i e n t ’ ) ;

figure (6)
p l o t ( t ,MA) ;
x l a b e l ( ’ F l i g h t Time ’ ) ;
y l a b e l ( ’ Mach No . ’ ) ;

figure (7)
p l o t ( t ,KE, t , PE, t , DE, t ,TE ) ;
l e g e n d ( ” K i n e t i c Energy ” , ” P o t e n t i a l Energy ” , ” D i s s i p a t e d Energy ” , ” T o t a l e n e r g y ” )
x l a b e l ( ’ F l i g h t Time ’ ) ;
y l a b e l ( ’ Energy ’ ) ;
4.2 Scilab code for Vacuum flight

f u n c t i o n dx=f 1 ( t , x )
dx=[x ( 2 ) ; 0 ] ;
endfunction
f u n c t i o n dy=f 2 ( t , y )
g =9.8066;
dy=[y (2); − g ] ;
endfunction

u=443;
th =45∗(% p i ) / 1 8 0 ;
ux=u∗ c o s ( th ) ;
uy=u∗ s i n ( th ) ;
g =9.8066;
t 0 =0;
t f =2∗uy/ g ;
t =[ t 0 : 1 : t f ] ;

x=ode ( [ 0 ; ux ] , t0 , t , 0 . 0 1 , 0 . 1 , f 1 ) ;
figure (1);
plot ( t , x (1 ,:) , t , x ( 2 , : ) ) ;
legend (” x ” ,” x v e l ” ) ;
X=ux∗ t ;

y=ode ( [ 0 ; uy ] , t0 , t , 0 . 1 , 0 . 1 , f 2 ) ;
figure (2);

13
plot ( t , y (1 ,:) , t , y ( 2 , : ) ) ;
legend (” y ” ,” y v e l ” ) ;
Y=−g ∗ ( t .ˆ2)/2+ uy∗ t ;

figure (3);
p l o t ( x ( 1 , : ) , y ( 1 , : ) , X,Y ) ;
l e g e n d ( ” Numerical S o l u t i o n ” , ” A n a l y t i c a l S o l u t i o n ” ) ;
x l a b e l ( ” Range (m) ” ) ;
y l a b e l ( ” A l t i t u d e (m) ” ) ;
disp (x( t f ) ) ;

R=x ( 1 , t f ) ;
H=y ( 1 , t f / 2 ) ;
m p r i n t f ( ’ Range = ’ ) ; d i s p (R ) ;
m p r i n t f ( ’ Time o f F l i g h t = ’ ) ; d i s p ( t f ) ;
m p r i n t f ( ’ Maximum h e i g h t = ’ ) ; d i s p (H ) ;

4.3 Scilab code for Finding 20 kms range and sensitivity


w.r.t. initial launch angle

f u n c t i o n dens=rho ( z ) // i n t e r p o l a t i o n f o r d e n s i t y
dens=i n t e r p 1 ( atmsphr ’ ( 1 , : ) ∗ 1 0 0 0 , atmsphr ’ ( 4 , : ) , z ( 3 ) , ’ s p l i n e ’ ) ;
endfunction

f u n c t i o n tmp=T( z ) // i n t e r p o l a t i o n f o r t e m p e r a t u r e
tmp=i n t e r p 1 ( atmsphr ’ ( 1 , : ) ∗ 1 0 0 0 , atmsphr ’ ( 2 , : ) , z ( 3 ) , ’ s p l i n e ’ ) ;
endfunction

f u n c t i o n reyn=Re ( z ) // c a l c u l a t i n g Reynold ’ s no .
v=s q r t ( z ( 2 ) ˆ 2 + z ( 4 ) ˆ 2 ) ;
reyn =(rho ( z ) ∗ v ∗2∗ r ) /mu( z ) ;
endfunction

f u n c t i o n mach=Ma( z ) // c a l c u l a t i n g Mach no .
v=s q r t ( z ( 2 ) ˆ 2 + z ( 4 ) ˆ 2 ) ;
mach=v/ s q r t ( 1 . 4 ∗ 2 8 7 ∗T( z ) ) ;
endfunction

f u n c t i o n v i s c=mu( z ) // c a l c u l a t i n g Dynamic V i s c o s i t y
b e t a =1.458 e −6;
C= 1 1 0 . 4 ;
v i s c =( b e t a ∗ (T( z ) ) ˆ 1 . 5 ) / (T( z)+C ) ;
endfunction

f u n c t i o n c d r a g=Cd( z ) // c a l c u l a t i n g Drag C o e f f i c i e n t
R=l o g ( Re ( z ) ) ;

14
M=Ma( z ) ;
c f s = [ 0 . 0 0 0 0 6 4 1 −0.0006166 −0.0075524 0 . 1 1 7 5 2 2 4 −0.0009032 0 . 0 1 3 6 0 6 9 0 . 0 0 8 6 3 5 3
mr=[(M. ˆ 3 ) . ∗ ( R. ˆ 3 ) (M. ˆ 3 ) . ∗ ( R. ˆ 2 ) (M. ˆ 3 ) . ∗ ( R) (M. ˆ 3 ) (M. ˆ 2 ) . ∗ ( R. ˆ 3 ) (M. ˆ 2 ) . ∗
c f s=c f s ’ ;
c d r a g=mr∗ c f s ;
endfunction

g l o b a l m r g atmsphr S
m=5000;
r =.775/2;
S=(%p i ) ∗ r ∗ r ;
g =9.8065;
v0 =550;

t f =2∗vy0 / g ;
t =[0:5:150];

f o r i = −10:1:5

th0=(45+ i )∗(% p i ) / 1 8 0 ;
vx0=v0 ∗ c o s ( th0 ) ;
vy0=v0 ∗ s i n ( th0 ) ;
z0 =[0 vx0 0 vy0 ] ’ ;

f u n c t i o n dz=atmf ( t , z )
th=atan ( z ( 2 ) / z ( 4 ) ) ;
v=s q r t ( z (2)ˆ2+ z ( 4 ) ˆ 2 ) ;
dz (1)= z ( 2 ) ;
dz (3)= z ( 4 ) ;
D=0.5∗ rho ( z ) ∗ ( v ˆ 2 ) ∗Cd( z ) ∗ S ;
dz(2)=−D∗ c o s ( th ) /m;
dz(4)=−g−D∗ s i n ( th ) /m;
i f z (3) <0 then
dz ( 1 ) = 0 ;
dz ( 2 ) = 0 ;
dz ( 3 ) = 0 ;
dz ( 4 ) = 0 ;
end
endfunction

deg = 3 5 : 1 : 5 0 ;
rng ( i +11)=max( z2 ( 1 , : ) )

// z1=ode ( z0 , 0 , t , 0 . 1 , 0 . 1 , v a c f ) ;

15
z2=ode ( z0 , 0 , t , atmf ) ;

figure (1)
p l o t ( z2 ( 1 , : ) / 1 0 0 0 , z2 ( 3 , : ) / 1 0 0 0 ) ;

x l a b e l ( ’ Range (km ) ’ ) ;
y l a b e l ( ’ A l t i t u d e (km ) ’ ) ;

end
legend (”35” ,”36” ,”37” ,”38” ,”39” ,”40” ,”41” ,”42” ,”43” ,”44” ,”45” ,”46” ,”47” ,”48” ,”49
figure (2)
p l o t ( deg , rng ) ;
x l a b e l ( ’ Launch a n g l e ( d e g r e e s ) ’ ) ;
y l a b e l ( ’Max . Range (m) ’ ) ;

16

Você também pode gostar