Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (22 sloc) 1.44 KB
t=linspace(0,2*pi/50,100); # create time varying from 0-0.126 s (or one period)
x=20*sin(50*t);dx=20*50*cos(50*t); # define x and dx/dt in terms of time (note dx=dx/dt)
t1=0.2*pi*cos(50*t); dt1=-10*pi*sin(50*t); # define theta1 (t1) and dtheta1/dt
t2=0.2*pi*sin(50*t-pi/3); dt2=10*pi*sin(50*t-pi/3); # define theta2 (t2) and dtheta2/dt;
L1=1;L2=1.5; # set lengths for L1 and L2 (none were given in problem so 1 and 1.5 mm were
# chosen arbitrarily
rcc=[x+L1*sin(t1);-L1*cos(t1)]; # position of connection between links
rco=[x+L1*sin(t1)+L2*sin(t2);-(L1*cos(t1)+L2*cos(t2))]; # create a row vectors of
# x-component and y-component of
# pendulum position C (r_C/O)
vco=[dx+L1*cos(t1).*dt1+L2*cos(t2).*dt2;(L1*sin(t1).*dt1+L2*sin(t2).*dt2)]; # create row
# vectors of
# the x- and
# y-component
# velocity of
# point C
figure(1)
plot(t,vco(1,:),t,vco(2,:))
xlabel('time (s)')
ylabel('velocity (mm/s)')
legend('x-component','y-component')
title('Velocity of end point')
You can’t perform that action at this time.