mirrored elastic force improvements from Sergey on the C++ version:
https://github.com/openworm/Smoothed-Particle-Hydrodynamics/commit/5cfbf33dee05234bbb67c7d0e95f91bf668efbc5