https://github.com/kkirsche/python-madelungconstant
Use python to calculate the madelung constant
https://github.com/kkirsche/python-madelungconstant
Last synced: 4 months 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 (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-29T00:25:53.000Z (over 12 years ago)
- Last Synced: 2025-01-17T01:12:40.392Z (6 months ago)
- Language: Python
- Size: 113 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
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.