QPGlobal: Finding the global quasi-potential

Description Usage Arguments Examples

View source: R/QPGlobal.R

Description

This function allows you to find the global quasi-potential values for several local quasi-potential surfaces

Usage

1
QPGlobal(local.surfaces, unstable.eq.x, unstable.eq.y, x.bound, y.bound)

Arguments

local.surfaces

a list of local quasi-potential surfaces, each of which is stored in discretized form as a matrix.

unstable.eq.x

a vector of the x-coordinates of the unstable equilibria. Must be in the same order as unstable.eq.y.

unstable.eq.y

a vector of the y-coordinates of the unstable equilibria. Must be in the same order as unstable.eq.x.

x.bound

a two-element vector with the minimum and maximum x values used for computing the quasi-potential.

y.bound

a two-element vector with the minimum and maximum y values used for computing the quasi-potential.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# First, System of equations
	equationx <- "1.54*x*(1.0-(x/10.14)) - (y*x*x)/(1.0+x*x)"
	equationy <- "((0.476*x*x*y)/(1+x*x)) - 0.112590*y*y"

# Second, shared parameters for each quasi-potential run
	xbounds <- c(-0.5, 10.0)
	ybounds <- c(-0.5, 10.0)
	xstepnumber <- 100
	ystepnumber <- 100

# Third, first local quasi-potential run
	xinit1 <- 1.40491
	yinit1 <- 2.80808
	storage.eq1 <- QPotential(x.rhs = equationx, x.start = xinit1, 
	x.bound = xbounds, x.num.steps = xstepnumber, y.rhs = equationy, 
	y.start = yinit1, y.bound = ybounds, y.num.steps = ystepnumber)

# Fourth, second local quasi-potential run
	xinit2 <- 4.9040
	yinit2 <- 4.06187
	storage.eq2 <- QPotential(x.rhs = equationx, x.start = xinit2, 
	x.bound = xbounds, x.num.steps = xstepnumber, y.rhs = equationy, 
	y.start = yinit2, y.bound = ybounds, y.num.steps = ystepnumber)

# Fifth, determine global quasi-potential 
	unst.x <- c(0, 4.2008)
	unst.y <- c(0, 4.0039)
	ex1.global <- QPGlobal(local.surfaces = list(storage.eq1, storage.eq2), 
	unstable.eq.x = unst.x, unstable.eq.y = unst.y, x.bound = xbounds, 
	y.bound = ybounds)

Example output

The upwind ordered method will be chatty
Set verboseC = FALSE to turn off completely
Creating file name.
File name created.
Completed Memory Allocation
equationx = 1.54*x*(1.0-(x/10.14)) - (y*x*x)/(1.0+x*x)
equationy = ((0.476*x*x*y)/(1+x*x)) - 0.112590*y*y
hx = 0.106061
hy = 0.106061
Finished initializing a bunch of matrices in param() function
cputime = 0.03769
Finished Loading Parameters
Finished ipoint() function
Initial count = 4
1722	(2	15) is accepted, g=0.2382
Final count = 246
Finished ordered_upwind() function
cputime = 0.109858
Saves only to R
In datasave case 2
Successful.  Exiting C code
The upwind ordered method will be chatty
Set verboseC = FALSE to turn off completely
Creating file name.
File name created.
Completed Memory Allocation
equationx = 1.54*x*(1.0-(x/10.14)) - (y*x*x)/(1.0+x*x)
equationy = ((0.476*x*x*y)/(1+x*x)) - 0.112590*y*y
hx = 0.106061
hy = 0.106061
Finished initializing a bunch of matrices in param() function
cputime = 0.042502
Finished Loading Parameters
Finished ipoint() function
Initial count = 4
1721	(2	15) is accepted, g=0.2236
Final count = 246
Finished ordered_upwind() function
cputime = 0.119995
Saves only to R
In datasave case 2
Successful.  Exiting C code

QPot documentation built on May 2, 2019, 2:34 p.m.