Optimization algorithm for charge relaxation

Implemented a charge optimization algorithm using a SciPy function.