Вы находитесь на странице: 1из 2

%This loop will check the values of the LSW with respect to the USW

for USWx = UL_UW:IncUW:LL_UW %Loops indide the range of the upperwishbone


%the program will now have to calculate the equations of the lines for
%all the hundred different USW positions
%Determining the GRC coordinate with variation of the USW (This will have to
be in the loop so as 100 different variations are required)
%determining the specified position of the
for counterL = UL_LW:IncLW:LL_LW %Loops inside the range of the lower wishbo
ne
%Starts with the checks with respect to the conditions set forth regarding t
he postions of the lower wishbone as a function of the upper wishbone
if (USWx - LSWx) >= 0.5*WWx
then LSWx = 0.25*WWx + LSWx
else if (USWx - LSWx) > 0.66667*WWx
then LSWx = 0.416*WWx;
end; %end for the if statement
temp1_USW = counter + IncUW; %Increments the counter for the upper wishbone
temp2 = temp1 + IncLW; %Increments the lower counter as the upper counter in
crements
XV = linspace(min(temp1_USW), max(temp2), 100);
YV = polyval(Xupper, temp1_USW); %Creates it as a function and creates the c
orresponding y value
%plotting the graphs GRC vs USW change
plot(GRC, XV,'b'); %Plots the graph for GRC against USW for at least 100 dif
ferent positions
plot(ICx, XV, 'r'); % plots the graph of the horizontal positiion of the ins
tanttaneous centre of rotation vs the USW
while InputValUSW > counter
counter = counter + 1;
counterL = counterL + 1;
if InputValUSW = InputValUSW(upper)
then
% calculate the gradients of the lines
MUY(InputValUSW) = USCy - USWy;
MUX(InputValUSW) = USCx - USWx;
MLY(InputValUSW) = LSCy - LSWy;
MLX(InputValUSW) = LSCx - LSWx;
MU(InputValUSW) = MUY / MUX;
ML(InputValUSW) = MLY / MLX;
%determining the y intercepts
CU(InputValUSW) = USWy - (MU*USWx);
CL(InputValUSW) = LSWy - (ML*LSWx);
%Determine the instantaneous centre of rotation
%X coordinate
XIC(InputValUSW) = ((CU - CL) / (ML - MU));
%Y coordinate
YIC(InputValUSW) = ((MU * XIC) + CU);
fprintf('\n X Coordinate of centre of rotation = %f units\n'
, XIC); %This will display the x coordinate of the centre of rotation
fprintf('\n y Coordinate of centre of rotation = %f units\n
', YIC); %this will display the y coordinate of the centre of rotation
end;
%Writing to the CSV
csvwrite(wishbone, matrix);
end;
end;

end;
%Inputting the value of the USW that the user would like to see
%InputValUSW = Inputdlg('Please enter the value of the USW that you wish to chec
k', 'Enter the value of the USW');
%for Counter = UL_UW:Inc_UW:LL_UW
% for counterL = LL_LW:Inc_LW:LL_LW
%
while counter > counterL
%
counter = counter + USW;
%
counterL = counter + LSW;
%
if InputValUSW = xupper[counter]
%
then
%
% calculate the gradients of the lines
%
MUY(counter) = USCy - USWy;
%
MUX(counter) = USCx - USWx;
%
MLY(counter) = LSCy - LSWy;
%
MLX(counter) = LSCx - LSWx;
%
MU(counter) = MUY / MUX;
%
ML(counter) = MLY / MLX;
%determining the y intercepts
CU(counter) = USWy - (MU*USWx);
CL(counter) = LSWy - (ML*LSWx);

%
%

%Determine the instantaneous centre of rotation


%X coordinate
%XIC(counter) = ((CU - CL) / (ML - MU));
%Y coordinate
YIC(counter) = ((MU * XIC) + CU);

%
%

end;

% end;
%end;
%end;

Вам также может понравиться