Fixed minor error in periodic calc.

The additive terms s has the incorrect sign.
In the dev notebook I was not generating random numbers on the whole domain, just on 0-1.