%% Function name % strain_gtol %% Revised: % 16 January 2014 %% Author % Howard Fox, Trey Moore, & Autar Kaw % Section: All % Semester: Fall 2012 %% Purpose % Given the global strains and the angle of the ply for a unidirectional % lamina, output the local strains %% Usage % function [strain_loc] = strain_gtol(strain_glo,angle) % Input variables % strain_glo=vector of global strain applied to unidirectional lamina % [strain_glo]=[epsx;epsy;epsxy] % epsx=longitudinal global strain % epsy=transverse global strain % epsxy=in-plane global strain % angle=angle of ply in degrees % Output variables % strain_loc=vector of local strain applied to unidirectional lamina % [strain_loc]=[eps1;eps2;eps12] % Keyword % local strain matrix % global strain matrix % transformation of strains %% License Agreement % http://www.eng.usf.edu/~kaw/OCW/composites/license/limiteduse.pdf %% Testing code clc clear all %% Inputs [strain_glo]=[1.2;3.6;0.023]; fprintf('\nLongitudinal Global Strain: %g ',strain_glo(1)) fprintf('\nTransverse Global Strain: %g ',strain_glo(2)) fprintf('\nIn-Plane Global Strain: %g \n\n\n',strain_glo(3)) %% Test 1 % Testing for individual angle % Input desired angle in degrees angle=60; % Call function: strain_gtol [strain_loc] = strain_gtol(strain_glo,angle); % Results for a particular angle fprintf('\n\nAngle of Lamina: %G\n\n',angle) disp(' Local Strains for Lamina') disp('_________________________________') fprintf('\n eps1 | %G\n eps2 | %G\n eps12 | %G\n\n\n\n',... strain_loc(1),strain_loc(2),strain_loc(3)) %% Test 2 % Table of Local Strains of an Angle Lamina % as a Function of Fiber Angle for i=1:5:91 angle(i)=i-1; [strain_loc] = strain_gtol(strain_glo,angle(i)); eps1(i)=strain_loc(1); eps2(i)=strain_loc(2); eps12(i)=strain_loc(3); end disp(' Local Strains for Lamina') disp('__________________________________________________________________________') disp(' angle eps1 eps2 eps12 ') for i=1:5:91 fprintf('\t%2.0f |\t %E |\t %E |\t %E \n',angle(i),eps1(i),eps2(i),eps12(i)) end %% Test 3 % Graph of Local Strains of an Angle Lamina % as a Function of Fiber Angle for i=1:1:91 angle(i)=i-1; [strain_loc] = strain_gtol(strain_glo,angle(i)); eps1(i)=strain_loc(1); eps2(i)=strain_loc(2); eps12(i)=strain_loc(3); end hold on plot(angle,eps1,'b','LineWidth',2) plot(angle,eps2,'r','LineWidth',2) plot(angle,eps12,'m','LineWidth',2) grid legend('eps1','eps2','eps12') title('Local Strains vs. Fiber Angle') xlabel('Angle (degrees)') ylabel('Local Strains') hold off