Analysis of Anti-Projectile Parameters under Various Conditions
VerifiedAdded on  2023/01/19
|25
|3497
|96
Project
AI Summary
This project presents a detailed analysis of projectile motion using MATLAB simulations. It explores the calculation of anti-projectile parameters under different conditions, including varying initial velocities, air friction, and a moving target. The assignment includes MATLAB code and outputs for each scenario, illustrating the effects of changing parameters on the projectile's trajectory and the anti-projectile's performance. The analysis covers scenarios with and without air friction and a moving target, plotting key parameters such as time, angles, and position as a function of height. The project aims to provide a comprehensive understanding of projectile motion and its practical applications through computational modeling and analysis. The solutions provided here are available on Desklib, a platform offering AI-powered study tools for students.

Running head: ASSIGNMENT 1
ASSIGNMENT 1
Name of the Student
Name of the University
Author Note
ASSIGNMENT 1
Name of the Student
Name of the University
Author Note
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

1ASSIGNMENT 1
a.
The anti-projectile parameters are calculated by the following MATLAB code.
MATLAB code:
% specifying projectile data
g = 9.81; v1 = 10; vo = 20; theta1 = pi/6;
x0 = 10; y0 = 11; z0 = 0;
t1 = 2*(v1/g)*sin(theta1); % time to reach the target of the projectile
tp = 0.1; % anti-projectile firing time
syms th
equ = z0 + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
th = eval(solve(equ,th));
alpha = rad2deg(atan(y0/(x0 - v1*th*cos(theta1))));
syms theta0
equ = (-x0 + v1*th*cos(theta1))/(2*v1*(th - tp)*cos(theta0)) == (1/2)*sqrt(4 -
y0^2/(v1^2*(th - tp)^2*(cos(theta0))^2));
theta0 = eval(solve(equ,theta0));
theta0 = rad2deg(theta0(1));
fprintf('x0=%g m \ty0=%g m \tz0=%g m\n t1=%.4f secs,tp=%.4f secs,th=%.4f secs,alpha=
%.4f degrees,theta0=%.4f degrees\n',x0,y0,z0,t1,tp,th,alpha,theta0)
a.
The anti-projectile parameters are calculated by the following MATLAB code.
MATLAB code:
% specifying projectile data
g = 9.81; v1 = 10; vo = 20; theta1 = pi/6;
x0 = 10; y0 = 11; z0 = 0;
t1 = 2*(v1/g)*sin(theta1); % time to reach the target of the projectile
tp = 0.1; % anti-projectile firing time
syms th
equ = z0 + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
th = eval(solve(equ,th));
alpha = rad2deg(atan(y0/(x0 - v1*th*cos(theta1))));
syms theta0
equ = (-x0 + v1*th*cos(theta1))/(2*v1*(th - tp)*cos(theta0)) == (1/2)*sqrt(4 -
y0^2/(v1^2*(th - tp)^2*(cos(theta0))^2));
theta0 = eval(solve(equ,theta0));
theta0 = rad2deg(theta0(1));
fprintf('x0=%g m \ty0=%g m \tz0=%g m\n t1=%.4f secs,tp=%.4f secs,th=%.4f secs,alpha=
%.4f degrees,theta0=%.4f degrees\n',x0,y0,z0,t1,tp,th,alpha,theta0)

2ASSIGNMENT 1
x0 = 6.073703078; y0 = 0; z0 = 1.094056669;
t1 = 2*(v1/g)*sin(theta1); % time to reach the target of the projectile
tp = 0.1; % anti-projectile firing time
syms th
equ = z0 + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
th = eval(solve(equ,th));
fprintf('\n\nx0=%g m \ty0=%g m \tz0=%g m\n t1=%.4f secs,tp=%.4f secs,th=%.4f secs\
n',x0,y0,z0,t1,tp,th)
Output:
x0=10 m y0=11 m z0=0 m
t1=1.0194 secs,tp=0.1000 secs,th=0.7013 secs,alpha=70.3567 degrees,theta0=166.2052
degrees
x0=6.0737 m y0=0 m z0=1.09406 m
t1=1.0194 secs,tp=0.1000 secs,th=0.2817 secs
b.
Now, the same example is performed except v0 = 5v1 and
x0 = 6.073703078; y0 = 0; z0 = 1.094056669;
t1 = 2*(v1/g)*sin(theta1); % time to reach the target of the projectile
tp = 0.1; % anti-projectile firing time
syms th
equ = z0 + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
th = eval(solve(equ,th));
fprintf('\n\nx0=%g m \ty0=%g m \tz0=%g m\n t1=%.4f secs,tp=%.4f secs,th=%.4f secs\
n',x0,y0,z0,t1,tp,th)
Output:
x0=10 m y0=11 m z0=0 m
t1=1.0194 secs,tp=0.1000 secs,th=0.7013 secs,alpha=70.3567 degrees,theta0=166.2052
degrees
x0=6.0737 m y0=0 m z0=1.09406 m
t1=1.0194 secs,tp=0.1000 secs,th=0.2817 secs
b.
Now, the same example is performed except v0 = 5v1 and
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

3ASSIGNMENT 1
r0 = [ x 0
y 0
H ]
Hence, x0 = 10 m, y0 = 11 m and z0 = H m.
MATLAB code:
% specifying projectile data
g = 9.81; v1 = 10; v0 = 5*v1; theta1 = pi/6;
x0 = 10; y0 = 11; H = 0:0.1:2.8;
t1 = 2*(v1/g)*sin(theta1);
tp = 0.1; % anti-projectile firing time
i=1;syms th;
while i<=length(H)
equ = H(i) + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
solth(i)= eval(solve(equ,th));
i=i+1;
end
alpha = rad2deg(atan(y0./(x0 - v1.*solth.*cos(theta1))));
theta0 = rad2deg(acos((75.*(solth).^2 - 100*3^(1/2).*(solth) + 221).^(1/2)./(2.*(10.*(solth) -
1))));
r0 = [ x 0
y 0
H ]
Hence, x0 = 10 m, y0 = 11 m and z0 = H m.
MATLAB code:
% specifying projectile data
g = 9.81; v1 = 10; v0 = 5*v1; theta1 = pi/6;
x0 = 10; y0 = 11; H = 0:0.1:2.8;
t1 = 2*(v1/g)*sin(theta1);
tp = 0.1; % anti-projectile firing time
i=1;syms th;
while i<=length(H)
equ = H(i) + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
solth(i)= eval(solve(equ,th));
i=i+1;
end
alpha = rad2deg(atan(y0./(x0 - v1.*solth.*cos(theta1))));
theta0 = rad2deg(acos((75.*(solth).^2 - 100*3^(1/2).*(solth) + 221).^(1/2)./(2.*(10.*(solth) -
1))));
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

4ASSIGNMENT 1
figure
plot(H,solth,'r-')
xlabel('H in meter')
ylabel('th in secs')
figure
plot(H,alpha,'b-')
xlabel('H in meter')
ylabel('alpha in degrees')
figure
plot(H,theta0,'k-')
xlabel('H in meter')
ylabel('theta0 in degrees')
x = v1.*solth.*cos(theta1) - (solth - tp).*v0.*cosd(theta0).*cosd(alpha);
y = -(solth - tp).*v0.*cosd(theta0).*sind(alpha);
z = v1.*solth.*theta1 - (1/2).*g.*(solth.^2) + (1/2).*g.*((solth - tp).^2) - (solth -
tp).*v0.*sind(theta0);
figure
plot(H,solth,'r-')
xlabel('H in meter')
ylabel('th in secs')
figure
plot(H,alpha,'b-')
xlabel('H in meter')
ylabel('alpha in degrees')
figure
plot(H,theta0,'k-')
xlabel('H in meter')
ylabel('theta0 in degrees')
x = v1.*solth.*cos(theta1) - (solth - tp).*v0.*cosd(theta0).*cosd(alpha);
y = -(solth - tp).*v0.*cosd(theta0).*sind(alpha);
z = v1.*solth.*theta1 - (1/2).*g.*(solth.^2) + (1/2).*g.*((solth - tp).^2) - (solth -
tp).*v0.*sind(theta0);

5ASSIGNMENT 1
figure
plot(H,x,'m-')
xlabel('H in meter')
ylabel('x position in m')
figure
plot(H,y,'g-')
xlabel('H in meter')
ylabel('y position in m')
figure
plot(H,z,'y-')
xlabel('H in meter')
ylabel('z position in m')
Output:
figure
plot(H,x,'m-')
xlabel('H in meter')
ylabel('x position in m')
figure
plot(H,y,'g-')
xlabel('H in meter')
ylabel('y position in m')
figure
plot(H,z,'y-')
xlabel('H in meter')
ylabel('z position in m')
Output:
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

6ASSIGNMENT 1
0 0.5 1 1.5 2 2.5 3
H in meter
0.686
0.688
0.69
0.692
0.694
0.696
0.698
0.7
0.702
th in secs
0 0.5 1 1.5 2 2.5 3
H in meter
69.7
69.8
69.9
70
70.1
70.2
70.3
70.4
alpha in degrees
0 0.5 1 1.5 2 2.5 3
H in meter
0.686
0.688
0.69
0.692
0.694
0.696
0.698
0.7
0.702
th in secs
0 0.5 1 1.5 2 2.5 3
H in meter
69.7
69.8
69.9
70
70.1
70.2
70.3
70.4
alpha in degrees
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

7ASSIGNMENT 1
0 0.5 1 1.5 2 2.5 3
H in meter
0
2
4
6
8
10
12
14
theta0 in degrees
0 0.5 1 1.5 2 2.5 3
H in meter
-4.3
-4.2
-4.1
-4
-3.9
-3.8
-3.7
x position in m
0 0.5 1 1.5 2 2.5 3
H in meter
0
2
4
6
8
10
12
14
theta0 in degrees
0 0.5 1 1.5 2 2.5 3
H in meter
-4.3
-4.2
-4.1
-4
-3.9
-3.8
-3.7
x position in m

8ASSIGNMENT 1
0 0.5 1 1.5 2 2.5 3
H in meter
-27.500000000004
-27.500000000003
-27.500000000002
-27.500000000001
-27.5
-27.499999999999
-27.499999999998
-27.499999999997
-27.499999999996
y position in m
0 0.5 1 1.5 2 2.5 3
H in meter
-5
-4
-3
-2
-1
0
1
2
3
z position in m
0 0.5 1 1.5 2 2.5 3
H in meter
-27.500000000004
-27.500000000003
-27.500000000002
-27.500000000001
-27.5
-27.499999999999
-27.499999999998
-27.499999999997
-27.499999999996
y position in m
0 0.5 1 1.5 2 2.5 3
H in meter
-5
-4
-3
-2
-1
0
1
2
3
z position in m
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

9ASSIGNMENT 1
c.
Now, the air friction is assumed which is proportional to velocity and the velocity due to
given by equation (2.322). The measure of c = 1- z/10000 where z is the height in z direction
given by equation 2.325. The MATLAB code and output is shown below.
MATLAB code:
% specifying projectile data
m = 10; %mass of projectile is 10 kg
g = 9.81; v1 = 10; v0 = 20; theta1 = pi/6;
x0 = 10; y0 = 11; z0 = 0;
z = (-1/2)*g*x0^2/(v0^2*cos(theta1)) + x0*tan(theta1);
c = 1 - z/10000; % air friction coefficient
t1 = 2*(v1/g)*sin(theta1); % time to reach the target of the projectile
tp = 0.1; % anti-projectile firing time
v0 = v0*exp(-c*tp/m)*cos(theta1); v1 = v1*exp(-c*tp/m)*cos(theta1);
syms th
equ = z0 + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
th = eval(solve(equ,th));
alpha = rad2deg(atan(y0/(x0 - v1*th*cos(theta1))));
syms theta0
c.
Now, the air friction is assumed which is proportional to velocity and the velocity due to
given by equation (2.322). The measure of c = 1- z/10000 where z is the height in z direction
given by equation 2.325. The MATLAB code and output is shown below.
MATLAB code:
% specifying projectile data
m = 10; %mass of projectile is 10 kg
g = 9.81; v1 = 10; v0 = 20; theta1 = pi/6;
x0 = 10; y0 = 11; z0 = 0;
z = (-1/2)*g*x0^2/(v0^2*cos(theta1)) + x0*tan(theta1);
c = 1 - z/10000; % air friction coefficient
t1 = 2*(v1/g)*sin(theta1); % time to reach the target of the projectile
tp = 0.1; % anti-projectile firing time
v0 = v0*exp(-c*tp/m)*cos(theta1); v1 = v1*exp(-c*tp/m)*cos(theta1);
syms th
equ = z0 + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
th = eval(solve(equ,th));
alpha = rad2deg(atan(y0/(x0 - v1*th*cos(theta1))));
syms theta0
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

10ASSIGNMENT 1
equ = (-x0 + v1*th*cos(theta1))/(2*v1*(th - tp)*cos(theta0)) == (1/2)*sqrt(4 -
y0^2/(v1^2*(th - tp)^2*(cos(theta0))^2));
theta0 = eval(solve(equ,theta0));
theta0 = rad2deg(theta0(1));
fprintf('x0=%g m \ty0=%g m \tz0=%g m\n t1=%.4f secs,tp=%.4f secs,th=%.4f secs,alpha=
%.4f degrees,theta0=%.4f degrees\n',x0,y0,z0,t1,tp,th,alpha,theta0)
x0 = 6.073703078; y0 = 0; z0 = 1.094056669;
t1 = 2*(v1/g)*sin(theta1); % time to reach the target of the projectile
tp = 0.1; % anti-projectile firing time
syms th
equ = z0 + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
th = eval(solve(equ,th));
fprintf('\n\nx0=%g m \ty0=%g m \tz0=%g m\n t1=%.4f secs,tp=%.4f secs,th=%.4f secs\
n',x0,y0,z0,t1,tp,th)
Output:
x0=10 m y0=11 m z0=0 m
t1=1.0194 secs,tp=0.1000 secs,th=0.8014 secs,alpha=69.7914 degrees,theta0=167.0349
degrees
equ = (-x0 + v1*th*cos(theta1))/(2*v1*(th - tp)*cos(theta0)) == (1/2)*sqrt(4 -
y0^2/(v1^2*(th - tp)^2*(cos(theta0))^2));
theta0 = eval(solve(equ,theta0));
theta0 = rad2deg(theta0(1));
fprintf('x0=%g m \ty0=%g m \tz0=%g m\n t1=%.4f secs,tp=%.4f secs,th=%.4f secs,alpha=
%.4f degrees,theta0=%.4f degrees\n',x0,y0,z0,t1,tp,th,alpha,theta0)
x0 = 6.073703078; y0 = 0; z0 = 1.094056669;
t1 = 2*(v1/g)*sin(theta1); % time to reach the target of the projectile
tp = 0.1; % anti-projectile firing time
syms th
equ = z0 + sqrt(4*((th - tp)^2)*(v1^2) - y0^2 - (-x0 + v1*th*cos(theta1))^2) ==
v1*th*sin(theta1) + (1/2)*g*tp*(tp-2*th);
th = eval(solve(equ,th));
fprintf('\n\nx0=%g m \ty0=%g m \tz0=%g m\n t1=%.4f secs,tp=%.4f secs,th=%.4f secs\
n',x0,y0,z0,t1,tp,th)
Output:
x0=10 m y0=11 m z0=0 m
t1=1.0194 secs,tp=0.1000 secs,th=0.8014 secs,alpha=69.7914 degrees,theta0=167.0349
degrees

11ASSIGNMENT 1
x0=6.0737 m y0=0 m z0=1.09406 m
t1=0.8740 secs,tp=0.1000 secs,th=0.3169 secs
d.
Now, the same data of (2.803) is assumed except v0 = 5v1 where v1 = 2 m/s in x direction.
Also, air friction is assumed with coefficient c = 1- z/10000 and every output parameters
alpha, theta0 and others are plotted as a function of H, where H is varied z height.
MATLAB code:
% specifying projectile data
m = 10; % projectile mass is 10 kg
g = 9.81; v1 = 2; v0 = 5*v1; theta1 = pi/6; % v1 = 2 m/sec and v0 = 5*v1
x0 = 10; y0 = 11; H = 0:0.1:0.8;
z = (-1/2)*g*x0^2/(v0^2*cos(theta1)) + x0*tan(theta1);
c = 1 - z/10000; % air friction coeffcient
t1 = 2*(v1/g)*sin(theta1);
tp = 0.1; % anti-projectile firing time
v0 = v0*exp(-c*tp/m)*cos(theta1); v1 = v0/5;
i=1;syms th;
while i<=length(H)
x0=6.0737 m y0=0 m z0=1.09406 m
t1=0.8740 secs,tp=0.1000 secs,th=0.3169 secs
d.
Now, the same data of (2.803) is assumed except v0 = 5v1 where v1 = 2 m/s in x direction.
Also, air friction is assumed with coefficient c = 1- z/10000 and every output parameters
alpha, theta0 and others are plotted as a function of H, where H is varied z height.
MATLAB code:
% specifying projectile data
m = 10; % projectile mass is 10 kg
g = 9.81; v1 = 2; v0 = 5*v1; theta1 = pi/6; % v1 = 2 m/sec and v0 = 5*v1
x0 = 10; y0 = 11; H = 0:0.1:0.8;
z = (-1/2)*g*x0^2/(v0^2*cos(theta1)) + x0*tan(theta1);
c = 1 - z/10000; % air friction coeffcient
t1 = 2*(v1/g)*sin(theta1);
tp = 0.1; % anti-projectile firing time
v0 = v0*exp(-c*tp/m)*cos(theta1); v1 = v0/5;
i=1;syms th;
while i<=length(H)
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 25
Your All-in-One AI-Powered Toolkit for Academic Success.
 +13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.
