Professional Documents
Culture Documents
Printed by Wolfram Mathematica Student Edition
Printed by Wolfram Mathematica Student Edition
H* Trajectory of Canonball*L
In[49]:=
ClearAll@"Global`*"D;
Clear@DerivativeD;
Remove@"Global`*"D;
H* SI units assumed *L
g = 9.8;
H* drag coefficient @bD = @Force velocity^2D *L
gamma = 0.25;
d = 0.15;
m = 13.8;
lambda = 10 000;
c = gamma d ^ 2 ;
vter = Sqrt@m g cD;
H* interval of time to produce a numerical solution for *L
Tsol = 15 000;
H* time interval for plotting the solutions HTTsolL *L
T = 35;
v0 = 300;
theta = 50 180 Pi;
vx0 = v0 Cos@thetaD;
vy0 = v0 Sin@thetaD;
H* Differential equation for atmospheric variation*L
eqx = Nx ''@tD == - c Exp@- Ny@tD lambdaD Sqrt@Nx '@tD ^ 2 + Ny '@tD ^ 2D Nx '@tD m;
eqy = Ny ''@tD == - g - c Exp@- Ny@tD lambdaD Sqrt@Nx '@tD ^ 2 + Ny '@tD ^ 2D Ny '@tD m;
sol1 = NDSolve@8eqx, eqy, Nx '@0D == vx0, Ny '@0D == vy0, Nx@0D == 0, Ny@0D == 0<,
8Nx, Ny<, 8t, 0, Tsol<D;
<< PlotLegends`
ParametricPlot@8Evaluate@8Nx@tD, Ny@tD<D . sol1, Evaluate@vx0 t, vy0 t - g t ^ 2 2D,
Evaluate@Nx@TsolD . sol1, - Abs@vy0 t - g t ^ 2 2DD<, 8t, 0, T<,
ImageSize Large, AspectRatio 1, AxesLabel 8"x HmL", "y HmL"<,
PlotLabel SequenceForm@"Cannonball's trajectory during the first ", T, "s"D,
PlotLegend -> 8"Quadratic drag - Atmospheric", "In vacuum",
"max x possible with quadratic drag"<, LegendPosition 81.1, - 0.5<,
LegendSize 81.6, 0.8<, PlotRange 880, 14 000<, 8- 2500, 3000<<D
H*Let's plot the Atmospheric and vertical components
of velocity and see the affect of the drag force*L
Print@"After 30 s the horizontal component of velocity reduces down to ",
Nx '@30D . sol1, " ms"D
Project 2.nb
2000
In vacuum
0
2000
4000
6000
8000
10 000
12 000
x HmL
14 000
max x possible with quadratic drag
-1000
-2000
Project 2.nb
200
150
Out[71]=
100
50
t HsL
5
10
15
Project 2.nb
200
100
Out[72]=
t HsL
0
5
10
15
-100