For the structure refinement we need to compute the forces on the atoms that move them into the density. We derive forces by comparing the target density with a density that is computed from the coordinates of the model, the model density. The goal is to minimize the difference between the target and the model density:

Target density, Model density, Difference density.

Since experimental density map often contain a significant amount of noise, we compute a stochastic gradient that is more robust than an analytical gradient. For this a set of