%% Function name % WfWmrhoc %% Revised % 3 February 2014 %% Authors % Joshua Bigham, Trey Moore, & Autar Kaw % Section: All % Semester: Fall 2013 %% Purpose % Given densities of the fiber and matrix, as well as the weight volume % fraction, output the volume fractions for the fiber and matrix of the lamina %% Usage % function [Wf,Wm,rhoc] = WfWmrhoc(rhof,rhom,Vf) % Input Variables % rhof=fiber density % rhom=matrix density % Vf=fiber volume fraction % Output Variables % Wf=fiber weight fraction % Wm=matrix weight fraction % rhoc=density of lamina % Keyword % weight fraction % density %% License Agreement % http://www.eng.usf.edu/~kaw/OCW/composites/license/limiteduse.pdf %% Testing code clc clear all %% Inputs % Material: Graphite/Epoxy rhof=2500; rhom=1200; fprintf('\nFiber Density: %g ',rhof) fprintf('\nMatrix Density: %g ',rhom) %% Test 1 % Testing for a particular Vf % Input desired Vf Vf=0.7; % Call function: volumefrac [Wf,Wm,rhoc] = WfWmrhoc(rhof,rhom,Vf); % Results for a particular Vf fprintf('\n\nVolume Fraction: %G\n\n',Vf) disp(' Lamina Density/Weight Fractions') disp('___________________________________________________') fprintf('\n Wf | %G\n Wm | %G\n rhoc | %G\n\n\n\n',... Wf,Wm,rhoc) %% Test 2 % Table of Density/Weight Fractions of a Unidirectional Lamina % as a Function of Volume Fraction for i=1:1:11 Vf(i)=i/10-0.1; [Wf,Wm,rhoc] = WfWmrhoc(rhof,rhom,Vf(i)); WF(i)=Wf; WM(i)=Wm; Rhoc(i)=rhoc; end % Table of results disp(' Lamina Coefficient of Thermal Expansion') disp('______________________________________________________________') disp(' Vf | Wf | Wm | rhoc ') for i=1:1:11 fprintf(' %3.2f | %E | %E | %g\n',Vf(i),WF(i),WM(i),Rhoc(i)) end %% Test 3 % Graph of Density/Weight Fractions of a Unidirectional Lamina % as a Function of Volume Fraction for i=1:1:101 Vf(i)=i/100-0.01; [Wf,Wm,rhoc] = WfWmrhoc(rhof,rhom,Vf(i)); WF(i)=Wf; WM(i)=Wm; Rhoc(i)=rhoc; end figure hold on plot(Vf,WF,'LineWidth',2) plot(Vf,WM,'r','LineWidth',2) grid legend('Vf','Vm') title('Weigth Fractions vs. Volume Fraction') xlabel('Volume Fraction') ylabel('Weight Fractions') hold off figure hold on plot(Vf,Rhoc,'b','LineWidth',2) grid title('Density vs. Volume Fraction') xlabel('Volume Fraction') ylabel('Density') hold off