2

I am trying to create a method (in java) to figure out the Electron Configuration for an element.

Ex.
He (2nd element: 2 electrons) Electron config: 1s2
O (8th element 8 electrons) Electron config: 1s2 2s2 2p4
Zr (40th element 40 electrons) Electron config: 1s2 2s2 2p6 3s2 3p6 4s2 3d10 4p6 5s2 4d2

How can I figure out the logic to calculate this? When to increment the s, p, d, and f shells, as well as figure out the superscript for each shell.

S max of 2 electrons (superscript max of 2)
P max of 6 electrons (superscript max of 6)
D max of 10 electrons (superscript max of 10)
F max of 14 electrons (superscript max of 14)

Recursion perhaps?

  • This should perhaps be on http://chemistry.stackexchange.com/? – Oliver Charlesworth Feb 09 '13 at 20:51
  • Shells -- perhaps ordered enums. Number of electrons, perhaps an enum map. – Hovercraft Full Of Eels Feb 09 '13 at 20:51
  • I'm sure you've tried something, right? Please share your latest unsuccessful attempt. – Sergey Kalinichenko Feb 09 '13 at 20:51
  • I've only tried on paper, but I still can't truly figure out how to do it in code. – user2057643 Feb 09 '13 at 20:54
  • 1
    I don't know how far along in chemistry you are, but I know that early chemistry classes like to teach filling electron orbitals according to the [Aufbau Principle](http://en.wikipedia.org/wiki/Aufbau_principle). Keep in mind though, it's only a rule of thumb, and as the atomic number gets higher, there are more and more exceptions due to quantum mechanical and other effects. – DPenner1 Feb 09 '13 at 21:18
  • I know of the Aufbau Principle, the Pauli exclusion Principle, and Hund's Rule. We learned them this week. – user2057643 Feb 09 '13 at 21:27

1 Answers1

1

You may create a class for represent the configuration with the following attributes:

private final boolean[] K = new boolean[ 2];
private final boolean[] L = new boolean[ 8];
private final boolean[] M = new boolean[18];
private final boolean[] N = new boolean[32];
private final boolean[] O = new boolean[32];
private final boolean[] P = new boolean[32];

true for an allocated place, false for a free place.

Example for potassium :

K[0] = true;
K[1] = true;
L[0] = true;
...
L[7] = true;
M[0] = true;
...
M[7] = true;
N[0] = true;
Aubin
  • 14,617
  • 9
  • 61
  • 84