diff --git a/examples/scripts/spme_max_energy.py b/examples/scripts/spme_max_energy.py index 398715b15..8f54484b8 100644 --- a/examples/scripts/spme_max_energy.py +++ b/examples/scripts/spme_max_energy.py @@ -156,7 +156,8 @@ def _evaluate(self, x, grad=None): gravimetric_energy_density_Ah = np.trapz(voltage * current) / ( 3600 * cell_mass(self.problem._model._parameter_set) ) - # Take negative in order to maximise energy density + # Return the negative energy density, as the optimiser minimises + # this function, to carry out maximisation of the energy density return -gravimetric_energy_density_Ah