# A good 2D function for plotting and visual demonstration of transition state, reaction coordinate etc

I am looking for a nice 2D function which has two minima and one saddle point, and ideally a curved reaction path which I can use to draw contour plots on matplotlib. I will use these contour plots in presentations, poster etc. to demonstrate transition state finding methods, and the intrinsic reaction coordinate etc.

I have been using Muller-Brown potential before (which has been used for testing IRC algorithsm before), but it has an intermediate minimum which makes this complicated. (Plot shown below, with red dot being highest saddle point)

Are there similar 2D potential energy surfaces which have only one TS and two minima that could be used to explain saddle points, and other such concepts easily?

• Can't you use two gaussians or sine functions? Just cut them off at the valley. Commented Mar 25 at 15:02
• @HemanthHaridas Could you post an answer with an example of such function? I am not that well-versed in math behind plotting - so I am not really sure what those functions would look like. Commented Mar 26 at 11:22

I would suggest using the egg holder function which is defined by the following formula

$$f(x) = -(x_2+47)sin\left(\sqrt{\left| x_2+\frac{x_1}{2} + 47 \right|}\right) - x_1sin\left(\sqrt{\left| x_1-(x_2 + 47) \right|}\right)$$

This is a function that has multiple minima (hence the name egg holder function) and has a contour plot that looks like this

I generated this plot using the following code

import numpy as np
import matplotlib.pyplot as plt

def eggholder(x1: float, x2: float)->float:
term1   =       np.sqrt(np.abs(x2 + 0.5*x1 + 47))
term2   =       np.sqrt(np.abs(x1 - (x2 + 47)))
return (-1 * (x2+47) * np.sin(term1)) - (x1 * np.sin(term2))

x1      =       np.arange(-512, 513, 1)
x2      =       np.arange(-512, 513, 1)

X1, X2  =       np.meshgrid(x1, x2)
Z       =       np.zeros(X1.shape)

for index1, x in enumerate(x1):
for index2, y in enumerate(x2):
Z[index1][index2]       =       eggholder(x1 = x, x2 = y)

plt.contour(X1, X2, Z)
plt.colorbar()
plt.show()


You can modify the bounds to zoom in on a particular region and identify the minima and saddle points.

The advantage of this function is that it has a lot of minima and saddle points, and you can technically generate any combination of them.

EDIT:

Turns out it can be extremely simple to do. Here are the ingredients:

Component Expression
Curved minimum energy path
(path follows $$y = 0.4 (x^2 - 4x)$$)
$$[y - 0.4(x^2-4x)]^2$$
Ridge (runs down $$x = 0$$) to make saddle point $$-x^2$$
Wrap it up in a quartic $$0.1(x^4+y^4)$$
And tilt it so the minima have more similar depth $$-0.5x$$

Here's what you get. On left, just the constructed saddle point in the middle of the MEP; on right, two minima thanks to the wrapping quartic.

You can make some nightmare fuel energy landscapes with this approach, such as:

$$E(x,y) = [y- (\tanh(3x) - 0.5 x)]^2 - x^2 + 0.2 (x^4 + y^4)$$

Good luck, have fun.

Original post:

Inspired by Susi Lehtola's answer, here's a straightforward function:

$$z = (x-1)^4 + (y-1)^4 + (x+1)^4 + (y+1)^4 - 20(x-y)^2 + 60x$$

The ingredients are:

• Insert a quadratic "ridge" (in this case the $$(x-y)^2$$ term) to induce a saddle point
• And tilt the whole thing (the $$x$$ term) to push the saddle point off the line between both minima.