The semi-empirical mass formula parameters used in the previous post were taken from the text book of J. W. Rohlf (1994) . Another, older set of parameters are presented in the compilation of A. H. Wapstra (1958). Below we compare each with the experimental data …
The binding energy of a nucleus is the energy that would be required to split apart each of its constituent protons and neutrons (nucleons). This energy is due to the forces that hold the nucleus together, which may be thought of as a balance between …
The standard way to bin a large array to a smaller one by averaging is to reshape it into a higher dimension and then take the means over the appropriate new axes. The following function does this, assuming that each dimension of the new shape …
The multivariate Gaussian distribution of an -dimensional vector may be written where is the -dimensional mean vector and is the covariance matrix. To visualize the magnitude of as a function of all the dimensions requires a plot in dimensions, so visualizing this distribution for is …
The Cambridge Crystallographic Data Centre is a non-profit organisation devoted to small-molecule crystallography data. It curates, validates and distributes the Cambridge Structural Database (CSD) of over 800,000 organic and metal-organic crystal structures. The CSD has an excellent Python API which can be used to analyse …
In the gradient descent method of optimization, a hypothesis function, , is fitted to a data set, () by minimizing an associated cost function, in terms of the parameters . The cost function describes how closely the hypothesis fits the data for a given choice …
If you join the positions of Earth and Venus with a straight line and follow them as they orbit the sun, you get a nice picture that has been popular on Facebook. Here's the Python code for generating a similar diagram. The figure has the …
A family of curves in the complex plane may be generated by the formula: for . The plotted curve displays fold rotational symmetry. Here's the Python code to generate the curve (run as python mystery_curve.pyk). This code is also available on my GitHub page. For …
Here is a short Python program to visualize the table of multiplication modulo . The integers and number the rows and columns of the image plot produced. and are supplied as command line arguments (if is not supplied, it defaults to ). This code is …
LineTicks is a simple class that I put together to add tick marks and labels to a plotted line (not the axes, which Matplotlib already handles well with lots of methods for customization). The code is available on GitHub and released under the Apache 2.0 …