%% Function name % VfVmrhoc %% 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 [Vf,Vm,rhoc] = VfVmrhoc(rhof,rhom,Wf) % Input Variables % rhof=fiber density % rhom=matrix density % Wf=weight fraction % Output Variables % Vf=fiber volume fraction % Vm=matrix volume fraction % rhoc=density of lamina % Keyword % volume 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=2.5; rhom=1.2; fprintf('\nFiber Density: %g ',rhof) fprintf('\nMatrix Density: %g ',rhom) %% Test 1 % Testing for a particular Wf % Input desired Wf Wf=0.829384; % Call function: volumefrac [Vf,Vm,rhoc] = VfVmrhoc(rhof,rhom,Wf); % Results for a particular Wf fprintf('\n\nWeight Fraction: %G\n\n',Wf) disp(' Lamina Density/Volume Fractions') disp('___________________________________________________') fprintf('\n Vf | %G\n Vm | %G\n rhoc | %G\n\n\n\n',... Vf,Vm,rhoc) %% Test 2 % Table of Density/Volume Fractions of a Unidirectional Lamina % as a Function of Weight Fraction for i=1:1:11 Wf(i)=i/10-0.1; [Vf,Vm,rhoc] = VfVmrhoc(rhof,rhom,Wf(i)); VF(i)=Vf; VM(i)=Vm; Rhoc(i)=rhoc; end % Table of results disp(' Lamina Coefficient of Thermal Expansion') disp('______________________________________________________________') disp(' Wf | Vf | Vm | rhoc ') for i=1:1:11 fprintf(' %3.2f | %E | %E | %g\n',Wf(i),VF(i),VM(i),Rhoc(i)) end %% Test 3 % Graph of Density/Volume Fractions of a Unidirectional Lamina % as a Function of Weight Fraction for i=1:1:101 Wf(i)=i/100-0.01; [Vf,Vm,rhoc] = VfVmrhoc(rhof,rhom,Wf(i)); VF(i)=Vf; VM(i)=Vm; Rhoc(i)=rhoc; end figure hold on plot(Wf,VF,'LineWidth',2) plot(Wf,VM,'r','LineWidth',2) grid legend('Vf','Vm') title('Volume Fractions vs. Weight Fraction') xlabel('Weight Fraction') ylabel('Volume Fractions') hold off figure hold on plot(Wf,Rhoc,'b','LineWidth',2) grid title('Density vs. Weight Fraction') xlabel('Weight Fraction') ylabel('Density') hold off