function [Fx, Fy, Fz, Tx, Ty, Tz, Fxp, Fyp, Fzp, Txp, Typ, Tzp] = SBT_helical_Lighthill_1(a_lambda, theta, nlength, res, v, R, b, h) % Note that these output forces are normalized by 4 pi mu! function m = rotmatrix(angle) m=[cos(angle), -sin(angle), 0; sin(angle), cos(angle), 0; 0, 0, 1]; end % phin = 1, phim = 2 phimin=0; phimax=nlength*(2*pi); xi=@(phi) sqrt(2 - 2*cos(phi(2)-phi(1))+(phi(2)-phi(1))^2/(tan(theta)^2)); % norm of r(phi2)-r(phi1)) - normalized by R, its dimensionless fx12=@(phi) [cos(phi(1))-cos(phi(2)), sin(phi(1))-sin(phi(2)), (phi(1)-phi(2))/tan(theta)]; % (r(phi2)-r(phi1)) - normalized by R, its dimensionless px12=@(phi) (rotmatrix(-phi(1))*(fx12(phi)'*fx12(phi))*rotmatrix(phi(2))/xi(phi)^3+rotmatrix(phi(2)-phi(1))/xi(phi)); % non- dimensionalized by 1/R Xnorm = @(phi) sqrt(R^2 + (R*phi/tan(theta)+b+h)^2); % has apt dimensions Xj = @(phi) [R*cos(phi); R*sin(phi); R*phi/tan(theta)+b+h]; % has apt dimensions nres=floor(nlength*res+.5); dphi=(phimax-phimin)/nres; vphi=phimin+.5*dphi:dphi:phimax-.5*dphi; mattr=zeros(3*nres, 3*nres); cutofflen=a_lambda*pi*exp(0.5)*cos(theta); cl=log(.5*dphi/cutofflen); % Approximation! for i=1:nres mattr(i,i)=1+cl; mattr([nres+i, 2*nres+i], [nres+i, 2*nres+i])=[cos(theta)^2+(1+sin(theta)^2)*cl, (cl-1)*sin(theta)*cos(theta); (cl-1)*cos(theta)*sin(theta), sin(theta)^2+(1+cos(theta)^2)*cl]; end for i=1:nres for j=1:nres if (abs(vphi(i)-vphi(j))