cable - for ii = 2:60 % Calculate tension dist(ii) = ii/10...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Program cable.m % % Purpose : % To calculate the connection poin that results in % minimum tension on a cable. % % Define variables: % dist -- Distance to attachment (ft) % lc -- Cable length (ft) % ii -- Index variable % lp -- Pole length (ft) % saved_dist -- Save attachment distance % saved_tension -- Saved tension % tension -- Tension on cable % weight -- Weight of object (lbs) % Initial values lc = 8; lp = 8; weight = 200; % Calculate tension at 0.1 ft dist(1) = 1.0; tension(1) = weight * lc * lp / (dist(1) *sqrt(lp^2 - dist(1)^2) ); % Save initial values for comparision saved_dist = dist; saved_tension = tension; % Calculate for other values between 1 and 7 ft
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for ii = 2:60 % Calculate tension dist(ii) = ii/10 +1; tension(ii) = weight * lc * lp / (dist(ii)* sqrt(lp^2 - dist(ii)^2)); % Find minimum tension point if tension(ii) < saved_tension saved_tension = tension(ii); saved_dist = dist(ii); end end % Display minimum tension point disp(['Minimum tension at ' num2str(saved_dist)]); disp(['Minimum tension = ' num2str(saved_tension)]); % Plot tension vs distance figure(1); plot(dist,tension,'b-','LineWidth',2); grid on; title('\bfPlot of tension vs attachment distance'); xlabel('\bfDistance'); ylabel('\bfTension');...
View Full Document

Ask a homework question - tutors are online