| % Recursive algorithm |
| clear,clc,format compact |
| FiFEA=[0:15:345];%whole turn of the shaft 360 deg, every 15 deg -> reaction forces 0–345 deg |
| %example shaft: S-12075-3600-10-8-149-144-C-04, example main journal: #10, FEA reaction forces: |
| RFEA=[749.87 768.80 775.20 767.37 747.40 720.64 694.26 675.33 668.93 676.77 696.74 723.50 749.87 768.80 775.20 767.37 747.40 720.64 694.26 675.33 668.93 676.77 696.74 723.50]; |
| DeltaFi=1;% calculation step (deg) |
| R0=mean(RFEA); |
| disp([‘Mean value of the reaction forces: ‘ num2str(R0) ‘ N’]) |
| CR2=0.5*(max(RFEA)-min(RFEA)); |
| disp([‘Reaction forces amplitude of the 2nd harmonic: ‘ num2str(CR2) ‘ N’]) |
| for j=1:360 % calculation loop |
| FiR2=(j-1)*DeltaFi; |
| P1=RFEA-(R0+CR2*sind(FiFEA*2+FiR2)); |
| Q(j)=P1*P1’; % sum of squares of deviations |
| end |
| k=length(Q); |
| [Qmin,L]=min(Q); |
| [Qmax,H]=max(Q); |
| FiR2a=L-1; |
| FiR2b=H+1; |
| disp([‘Reaction forces phase shift of the 2nd harmonic: ‘ num2str(FiR2a) ‘ deg’]) |