Below I\'ve included an attempt to solve this problem, you can modify it as you
ID: 2297088 • Letter: B
Question
Below I've included an attempt to solve this problem, you can modify it as you like. After a bullet strikes it must go up and then fall back to its initial position.
% Midterm 1 Problem 1
g = 9.8;
m = 0.01;
M=1.5;
v=500;
v1=(m*v)/(m+M);
axis([-5 5 0 10]);
t=0;
while t<=1.0
x1 = 0;
y1 = 4;
x2 = -0.5;
y2 = 3;
p = line([0 x1],[10 y1]);
q = rectangle('Position',[-0.5,3,1,1]);
r = rectangle('Position',[-0.1,1+2*t,0.2,0.4],'Curvature',[1,1],'FaceColor','k');
s = rectangle('Position',[-0.1,1+2*t,0.2,0.2],'FaceColor','k');
pause(0.08);
t = t + 0.08;
delete(p);
delete(q);
delete(r);
delete(s);
end
t=0;
v1=(m*v)/(M+m);
while(v>=0)
v=v1-(g*t);
x1 = 0;
y1 = 4+v1*(t)-(g*(t)^2)/2;
x2 = -0.5;
y2 = 3+v1*(t)-(g*(t)^2)/2;
p = line([0 x1],[10 y1]);
q = rectangle('Position',[-0.5,y2,1,1]);
r = rectangle('Position',[-0.1,y2,0.2,0.4],'Curvature',[1,1],'FaceColor','k');
s = rectangle('Position',[-0.1,y2,0.2,0.2],'FaceColor','k');
pause(0.1);
t = t + 0.1;
if(v>=0)
delete(r);
delete(s);
delete(q);
delete(p);
end
end
h=v1^2/(2*g);
disp(['height climbed by block and bullet is ',num2str(h)]);
A bullet of mass m is fired up with speed of v to a large wooden block of mass M as shown. The bullet is embedded in the block and the system rise up and comes to rest at a distance h measured from the base of the block. Write MATLAB GUI, to perform a simulation and animation of the system for the given m, M, and v. The program should also show the value of h in meters.Explanation / Answer
1/2 (m+M) v1^2=(m+M)gh after impact
h=(v1^2)/2g
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.