{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Atomization energy\n\nThe following script will calculate the atomization energy of a\nnitrogen molecule.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Please look at the script\n:download:`../../tutorials/N2.py`:\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from ase import Atoms\nfrom ase.calculators.emt import EMT" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First, an ``Atoms`` object containing one nitrogen is created and a\nfast EMT calculator is attached to it simply as an argument.\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "atom = Atoms('N')\natom.calc = EMT()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The total energy for the isolated atom is then calculated\nand stored in the ``e_atom`` variable.\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "e_atom = atom.get_potential_energy()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The ``molecule`` object is defined, holding the nitrogen molecule at\nthe experimental bond length ``d=1.1`` Angstrom.\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "d = 1.1\nmolecule = Atoms('2N', [(0.0, 0.0, 0.0), (0.0, 0.0, d)])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The EMT calculator is then attached to the molecule\nand the total energy is extracted into the ``e_molecule`` variable.\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "molecule.calc = EMT()\ne_molecule = molecule.get_potential_energy()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The atomization energy is the energy required to break the bond,\nmeaning that it is the negative energetic difference between\nthe molecule and twice the single atom's energy.\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "e_atomization = -1.0 * (e_molecule - 2 * e_atom)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally we print the relevant energies:\n\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "print(f'Nitrogen atom energy: {e_atom:5.2f} eV')\nprint(f'Nitrogen molecule energy: {e_molecule:5.2f} eV')\nprint(f'Atomization energy: {e_atomization:5.2f} eV')" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.7" } }, "nbformat": 4, "nbformat_minor": 0 }