Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/kkirsche/python-madelungconstant
- Owner: kkirsche
- Created: 2013-01-28T00:55:37.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-29T00:25:53.000Z (almost 12 years ago)
- Last Synced: 2023-03-15T06:15:47.640Z (almost 2 years ago)
- Language: Python
- Size: 113 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.