Documente Academic
Documente Profesional
Documente Cultură
7x7 Grid. (50% probability at b=0.48) 9x9 Grid. (50% probability at b=0.49)
Figure-2. The value of b for which probability is 50% seems to be moving to the right and
seems to be getting closer to a value around 0.5.
3x3 Grid. (min avg resistance at b=0.05) 5x5 Grid (min avg resistance at b=0.15
7x7 Grid (min avg resistance at b=0.2) 9x9 Grid (min avg resistance at b=0.3)
Figure-3. The value of b for which resistance starts to be not infinite seems to be moving to
the right.
3. Discussion
From the above graphs, one can imply two 4. Appendix
trends. The first comes from the
Here is Java Program we used for the
probability graph. It is clear from the
project.
graphs that as the grid size increases, the
probability curve gets closer and closer to
step curve. Thus, at infinite sized grid, the
curve would be a step curve, stepping at import java.io.*;
the percolation limit. This limit would then import com.xeiam.xchart.BitmapEncoder;
give us a value of b over which,
import com.xeiam.xchart.Chart;
percolation will happen, no matter what
the grid size. Due to computational limit, import com.xeiam.xchart.QuickChart;
our grid size could not be increased
import com.xeiam.xchart.SwingWrapper;
substantially, since the calculation at 9x9
grid took a long time. But with a more public class statmech
efficient program one can easily find the {
value for larger grids.
InputStreamReader read=new
The second implication comes from the InputStreamReader(System.in);
resistance curve. We can see that the value
of b for which average resistance finally BufferedReader in=new
becomes finite (not 100 in our case) also BufferedReader(read);
seems to be moving to the right. The trend int l;
here though is not as clear as the previous
int l1;
case. It is our hypothesis that this too will
reach a maximum which is less than 1 in double perco[][];
an infinite grid. Due to computational
int possibilities[][];
limits, we cannot check this hypothesis
ourselves. We also see that as vale of b double resistance;
increases, the average resistance (when
circuit is formed) also increases. This is
expected as for low values of b, if a circuit void input(double a)throws IOException
is formed, it is by definition formed by {
resistors with low resistances. Thus, as b
increases, the values of minimum average
resistance also increase. Lastly, we see the for(int i=0;i<l;i++)
obvious observation that as grid size
increases, value of min resistance also {
increases. This is due to the addition of for(int j=0;j<l;j++)
more resistances as grid size increases.
{
perco[i][j]=Math.pow(2.71828,Math.rando
m());
}
}
resistances();
for(int i=0;i<l;i++) }
{
for(int j=0;j<l;j++) void resistances()
{ {
if(i==j) for(int i=0;i<(l-l1);i++)
perco[i][j]=100; {
else int j=0;
perco[j][i]=perco[i][j]; if(i<l1)
{
} if(i==0)
{
} if(perco[i][i+1]!=100)
possibilities[i][j++]=i+1;
possibilities=new int[l][3];
resistance=0.0; if(perco[i][l1+i]!=100)
select(a); possibilities[i][j++]=l1+i;
} }
else if(i==(l1-1))
void select(double a) {
{ if(perco[i][i-1]!=100)
possibilities[i][j++]=i-1;
for(int i=0;i<l;i++) if(perco[i][l1+i]!=100)
{ possibilities[i][j++]=l1+i;
for(int j=0;j<l;j++) }
{ else
{
if(perco[i][j]>Math.pow(2.71828,a))
if(perco[i][i-1]!=100)
perco[i][j]=100;
possibilities[i][j++]=i-1;
}
if(perco[i][i+1]!=100)
}
possibilities[i][j++]=i+1;
if(perco[i][i+l1]!=100) }
possibilities[i][j++]=i+l1; }
}
} while(j<3)
else possibilities[i][j++]=-1;
{
if(i%l1==0) }
{
if(perco[i][i+1]!=100) for(int i=0;i<l;i++)
possibilities[i][j++]=i+1; {
for(int j=0;j<3;j++)
if(perco[i][i+l1]!=100) {
possibilities[i][j++]=i+l1; if(possibilities[i][j]!=-1)
} {
else if((i+1)%l1==0) double
min=perco[i][possibilities[i][j]];
{
int temp;
if(perco[i][i-1]!=100)
int index=j;
possibilities[i][j++]=i-1;
for(int k=j;k<3;k++)
{
if(perco[i][i+l1]!=100)
if(possibilities[i][k]!=-1)
possibilities[i][j++]=i+l1;
{
}
else if(perco[i][possibilities[i][k]]<min)
{ {
if(perco[i][i-1]!=100) min=perco[i][possibilities[i][k]];
possibilities[i][j++]=i-1; index=k;
if(perco[i][i+1]!=100) }
possibilities[i][j++]=i+1; }
if(perco[i][i+l1]!=100) }
possibilities[i][j++]=i+l1; temp=possibilities[i][j];
}
possibilities[i][j]=possibilities[i][index];
}
possibilities[i][index]=temp;
return flag;
}
}
}
}
}
{ double count=0.0;
{ for(int k=0;k<21;k++)
{
double a=array[k];
if(percolation(possibilities[f][j],f)) double avresis=0.0;
{ count=0.0;
for(int i=0;i<1000;i++)
resistance=resistance+perco[f][possibilitie
s[f][j]]; {
flag=true; input(a);
break; double resistanceF[]=new
double[l];
}
}
double min=100.0;
for(int j=0;j<l1;j++) resisplot[k]=100;
{ prob[k]=count/1000;
}
if(percolation(j,j))
{ for(int i=0;i<21;i++)
resistanceF[j]=resistance; {
resistance=0.0; System.out.println(resisplot[i]);
} System.out.println("prob=
"+prob[i]);
else
}
{
Chart chart =
resistanceF[j]=100.0; QuickChart.getChart("Average Resistance
resistance=0.0; vs b("+l1+"x"+l1+")", "b", "Resistance",
"Resistance(b)", array, resisplot);
}
Chart chart1 =
} QuickChart.getChart("Probability vs
b("+l1+"x"+l1+")", "b", "Probability",
"Probability(b)", array, prob);
for(int j=0;j<l1;j++)
new
{ SwingWrapper(chart).displayChart();
if(resistanceF[j]<min) new
SwingWrapper(chart1).displayChart();
min=resistanceF[j];
System.out.println("Press 0 to
}
stop");
if(min!=100)
{ if((Integer.parseInt(in.readLine()))==0)
count=count+1; break;
avresis=avresis+min; }while(true);
} }
}
}
avresis=avresis/count;
if(count!=0)
resisplot[k]=avresis;
else
Springer-Verlag Berlin Heidelberg
5. References GmbH.
B I Shklovskii, A L Efros (1984)
Electronic properties of Doped
Semiconductors (1st edition ebook),