%% Function name % beta_gtol %% Revised % 15 January 2014 %% Author % Younes Benkabbou, Trey Moore, & Autar Kaw % Section: All % Semester: Fall 2012 %% Purpose % Given the longitudinal and transverse coefficients of moisture % expansion of a unidirectional lamina, and the angle of the ply, % this function outputs the coefficients of moisture expansion for % an angle lamina. %% Usage % function [betaxy] = beta_gtol(beta12, angle) % Input variables % beta12=vector of moisture expansion of unidirectional lamina % in 1,2 direction % [beta12]=[beta1;beta2;zero] % beta1=longitudinal coefficient of moisture expansion. % beta2=transverse coefficient of moisture expansion. % beta12=in-plane coefficient of moisture expansion. % angle=angle of ply given in degrees. % Output variables % betaxy=vector of coefficients of moisture expansion for angle % in x,y direction % [betax,betay,betaxy] % Keyword % coefficient of moisture expansion % angle ply %% License Agreement % http://www.eng.usf.edu/~kaw/OCW/composites/license/limiteduse.pdf %% Testing Code clc clear all %% Inputs % Material: Glass/Epoxy beta1=0; beta2=0.6; [beta12]=[beta1;beta2;0]; fprintf('\nLongitudinal Coeff. of Moisture Expansion: %g ',beta1) fprintf('\nTransverse Coeff. of Moisture Expansion: %g ',beta2) %% Test 1 % Testing for individual angle % Input desired angle in degrees angle=60; % Call function: beta_gtol [betaxy] = beta_gtol(beta12,angle); % Results for a particular angle fprintf('\n\nAngle of Lamina: %G\n\n',angle) disp(' Lamina Coefficient of Moisture Expansion') disp('________________________________________________') fprintf('\n betax | %G\n betay | %G\n betaxy | %G\n\n\n\n',... betaxy(1),betaxy(2),betaxy(3)) %% Test 2 % Table of Moisture Expansion Coefficients of an Angle Lamina % as a Function of Fiber Angle for i=1:5:91 angle(i)=i-1; [betaxy] = beta_gtol(beta12,angle(i)); betax(i)=betaxy(1); betay(i)=betaxy(2); beta_xy(i)=betaxy(3); end disp(' Lamina Coefficient of Moisture Expansion') disp('_________________________________________________________________') disp(' angle betax betay betaxy ') for i=1:5:91 fprintf('\t%2.0f |\t %E |\t %E |\t %E \n', angle(i),betax(i),betay(i),beta_xy(i)) end %% Test 3 % Graph of Moisture Expansion Coefficients of an Angle Lamina % as a Function of Fiber Angle for i=1:1:91 angle(i)=i-1; [betaxy] = beta_gtol(beta12,angle(i)); betax(i)=betaxy(1); betay(i)=betaxy(2); beta_xy(i)=betaxy(3); end hold on plot(angle,betax,'b','LineWidth',2) plot(angle,betay,'r','LineWidth',2) plot(angle,beta_xy,'m','LineWidth',2) grid legend('betax','betay','betaxy') title('Coefficient of Moisture Expansion vs. Fiber Angle') xlabel('Angle (degrees)') ylabel('Coefficient of Moisture Expansion') hold off