This program is used to hopefully find the natural frequency of torsional vibration in a shaft containing 11 rotating masses, using my take on Holzer's method (or Holzer's Table) by calculating where the residual torque of the last rotating member on the shaft is 0 under a certain frequency.
I need to plot w or w^2 (frequency) against the residual torque S(11) (sum of the torques evaluated up to J(11)), for different values of "w", but the program doesn't seem to solve "S(11)" for different "w" as there are only 11 values of "S" (S(1) to S(11),) for 1000 values of "w". Is there a way to evaluate S(11) for all w? Sorry I'm not really good in matlab.
T(1) = J(1)*a(1)*(w(i)^2);
a(n) = a(n-1) - (J(n-1)*E(n-1)*a(n-1)*w(i)^2);
a(n) = a(n-1) - S(n-1)*E(n-1);