Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kkirsche/python-madelungconstant

Use python to calculate the madelung constant
https://github.com/kkirsche/python-madelungconstant

Last synced: about 1 month ago
JSON representation

Use python to calculate the madelung constant

Awesome Lists containing this project

README

        

python-MadelungConstant
=======================

Use python to calculate the madelung constant for NaCl.

This program is an answer to exercise 2.8 (pg. 73) of Chapter 2, Python Programming for Physists, of [Computational Physics](http://www.amazon.com/Computational-Physics-Edition-Nicholas-Giordano/dp/0131469908/ref=sr_1_1?ie=UTF8&qid=1359335955&sr=8-1&keywords=computational+physics)

The prompt is:
Write a program to calculate and print the Madelung constant for sodium chloride.
Use as large a value of L as you can, while still having your program run in reasonable
time—say in a minute or less.

madelung.py is the fastest, but consumes a large amount of memory
madelung-v2-betterExplanation.py explains some of what is happening and why, but isn't as fast.

The last is a while loop version that is highly inefficient.