function [Y1,Y2,Y3]=limit_state_functions(t,X,X_mu,omega,epsilon)
% expressions of the three limit-state functions

% Lengths of links (mm)
Xc=X(1); X1=X(2); X2=X(3); X3=X(4);
% Mean values random variables (mm)
mu_Xc=X_mu(1); mu_X1=X_mu(2);
mu_X2=X_mu(3); mu_X3=X_mu(4);

for i=1:length(t)
theta(1)=omega.*t(i); 
theta(2)=omega.*t(i)-pi/6; 
theta(3)=omega.*t(i)-pi/3;

% Required motion outputs
SR1=mu_Xc.*cos(theta(1))+(mu_X1.^2-(mu_Xc.*sin(theta(1))).^2).^0.5;
SR2=mu_Xc.*cos(theta(2))+(mu_X2.^2-(mu_Xc.*sin(theta(2))).^2).^0.5;
SR3=mu_Xc.*cos(theta(3))+(mu_X3.^2-(mu_Xc.*sin(theta(3))).^2).^0.5;

% Real motion outputs
S1=Xc.*cos(theta(1))+(X1.^2-(Xc.*sin(theta(1))).^2).^0.5;
S2=Xc.*cos(theta(2))+(X2.^2-(Xc.*sin(theta(2))).^2).^0.5;
S3=Xc.*cos(theta(3))+(X3.^2-(Xc.*sin(theta(3))).^2).^0.5;

% Motion errors
Y1(i)=abs(SR1-S1)-epsilon(1);
Y2(i)=abs(SR2-S2)-epsilon(2);
Y3(i)=abs(SR3-S3)-epsilon(3);
end