I am trying to calculate the dielectric constant. I am trying the following tutorial.
My code is like below.
But it gives the following error.
NotImplementedError Traceback (most recent call last)
/tmp/ipykernel_12249/2334277914.py in <module>
1 diel = DielectricConstant(u.atoms)
----> 2 diel.run()
3
~/anaconda3/lib/python3.9/site-packages/MDAnalysis/analysis/base.py in run(self, start, stop, step, verbose)
292 self._setup_frames(self._trajectory, start, stop, step)
293
logger.info("Starting preparation")
--> 294 self._prepare()
295 for i, ts in enumerate(ProgressBar(
296 self._trajectory[self.start:self.stop:self.step],
~/anaconda3/lib/python3.9/site-packages/MDAnalysis/analysis/dielectric.py in _prepare(self)
131 if not np.allclose(self.atomgroup.total_charge(compound='fragments'),
132 0.0, atol=1E-5):
--> 133 raise NotImplementedError("Analysis for non-neutral systems or"
134 " systems with free charges are not"
135 " available.")
NotImplementedError: Analysis for non-neutral systems or systems with free charges are not available.