(MATLAB QUESTION) A projectile is any object projected by some means, which cont
ID: 2997850 • Letter: #
Question
(MATLAB QUESTION) A projectile is any object projected by some means, which continues to move due to its own inertia (mass). Assume that there is no air resistance and that the only force acting on the arrow is gravity (9.81m/s2 ). The horizontal (x) component of velocity is constant. The horizontal and vertical motions are independent of each other, but they have a common time. The governing equations for this projectile motions are:
vx(t) = v0cos(theta) --------(1) equation
x(t) = v0tcos(theta) --------(2)equation
vy(t) = v0sin(theta) - gt --------(3)equation
y(t) = y0 + v0tsin(theta) - gt2/2 ------(4)equation
where, g = gravitational acceleration (positive)
v0 = initial velocity (magnitude)
y0 = height or launch distance from ground
t = time (an array of values)
Remember: MATLAB trig functions sin, cos, tan are in units of radians not degrees. Convert all angles to radians.
1.) Write three separate functions(m-files) for x(t), y(t) and v(t) to implement equations 2, 4, and 5 respectively. Note that the time input will be a vector.
2.) Given a projectile launched horizontally, (thus the angle of the initial trajectory to 0), v0 = 10 m/s and y0 = 20m; a. Use the functions you created in Part1 to compute x(t), y(t) and v(t), where time is from 0 to 2 sec (inclusive) for 200 equal increments. Hint: linspace().
b. Plot the velocity v(t) of the arrow over the 2 sec.
c. Plot the trajectory, y(t) against x(t), of the arrow over the 2 sec.
3.) Given the projectile launched upwards at an angle of 45 (upwards), v0= 50 m/s and y0 = 0 m (on the ground);
a. Use the function you created in Part A.1 to compute x(t), y(t) and v(t) where time is from 0 to 7.2 sec (inclusive) for 200 equal increments.
b. Plot the velocity v(t) of the arrow over the 7.2 sec.
c. Plot the trajectory, y(t) against x(t), of the arrow over the 7.2 sec.
4.) Given the projectile being launched at an angle of 45, v0 = 20 m/s and y0 = 30 m;
a. Use the function you created in Part1 to compute x(t), y(t) and v(t) where time is from 0 to 4.3 sec (inclusive) for 200 equal increments.
b. Plot the velocity v(t) of the arrow over the 4.3 sec.
c. Plot the trajectory, y(t) against x(t), of the arrow over the 4.3 sec.
5.) Explain the difference in trajectory between Part 1, 2, 3 and 4.
(MATLAB QUESTION) A projectile is any object projected by some means, which continues to move due to its own inertia (mass). Assume that there is no air resistance and that the only force acting on the arrow is gravity (9.81m/s2 ). The horizontal (x) component of velocity is constant. The horizontal and vertical motions are independent of each other, but they have a common time. The governing equations for this projectile motions are: vx(t) = v0cos(theta) --------(1) equation x(t) = v0tcos(theta) --------(2)equation vy(t) = v0sin(theta) - gt --------(3)equation y(t) = y0 + v0tsin(theta) - gt2/2 ------(4)equation where, g = gravitational acceleration (positive) v0 = initial velocity (magnitude) y0 = height or launch distance from ground t = time (an array of values) The velocity with respect to time, v(t) = Root vxt^2+vyt^2 Remember: MATLAB trig functions sin, cos, tan are in units of radians not degrees. Convert all angles to radians. 1.) Write three separate functions(m-files) for x(t), y(t) and v(t) to implement equations 2, 4, and 5 respectively. Note that the time input will be a vector. 2.) Given a projectile launched horizontally, (thus the angle of the initial trajectory to 0½), v0 = 10 m/s and y0 = 20m; a. Use the functions you created in Part1 to compute x(t), y(t) and v(t), where time is from 0 to 2 sec (inclusive) for 200 equal increments. Hint: linspace(). b. Plot the velocity v(t) of the arrow over the 2 sec. c. Plot the trajectory, y(t) against x(t), of the arrow over the 2 sec. 3.) Given the projectile launched upwards at an angle of 45½ (upwards), v0= 50 m/s and y0 = 0 m (on the ground); a. Use the function you created in Part A.1 to compute x(t), y(t) and v(t) where time is from 0 to 7.2 sec (inclusive) for 200 equal increments. b. Plot the velocity v(t) of the arrow over the 7.2 sec. c. Plot the trajectory, y(t) against x(t), of the arrow over the 7.2 sec. 4.) Given the projectile being launched at an angle of 45½, v0 = 20 m/s and y0 = 30 m; a. Use the function you created in Part1 to compute x(t), y(t) and v(t) where time is from 0 to 4.3 sec (inclusive) for 200 equal increments. b. Plot the velocity v(t) of the arrow over the 4.3 sec. c. Plot the trajectory, y(t) against x(t), of the arrow over the 4.3 sec. 5.) Explain the difference in trajectory between Part 1, 2, 3 and 4.Explanation / Answer
%Save it as x.m in the working directory
function [ out] = x( v0,theta,t )
out=v0.*t*cos(theta*pi/180);
end
%Save it as y.m in the working directory
function [ out] = y( v0,theta,t,y0 )
g=9.81;
out=y0+v0.*t*sin(theta*pi/180)-g.*t.^2/2;
end
%Save it as v.m in the working directory
function [ out] = v( v0,theta,t )
g=9.81;
vy=v0*sin(theta*pi/180)-g.*t;
vx=v0*cos(theta*pi/180);
out=sqrt(vy.^2+vx.^2);
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.