Displaying 1 result from an estimated 1 matches for "10x10x10".
Did you mean:
0x10d10
2011 Sep 14
1
ruby to solve a physics question
...ere is what I have so far...
a6=0.0
for n1 in -10..10
for n2 in -10..10
for n3 in -10..10
if n1!=0 and n2!=0 and n3!=0
p=Math.sqrt(n1**2+n2**2+n3**2+n1*n2/1.414+n1*n3/1.41+n2*n3/1.414)
a6+=(1/p)**6
end
end
end
end
puts a6
What I''ve got here is a 10x10x10 face-centered cubic lattice of atoms.
What I want to do is find this constant a6= sum(1/Pij)**6. From a
starting point I want the distance to every other atom location point in
the structure, meanwhile inversing and power to the sixth each distance.
Then I want to add all those up. This should re...