Stochastic Fibre Networks

By S. Yang and C.T.J. Dodson
yang@ecf.utoronto.ca
dodson@ecf.utoronto.ca

This Notebook arose from research on the statistical geometry of stochastic fibre networks. Quite a lot of theory exists for the purely random case, based on a Poisson process, but little has been done for the non-random case when the fibres aggregate. Here we use CRAY-generated aggregation data and animate a sequence of networks passing through random dispersed and aggregated phases. The work on aggregation has applications in many industrial processes, for a discussion of the modelling of paper see the book by M. Deng and C.T.J. Dodson, `Paper: An Engineered Stochastic Structure' Tappi Press, Atlanta 1994.

Initialization

Install["Localarealdensity"];      (* install C external program *)
<<Statistics`DescriptiveStatistics`
<<Statistics`DataManipulation`
<<Graphics`Graphics`
sidelength=0.1;						(* set up the square zone side*)

Mathematica main program.

This main program  is used to generate the two dimensional fibre networks and also to plot the local areal density distridution histogram in those networks. An external C program is called in Mathematica via MathLink. Before running the main program, please compile the C program as follows:
mcc Localarealdensity.c Localarealdensity.tm -o Localarealdensity

filename = ReadList["datafile",String];
lengthdatafile = Count[filename,_];
For [f=1, f<=lengthdatafile, f++,
xy = ReadList[filename[[f]],{Number,Number}];	(* read fibe center data *)
	xi=Table[xy[[i,1]]/60, {i,2000}];
	yi=Table[xy[[i,2]]/60, {i,2000}];
	ai=Table[Random[Real], {i,2000}];			(* generate fibre angles *)
 	t1=Table[{xi[[i]]-0.05 Cos[ai[[i]]Pi//N],yi[[i]]
       -0.05 Sin[ai[[i]]Pi//N]}, {i,2000}];	(* starting point of the fibre *)  
	t2=Table[{xi[[i]]+0.05 Cos[ai[[i]]Pi//N],yi[[i]]
    	+0.05 Sin[ai[[i]]Pi//N]}, {i,2000}];	(* end point of the fibre *)
	tabline=Table[{RGBColor[1,1,0], Line[{t1[[i]], t2[[i]]}]}, 
  	{i,2000}];
	floclines=Graphics[tabline];	
	draw1=Show[floclines,Background->RGBColor[0,0,1],
		AspectRatio->Automatic, DisplayFunction->Identity];	
	datalist=Join[xi,yi,ai];
	datasend=Insert[datalist,sidelength,1];
	LocalArealDensity[datasend];				 (* call the external C program *)
	Mrs=ReadList["leng.asc", Real]/2;
	classes=10;
	Mrsmax=Max[Mrs];
	Mrsmin=Min[Mrs];
	datamin=Floor[Mrsmin]//N;
	datamax=Ceiling[Mrsmax]//N;
	step=(datamax-datamin)/classes;
	reMrs=Table[datamin+Ceiling[(Mrs[[i]]-datamin)/step]*step,
		 {i,1,100}];
	freM=Frequencies[reMrs];
	n=Length[freM];
	x1=Table[freM[[i,1]],{i,1,n}];
	x2=Table[freM[[i,2]],{i,1,n}];
	If[Last[x2]!=2.0, {x2=Insert[x2,2.0,-1],
		 x1=Insert[x1,0,-1]}];
	For [i=1,i<=9,i++,
		If [x2[[i]]!=0.2+0.2i,
	 	{x2=Insert[x2,0.2+0.2i,i], x1=Insert[x1,0,i]}];
		];
	b={};
	For [i=1,i<=9,i++,
		b=Insert[b,x1[[i]],-1];
		b=Insert[b,x2[[i]],-1];
		];
	reb=Partition[b,2];		
	$DefaultFont={ "Courier", 10};
	draw2=BarChart[reb, PlotRange->{{0,10},{0,80}},
	                DisplayFunction->Identity];
    datalocalarealdensity=ReadList["leng.asc", Real];
	Varrealpaper=Variance[datalocalarealdensity];
	Varrandom=.159067;
	nf=Varrealpaper/Varrandom;
	$DefaultFont={ "Courier-Bold", 14};
	a=Show[Graphics[Text[nf, {4,75}, {-1,0}]], 
		DisplayFunction->Identity];
	b=Show[Graphics[Text[FontForm["nf= ", {"Courier-Bold", 12}], 
	  {4,75}, {1,0}]], DisplayFunction->Identity];
	d=Show[b,a, DisplayFunction->Identity];
	$DefaultFont={ "Courier", 10};
	draw2'=Show[draw2,d, DisplayFunction->Identity];
	Show[GraphicsArray[{draw1, draw2'}]];
	];