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

Solve using MATLAB: solve and plot the following cases *** solve this using MATL

ID: 3687747 • Letter: S

Question

Solve using MATLAB: solve and plot the following cases

*** solve this using MATLAB software ***

The equation of motion for a pendulum whose base is accelerating horizontally with an acceleration a(t) is: Ltheta + g sin theta = a(t) cos theta Suppose g = 9.81 m/s^2, L = 1 m, and theta (0) = 0. Solve for and plot theta(t) for 0 lessthanorequalto t lessthanorequalto 10 s for the following three cases. a) The acceleration is constant: a = 5m/s^2, and theta(0) = 0.5 rad. b) The acceleration is constant: a = 5 m/s^2, and theta(0) = 3 rad. c) The acceleration is linear with time: a = 0.51 m/s^2, and theta(0) = 3 rad.

Explanation / Answer

a)

t = 0:1:10;
t(1) = 0.5
g = 9.81;
L = 1;
a = 5;
y = (a*t*cos(t) - g*sin(t))/L;
figure % opens new figure window
plot(t,y)

--------------------------------------------------------

b)

t = 0:1:10;
t(1) = 3
g = 9.81;
L = 1;
a = 5;
y = (a*t*cos(t) - g*sin(t))/L;
figure % opens new figure window
plot(t,y)
---------------------------------------------------------

c)

t= 0:1:10;

t(1) = 3
g = 9.81;
L = 1;
a = 0.5*t;
y = (a*t*cos(t) - g*sin(t))/L;
figure % opens new figure window
plot(t,y)