%% Function name % straingloballaminate %% Revised: % 3 February 2014 %% Author % Kevin R. Johnson, Trey Moore, & Autar Kaw % Section: All % Semester: Fall 2013 %% Purpose % Given the mid-plane strains and curvatures as well as the thickness of % each ply, output the global strains at the top, middle, and bottom of % each laminate %% Usage % function [strainglobalplies] = straingloballaminate(eps0,kappa,nplies,tplies) % Input variables % eps0=midplane strains % kap=midplane curvatures % nplies=number of plies % tplies=thickness of each ply % Output variables % strainglobalplies=global strains at top, middle, and bottom of each laminate % Keyword % strain-displacement equations % global strains % midplane strains and curvatures %% License Agreement % http://www.eng.usf.edu/~kaw/OCW/composites/license/limiteduse.pdf %% Testing code clc clear all %% Inputs % Material: Ex 4.3 eps0=[3.123E-7,3.492E-6,-7.598E-7]; kappa=[2.971E-5,-3.285E-4,4.101E-4]; nplies=3; tplies=[5E-3,5E-3,5E-3]; fprintf('Number of plies: %g\n',nplies) for i=1:1:nplies fprintf('\nFor Ply: %g\n',i) fprintf('\n Thickness of Ply: %g',tplies(i)) fprintf('\n Midplain Strain: %g',eps0(i)) fprintf('\n Midplane Curvature: %g\n\n',kappa(i)) end %% Test % Call function: straingloballaminate strainglobalplies = straingloballaminate(eps0,kappa,nplies,tplies); for k=1:1:nplies fprintf('\n\nFor Ply: %g\n\n',k) disp(' Global Strains') disp('___________________________________________') for i=1:1:3 x=i; if x==1 disp(' Top') end if x==2 disp(' Middle') end if x==3 disp(' Bottom') end for j=1:1:3 y=j; if y==1 fprintf(' Epsx | %G\n',strainglobalplies(i,j,k)) end if y==2 fprintf(' Epsx | %G\n',strainglobalplies(i,j,k)) end if y==3 fprintf(' Gammaxy | %G\n',strainglobalplies(i,j,k)) end end end end