Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Chemistry Code

Name: Anonymous 2013-09-11 14:50

I'm studying chemistry and wrote the following code to calculate electron configuration by element symbol:

(defun electron-configuration (n)
  (let* ((os '(s p d f g h i))
         (r nil)
         (y 0)
         (i 0))
    (print n)
    (while (< i n)
      (dotimes (k (+ y 1))
        (let ((x (- y k)))
          (when (and (>= (- y (* 2 x)) 0) (> (- n i) 0))
            (let* ((orbital-capacity (* 2 (+ 1 (* x 2))))
                   (inc (min (- n i) orbital-capacity)))
              (push (list (- (+ y 1) x) (nth x os) inc) r)
              (incf i inc)))))
      (incf y))
    (nreverse r)))


is it correct? what orbitals should go after f?

Name: Anonymous 2013-09-11 17:27

>>1

It is not after the f-orbital. For example an s-orbital can  occupy any shell. The letters refers to the angular momentum. An f-orbital is an orbital with an angular momentum of 3.

An electron orbital is defined by three numbers. N, which is the discrete energy of the orbital. L which is the angular momentum and M which is the magnetic momentum. (And the spin number)

So if you want to count further than f, you need a proper model. The rule of thumb is this:

n goes from 1 to infinity
l goes from 0 to (n - 1)  # - n possibilities
m goes from -l to l       # - 2 * n possibilities

so in any shell n, we can stack:

2 n^2 electrons.

To understand these numbers you actually need to work out the non relativistic qm model once. You will see, where these are coming from. It are actually standing waves and are some pretty peculiar functions.

But this model still doesn't address all issues:

The shells are not filled in order (as you might expect) and in the higher shells electrons start to behave relativistic, so you need an even more complex model to start working with the higher shells.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List