clear allclcL2 = 10;L3 = 20;theta2 = 0:pi/18:2*pi;% theta2 = pi/12;
omega2 = 1.6; theta3 = (2 * pi) + asin((-L2/L3)* sin(theta2)) L1 = L2 * cos(theta2) + L3 * cos(theta3); C = [L2*sin(theta2)*omega2;-L2*cos(theta2)*omega2] D = [-L3*sin(theta3) -1 ;L3*cos(theta3) 0] B = inv(D) * C plot(theta2,theta3) grid on xlabel('theta2(degrees)') ylabel('theta3(degrees)') title('crank angle(theta2) vs link 3 angle(theta3)') figure plot(theta2,L1) grid on xlabel('theta2(degrees)') ylabel('L1(m)') title('crank angle(theta2) vs link 1 angle(L1)')
MATLAB: When theta2 makes a complete cycle, I get error message.
MATLAB
Best Answer