[ase-users] Check convergence by ploting force, energy and stress

Jens Jørgen Mortensen jjmo at dtu.dk
Tue Oct 13 10:32:57 CEST 2020


On 10/8/20 10:26 AM, Manuel Benavent via ase-users wrote:
> Dear ASE user
> 
> I've been looking for a way to plot the convergence of relevant 
> parameters such as energy, forces and stress of a geometry optimization 
> using CASTEP.
> Can you please point me to documentation that could help me plotting 
> such parameters? Or provide a script that you use for such thing.

Here's a quick'n'dirty script:

from ase.io import read
traj = read('relax.traj@:')
fmax = [(atoms.get_forces()**2).sum(axis=1).max()**0.5 for atoms in traj]
import matplotlib.pyplot as plt
plt.plot(fmax)
plt.show()

I also sometimes use ASE's GUI:

     $ ase gui relax.traj -g "i,fmax"

Unfortunately, it doesn't know how to plot the stress.

Jens Jørgen

> Thanks
> Manuel
> 
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
> 



More information about the ase-users mailing list