(no subject)
Mar. 13th, 2004 12:51 pmInvestigations
With the addition of a new subroutine to the code, it is possible to make reliable measurements of the dimentionality of the aggregate. This subroutine is outline below.
Declares that this is a routine to be called by the void command, taking no argmeunts
void dimension()
{
Declares that this routine will contain the variables I,x,y which are integers and Rn,particals_less_than_R, which are doubles ( a type of floating point decimal)
int i,x,y;
double Rn,particals_less_than_R;
counts Rn 10/50ths of the finished aggregates rmax to 40/50ths, in 50ths. This means that the outermost fringes of the aggregate, which are yet to become fully developed are not considered, and the innermost area of the aggregate where there is only a small number of particles to average over is not considered.
for(i=10;i<40;i++)
{Rn=i*rmax/50;
sets the number of particals so far counted to 0
particals_less_than_R=0;
scans through all the squares on the grid
for(x=0;x<N;x++) {for(y=0;y<N;y++) checks if the currently considered square contains a particle {if (grid[x][y] != 0) checks if the currently considered square is within radius Rn {if ((x-N/2)*(x-N/2) + (y-N/2)*(y-N/2) < Rn*Rn) if both these checks are true, increments the value of particals_less_than_R particals_less_than_R++; } } } prints the number of particles within Rn and Rn to the output file fprintf(fp, "%f, %f \n", log(Rn),log(particals_less_than_R*1.0)); } }
With the addition of a new subroutine to the code, it is possible to make reliable measurements of the dimentionality of the aggregate. This subroutine is outline below.
Declares that this is a routine to be called by the void command, taking no argmeunts
void dimension()
{
Declares that this routine will contain the variables I,x,y which are integers and Rn,particals_less_than_R, which are doubles ( a type of floating point decimal)
int i,x,y;
double Rn,particals_less_than_R;
counts Rn 10/50ths of the finished aggregates rmax to 40/50ths, in 50ths. This means that the outermost fringes of the aggregate, which are yet to become fully developed are not considered, and the innermost area of the aggregate where there is only a small number of particles to average over is not considered.
for(i=10;i<40;i++)
{Rn=i*rmax/50;
sets the number of particals so far counted to 0
particals_less_than_R=0;
scans through all the squares on the grid
for(x=0;x<N;x++) {for(y=0;y<N;y++) checks if the currently considered square contains a particle {if (grid[x][y] != 0) checks if the currently considered square is within radius Rn {if ((x-N/2)*(x-N/2) + (y-N/2)*(y-N/2) < Rn*Rn) if both these checks are true, increments the value of particals_less_than_R particals_less_than_R++; } } } prints the number of particles within Rn and Rn to the output file fprintf(fp, "%f, %f \n", log(Rn),log(particals_less_than_R*1.0)); } }