Tag Archives: iteration

A Tribut to C++ Homework

For my very first homework in C++ (about half a year ago) I was asked to write a program that computes the exponential function. Up till now I was never fully satisfied by my former solution. So here is the ultimate version. A little late, but anyhow.

WeiredExponent is a program that combines a maximum of system incompatibility and user frustration potential with a minimum of calculation speed and reliability. It is a little C++ program that computes the exponential function from a number passed to it as a command line argument. However, none of the calculation steps is actually preformed by C++ code. Instead, it forks children that use Java, Fortran, Pascal and Python to carry out small pieces of work. — Each in a very inefficient way. Nevertheless, the program gets the correct results and there is no code that isn’t used. (Such like a += 0;.)

To run it, you’ll need:

WeiredExponent is of course Free Software. This means, that if you open the window and — as loud as you can — shout out: “Hello world!” then you can freely use it for any purpose you want. It is not very recommended to use WeiredExponent in important exams or as dog food. The author of this software is not responsible for bad marks, neither he is for sick dogs.

Download the C++ source code

Update on AB5 Molecule Conformation

Some time ago I posted a little program to calculate a rough approximation for the conformation of AB5 molecules with. As I started dealing with the stuff again I improved the program somewhat. First of all I corrected part of the “violent” code from the first version.

Secondly, I’ve added the possibility to assign relative charges to the ligands. You can Continue reading

Energy optimized arrangement in AB5-Molecules

In an AB5-molecule (i.e. an atom consisting of one (say positive charged) center atom and five negative charged ligands) the question of the molecule geometry seems to be very interesting. In the lectures we heard, that a bipyramidal arrangement will appear. I.e. all ligands on the surface of a sphere – the center atom of course in the center – such, that three of them form an equilateral triangle at the equator of the sphere and the other two take place at the poles. Interesting enough, one can calculate, that for this arrangement there is not an equal distribution of the energies between the ligands. That means, that the two ligands at the poles (we call it axial position) have a higher potential energy than the three in equatorial position. Since this isn’t trivial, a closer look might not be wrong. Continue reading