Fixed 2d, 3d source distribution

* added source distribution tests
* fixed source distribution at negative coords (also improvement against the matlab version)

Other than that:
* renamed calculate_matrices() function to init_model(), which is more appropriate