Retro programming nostalgia IV: Acid/Base Balance and Titration (Part II)

This second article continues my journey of acid/base titrations.  In the previous article (https://daniloroccatano.blog/2020/04/14/acidsand-bases-equilibrium/), I showed how to calculate an acid-base equilibrium for strong acids and bases. This article also describes subroutines for titrations of monoprotic weak acids and bases. The method I used solves the pH calculation precisely and is based on an article published in the chemistry journal “Rassegna chimica” by Prof Luigi Campanella (and Dr G. Visco) in 1985. I received a copy of the article from the author while attending his analytical chemistry course at the University “La Sapienza” in Rome. I remember writing a program for the study of titrations was fun and stimulating, but it helped me understand the subject thoroughly. I recommend that the young reader try to convert the program into a modern language more familiar to you (e.g., Python) to understand its functioning better.

Continue reading

A Practical Introduction to the C Language for Computational Chemistry. Part 3

Sphere. From Space, from Space, Sir: whence else?

Square. Pardon me, my Lord, but is not your Lordship already in Space, your Lordship and his humble servant, even at this moment?

Sphere. Pooh! what do you know of Space? Define Space.

Square. Space, my Lord, is height and breadth indefinitely prolonged.

Sphere. Exactly: you see you do not even know what Space is. You think it is of Two Dimensions only; but I have come to announce to you a Third — height, breadth, and length.

Square. Your Lordship is pleased to be merry. We also speak of length and height, or breadth and thickness, thus denoting Two Dimensions by four names.

Sphere. But I mean not only three names, but Three Dimensions.

Adapted from: 
Flatland: A romance of many dimensions by Edwin A. Abbott

ADVENTURE IN SPACELAND

In part 2 of this tutorial, we have learned how to use arrays and how to read atomic coordinates from a file. In the appendix, you can find an example of the solution to the exercises given in the previous tutorial.

In this third part, we are going to learn how to generate three-dimensional coordination of atoms in a cubic crystal lattice and how to calculate non-bonded molecular potential and the force acting among them.

Continue reading