Hi there,
Just for a bit of fun, I wanted to write a notebook to take a line of hydrogen atoms and calculate the gravity exerted on each atom by all the other atoms in the line. I'd like to add as many quantum or other effects as possible to make it as accurate as possible. Any suggestions/help would be really appreciated. The code I have so far is:
(* Set up the parameters *)
G = 6.6743*10^-11;(* Gravitational constant in m ^ 3 kg ^ -1 s ^ -2 *)
m = 1.6737236*10^-27;(* Mass of a hydrogen atom in kg *)
r = 1*10^-10;(* Assumed distance between atoms in m *)
numAtoms = 101;(* Number of atoms *)
(* Calculate the gravitational force on each atom *)
forces = Table[
G*m^2*Sum[
If[i == j, 0, Sign[i - j]/(r*Abs[i - j])^2],
{j, 1, numAtoms}
],
{i, 1, numAtoms}
];
(* Plot the forces *)
ListLinePlot[forces,
AxesLabel -> {"Atom number", "Gravitational force (N)"}]