All files in this repository are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.
This tutorial is written by Toon Verstraelen for students of the course "Elektriciteit, Magnetisme en Sensoren" (I002429) of the B.Sc. Bioscience Engineering at Ghent University.
This repository contains two Jupyter notebooks:
1_slice_of_numpy.ipynb
: a crash course on NumPy for absolute beginners. It does not attempt to give a complete introduction to NumPy. Instead, it covers only the basics needed to work on the second notebook.2_charge_nano.ipynb
: the assignment to be solved.
-
You can open the notebooks with Google Colab using the following links:
The second notebook needs additional data files. One of the code cells in the notebook can be used to download them into your runtime on Colab.
-
You can also work with the notebooks locally by downloading this repository as a ZIP file and unzipping it on your computer. You can then open the notebooks using Jupyter Lab or VSCode.
The charge model in this tutorial is a flavor of electronegativity equalization or charge equilibration. Although this model was originally proposed to calculate charge distributions in organic molecules, it is better suited to describe metallic systems. The energy as a function of the charges has the form:
with
where
The off-diagonal second-order terms represent the Coulumb interaction between point charges. To obtain a positive definite potential energy expression and to make the model a bit more realistic, we will use a damped electrostatic interaction instead:
It can be shown that the energy is positive definite for any configuration of the atoms when
The minimizer of the energy with a fixed total charge corresponds to the stationary point of the following Lagrangian:
The ground-state charge distribution is therefore found by solving the following system of linear equations: