The dimensional analysis section of the code is working, and returns the 6 lengths and angles of the different links in the mechanism as vectors. I am then able to plot those vectors in the prescribed positions to verify its accuracy. However, one ongoing problem I am having is that frequently the motion between certain positions is impossible because a certain link is too long or too short. I am hoping to visualize these types of issues by animating the motion of the vectors relative to each other, but I have not been able to figure out how to preserve the relationships between the links (based on revolute joints, they must go tip of one vector to tail of the next one) while the links are moving. Does anyone have matlab animation tips for this type of situation?
The current plotting code is shown below, where the W, Z and V terms are vectors, and alpha, beta, and gamma are all rotation angles.
text = sprintf('Solution Dyads');
figure('Position', [10 50 800 600], 'Name', text,'NumberTitle', 'off');
hold on;
axis equal;
grid on;
title('4PP Watt One Linkage Solution Colored Links');
h=axis;
scale=(h(2)-h(1))/10;
i=sqrt(-1);
for j = 1: 4
%Triad
%Plot WA
quiver(real(OAT),imag(OAT),real(W1T*(exp(alphaT(j)*1i))), imag(W1T *(exp(alphaT(j)*1i))),1, 'Color', 'r','LineWidth',2);
%Plot V1
quiver(real(OAT+W1T*(exp(alphaT(j)*1i))), imag(OAT+W1T*(exp(alphaT(j)*1i))),real(V1T*(exp(betaT(j)*1i))), imag(V1T*(exp(betaT(j)*1i))),1, 'Color', 'b','LineWidth',2);
%Plot Z1
quiver(real(OAT+W1T*(exp(alphaT(j)*1i))+V1T*(exp(betaT(j)*1i))), imag(OAT+W1T*(exp(alphaT(j)*1i))+V1T*(exp(betaT(j)*1i))),real(Z1T*(exp(gammaT(j)*1i))), imag(Z1T*(exp(gammaT(j)*1i))),1, 'Color', 'c','LineWidth',2);
%Dyad 2
%Plot WA
quiver(real(OAD2),imag(OAD2),real(W1D2*(exp(1i*betaD2(j)))), imag(W1D2 *(exp(1i*betaD2(j)))),1, 'Color', 'r','LineWidth',2);
%Plot ZA
quiver(real(OAD2+W1D2*(exp(betaD2(j)*1i))), imag(OAD2+W1D2*(exp(betaD2(j)*1i))),real(Z1D2*(exp(alphaD2(j)*1i))), imag(Z1D2*(exp(alphaD2(j)*1i))),1, 'Color', 'k','LineWidth',2);
%Dyad 3
%Plot WA
quiver(real(OAD3),imag(OAD3),real(W1D3*(exp(betaD3(j)*1i))), imag(W1D3 *(exp(betaD3(j)*1i))),1, 'Color', 'm','LineWidth',2);
%Plot ZA
quiver(real(OAD3+W1D3*(exp(betaD3(j)*1i))), imag(OAD3+W1D3*(exp(betaD3(j)*1i))),real(Z1D3*(exp(alphaD3(j)*1i))), imag(Z1D3*(exp(alphaD3(j)*1i))),1, 'Color', 'b','LineWidth',2);
%Close Ternary Links
plot([real(OAT+W1T*(exp(alphaT(j)*1i))), real(OAD3+W1D3*(exp(betaD3(j)*1i)))],[imag(OAT+W1T*(exp(alphaT(j)*1i))),imag(OAD3+W1D3*(exp(betaD3(j)*1i)))],'b','LineWidth',2);
plot([real(OAT+W1T*(exp(alphaT(j)*1i))), real(OAD2+W1D2*(exp(betaD2(j)*1i)))],[imag(OAT+W1T*(exp(alphaT(j)*1i))),imag(OAD2+W1D2*(exp(betaD2(j)*1i)))],'r','LineWidth',2);
end
quiver(real(pps(1)),imag(pps(1)),1,0,scale,'ok');
quiver(real(pps(1))+real(delta(2)),imag(pps(1))+imag(delta(2)),real(exp(gamma(2)*1i)),imag(exp(gamma(2)*1i)),scale,'ok');
quiver(real(pps(1))+real(delta(3)),imag(pps(1))+imag(delta(3)),real(exp(gamma(3)*1i)),imag(exp(gamma(3)*1i)),scale,'ok');
quiver(real(pps(1))+real(delta(4)),imag(pps(1))+imag(delta(4)),real(exp(gamma(4)*1i)),imag(exp(gamma(4)*1i)),scale,'ok');
axis equal;
hold off;