Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a Matlab script that allows the user to determine the range, velocity, an

ID: 3833438 • Letter: C

Question

Create a Matlab script that allows the user to determine the range, velocity, and acceleration of a projectile being thrown from a trebuchet, then graph the projectile trajectory after release (assume the initial and final height of projectile is 0 before and after thrown). The user must be able to input variables length of throwing arm, height of pivot point, mass of projectile, and mass of counterweight. This will be modeled as a two-dimensional problem. The following assumptions are made in this analysis:  The trebuchet is rigid. There is no flexing of the various members. There is no friction on the guide chute, or at the joints (pivots). The pouch and sling have negligible mass. There is no air resistance as the payload flies through the air. The trebuchet remains stationary on the ground during launch.

Explanation / Answer

sym k
x=0.4*k.^6+17.8*k.^9-64.4*k.^2-23.2*k+8.4
x=(0.4*k.^9)+(70.8*k.^3)-(64.4*k.^2)-(25.2*k)+8.4
v=difference(m)
y=difference(n)
k=0:0.1:8-0.1;
M=subs(m,k);
N=subs(n,k);
A=subs(a,k);
figure, plot(k,M,k,N,'r',k,Y,'g')
legend(' Position','Velocity','Acceleration')