Description Usage Format Slots See Also Examples
This is a minimal fictitious example, of a PDMP jumping at borders
pdmpBorder
.
In difference to the examples simulated by pdmpModel
the Prosess doesn't make stochastic jumps, what means thet we habe just one
state, which changes the dynamic by reaching the border.
This example makes it easy to see the functionality of borders.
Here the minimum border 0 ist the ground where the velocity of the ball
rises and therefore the height of each hop increases up to a second
fixed border (20), where the process stops.
1 |
An object of class pdmpBorder
.
init
There ist one continous variable, which describes the height of the ball and no discrete variable.
discStates
there are no discStates.
dynfunc
The dynamic of the continous variable depends on the velocity at the last jump (borderjump jump).
ratefunc
The ratefunc is 0, because the probability to jump ist 0, because the example models just one discret state.
parms
There is the parameter b, which is the factor of changing the velocity of our process each time the process hits the border zero and a and there are no change rates of the process.
times
The simulations will start at time t = 0
and end at the time, where the termination terminating value is reached.
borroot
It has dimension one and replaces the ground (=minimum), where the velocity is changed by b*velocity.
terroot
Every value, which forces the process to terminate is stored in the vector terroot. In this example it has dimension one and is the fixed value of 20 which forces the precess to terminate.
borderfunc
the borderfunc changes the values of the differential equation by reaching the borroot.
OÖK
for another example of a pdmpBorder
, where stochastic and border jumps appear.
In pdmpBorder
you can find a formal description of the S4 class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | IBBall <-pdmpBorder(
descr = "increasing bouncing ball, just borderjumps",
parms = list(a = -5, b = -1.1),
init = c(height = 0, velocity = 10),
discStates = list(),
borroot = function(t, x, parms){return(c(x[1]))},
terroot = function(t, x, parms){return(c(x[1] - 20))},
times = seq(from = 0, to = 25, by = 0.01),
dynfunc = function(t, x, parms) {
dheight <- with(as.list(c(x, parms)), c(velocity, a))
return(c(dheight))
},
ratefunc = function(t, x, parms) {
0
},
jumpfunc = function(t, x, parms) {return(with(as.list(c(x, parms)), c(dheight)))},
borderfunc = function(t, x, parms){return(with(as.list(c(x, parms)), c(height = 0, velocity = b* velocity)))
})
# load it and plot a simulation:
data("IBBall")
plot(sim(IBBall))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.