%% Function name % strainglocallaminate %% Revised: % 3 February 2014 %% Author % Necip Kayim, Trey Moore, & Autar Kaw % Section: All % Semester: Fall 2013 %% Purpose % Given the number of plies, angle of each ply, as well as the global % strains, output the local strains at the top, middle, and bottom of % each laminate %% Usage % function [strainlocalplies] = strainlocallaminate(strainglobalplies,angleplies,nplies) % Input variables % strainglobalplies=global strains at top, middle, and bottom of each laminate % angleplies=the angle of each ply in degrees % nplies=number of plies % Output variables % strainlocalplies=local strains at top, middle, and bottom of each laminate % Keyword % local strain matrix % global strain matrix % transformation of strains %% License Agreement % http://www.eng.usf.edu/~kaw/OCW/composites/license/limiteduse.pdf %% Code function [strainlocalplies] = strainlocallaminate(strainglobalplies,angleplies,nplies) % Reuter matrix R=[1 0 0;0 1 0;0 0 2]; Rinv=inv(R); for k=1:1:nplies % Angle of ply angle=angleplies(k); % Sine of the angle of the lamina s=sind(angle); % Cosine of the angle of the lamina c=cosd(angle); % Transformation Matrix T=[c^2 s^2 2*s*c; s^2 c^2 -2*s*c; -s*c s*c c^2-s^2]; % Top, middle, and bottom global strains for i=1:1:3 strainglobalTop(i)=strainglobalplies(1,i,k); strainglobalMid(i)=strainglobalplies(2,i,k); strainglobalBot(i)=strainglobalplies(3,i,k); end % Top, middle, and bottom local strains strainlocalTop=R*T*Rinv*strainglobalTop'; strainlocalMid=R*T*Rinv*strainglobalMid'; strainlocalBot=R*T*Rinv*strainglobalBot'; for i=1:1:3 strainlocalplies(1,i,k)=strainlocalTop(i); strainlocalplies(2,i,k)=strainlocalMid(i); strainlocalplies(3,i,k)=strainlocalBot(i); end end