# Global quasi-potential calculation

## Example 1 from Moore et al. (2016)

### Creating a global quasi-potential

The next step is combining the local quasi-potentials into a single surface. If the system only has a single equilibrium point or basin of attraction (e.g., a limit cycle) then the local quasi-potential is the global quasi-potential. If the system has two or more basins of attraction, then the local surfaces need to be aligned, adjusted, and combined. Details can be found in Moore et al. (2016) and references therein, but we briefly describe what's happening in the function that creates the global quasi-potential, `QPGlobal`.

Briefly, the most probable way for a trajectory to transition from one basin to another involves passing through the lowest point on the surface specified by each local quasi-potential surface along the separatrix (the line between two basins of attraction). The two local quasi-potentials should be translated so that the minimum heights along the separatrix are the same. In this example, the minima of both local quasi-potentials occurred at the same point---the saddle at \$(4.201, 4.004)\$---so the algorithm amounts to matching at that point. This is a fairly straight-forward example, but see Moore et al. (2016), Example 3, for a more complicated example.

The functions that calculates the global quasi-potential is `QPGlobal`. Its arguments minimally include:

1. a list of local surfaces,
2. the (x, y) locations of the unstable points to be evaluated, and
3. the boundaries used to calculate the local quasi-potentials.

For our example, we have:

```    unstable.x <- c(eqs[2, 1], eqs[4, 1]) # values are c(0, 4.2008)
unstable.y <- c(eqs[2, 2], eqs[4, 2]) # values are c(0, 4.0039)
ex1.global <- QPGlobal(local.surfaces = list(eq1.local, eq2.local), unstable.eq.x = unstable.x, unstable.eq.y = unstable.y, x.bound = bounds.x, y.bound = bounds.y)
```

And that's all she wrote---you've created your first global quasi-potential!

bmarkslash7/QPot documentation built on Jan. 11, 2020, 11:11 a.m.