clc; clear all;
%%input time=0.2; K=170e6; C=15e-6; x=20e-6; y=20e-6;
%%initialize z = 13; %%z=13 H = 0.005; %%0.005m ld = 0.04; %%0.04m wc = 131; %%w=131rad/s theta = 360/z; tempphi=0; tempsi=0; row = 1; j=1; %counter for increment in defect angle
for t=0:37e-6:time %%time increment si(j)=tempsi; %%initialize defect angle
for i=1:1:z %%ball increment
phi(i)=tempphi; %%ith ball angle
disp('phi = '); phi(i)
if (phi(i) == si(j)) %%condition for ball in defect region
thetat = (wc*t) + (2*3.14/z*(z-i))
Fxd(row,i)= K* (x* cos(phi(i)*(pi/180)) + y* sin(phi(i)*(pi/180)) - (C + H * sin(3.14/(ld*(thetat-phi(i)*(pi/180)))))).^(3/2) * cos(phi(i)*(pi/180));
disp('Fxd value');
disp(Fxd(row,i));
Fyd(row,i)= K* (x* cos(phi(i)*(pi/180)) + y* sin(phi(i)*(pi/180)) - (C + H * sin(3.14/(ld*(thetat-phi(i)*(pi/180)))))).^(3/2) * sin(phi(i)*(pi/180));
disp('Fyd value');
disp(Fyd(row,i));
disp('defect ball position');
else %%condition for ball in non-defect region
Fx(row,i)= K* (x* cos(phi(i)*(pi/180)) + y* sin(phi(i)*(pi/180)) - C).^(3/2) * cos(phi(i)*(pi/180));
disp('Fx value');
disp(Fx(row,i));
Fy(row,i)= K* (x* cos(phi(i)*(pi/180)) + y* sin(phi(i)*(pi/180)) - C).^(3/2) * sin(phi(i)*(pi/180));
disp('Fy value');
disp(Fy(row,i));
disp('other balls position');
end
tempphi = phi(i) + theta;
end
tempphi = 0;
tempsi = si(j) + 45;
if(tempsi >= 360)
tempsi = 0
end
j = j + 1;
row = row + 1;
end