%% Function name % stresslocallaminate %% Revised % 3 February 2014 %% Authors % Prashanth Sridharan, Trey Moore, & Autar Kaw % Section: All % Semester: Fall 2013 %% Purpose % Given the number of angle plies, the angle of each ply, and the % global stress of each of the plies, output the global stresses for each ply %% Usage % function [stresslocalplies] = stresslocallaminate(stressglobalplies,angleplies,nplies) % Input variables % stressglobalplies=global stress at top, middle, and bottom of each laminate % nplies=number of plies % angleplies=angle of each ply % Output variables % stresslocalplies=local stress at top, middle, and bottom of each laminate % Keyword % global strain % global stress %% License Agreement % http://www.eng.usf.edu/~kaw/OCW/composites/license/limiteduse.pdf %% Code function [stresslocalplies] = stresslocallaminate(stressglobalplies,angleplies,nplies) % TREY: Move all comments to separate lines for k=1:nplies %loop to calculate for ply k % Angle of ply angle= angleplies(1,k); % Calculating the sine of the desired angle s=sind(angle); % Calculating the cosine of the desired angle c=cosd(angle); for i=1:3 % Global stress in each direction sigx=stressglobalplies(i,1,k); sigy=stressglobalplies(i,2,k); sigxy=stressglobalplies(i,3,k); % Local stress in each direction stresslocalplies(i,1,k) = (c^2)*sigx + (s^2)*sigy + 2*s*c*sigxy; stresslocalplies(i,2,k) = (s^2)*sigx + (c^2)*sigy + (-2)*s*c*sigxy; stresslocalplies(i,3,k) = (-1)*s*c*sigx + s*c*sigy + (c*c - s*s)*sigxy; end end end