Free energy of solvation

Change in free energy is a very important physical quantity that determines the direction of many biological processes. Free energy perturbation (or alchemical free energy computation) is a computational technique for evaluating the difference in free energy between two states. In this tutorial you will learn how to apply this technique to compute the free energy of solvation of a simple molecule.

The tutorial is provided as an interactive Jupyter notebook based on GROMACS. You can run the tutorial online in your browser without installing anything, or download it to run locally with your own installed software.

To see the tutorial as plain text click here

Running this tutorial online

These tutorials are provided online for you for free thanks to and their sponsors.

Click to run a free online interactive binder at It will take several minutes to launch.

Alternatively, click to run a free online interactive binder at BioExcel-Binder. Note that a GitHub account is required to access BioExcel-Binder.

Running the tutorial offline

You will need to install some software on the terminal command line to be able to run the tutorial offline. Jupyter notebooks are built on Python, and the GROMACS tutorial content needs various other Python packages as well. Please follow the instructions below for your operating system to get a suitable terminal.

For MacOS users

You can use the standard Terminal app. You can launch a terminal via spotlight search, either click the magnifying glass icon in the top-left corner or press the Command-space key combination. Then type “Terminal” and press Return, and a terminal window will appear for you to use.

For Windows users

We strongly recommend to use (and install if necessary) the Windows Subsystem for Linux, WSL. Inside it, you will need Python 3 and the conda Python environment manager. A useful guide to doing this is found at

For Linux users

You can use the standard terminal. Press the ‘Ctrl-Alt-T` key combination and a terminal window will appear for you to use.

For all users once you have a terminal

First, install miniconda for Python 3 by following

Then download an archive of the notebook and supporting files from this link

Save it to e.g. the “Downloads” folder in your home folder.

Open a command-line terminal, make a folder to run the tutorial, and change into it:

mkdir free-energy-of-solvation
cd free-energy-of-solvation

Unpack the files with

unzip ~/Downloads/

If this fails, you may need to install the unzip program, e.g. with sudo apt-get install unzip and then try again.

Now, use miniconda to make the environment for the GROMACS tutorials with:

# For all users, Linux, MacOS, and Windows users
conda env create --name free-energy-of-solvation --file environment.yml

Activate it with:

conda activate free-energy-of-solvation

Finally, you can launch the Jupyter notebook for the tutorial in your browser with

jupyter-notebook tutorial.ipynb