Mathematical Specification of a PDMP Problem
Vector field
To define a PDMP Problem, you first need to give the function $F$ and the initial condition $x_{c,0}$ which define an ODE:
\[\frac{dx_c}{dt} = F(x_c(t),x_d(t),p,t)\]
where $F$ should be specified in-place as F(dxc,xc,xd,p,t), and xc0 should be an AbstractArray (or number) whose geometry matches the desired geometry of xc. Note that we are not limited to numbers or vectors for xc0; one is allowed to provide u₀ as arbitrary matrices / higher dimension tensors as well.
Jumps
Jumps are defined as a Jump process which changes states at some rate $R$ which is a scalar function of the type
\[R(x_c(t),x_d(t),p,t).\]
Note, that in between jumps, $x_d(t)$ is constant but $x_c(t)$ is allowed to evolve. $R$ should be specified in-place as R(rate,xc,xd,p,t,issum::Bool) where it mutates rate. Note that a boolean issum is provided and the behavior of R should be as follows
- if
issum == true, we only requireRto return the total rate, e.g.sum(rate). We use this formalism because sometimes you can compute thesumwithout mutatingrate. - if
issum == false,Rmust populateratewith the updated rates
We then need to provide the way the jumps affect the state variable. There are two possible ways here:
- either give a transition matrix
nu: it will only affect the discrete componentxdand leavexcunaffected. - give a function to implement jumps
Delta(xc, xd, parms, t, ind_reaction::Int64)where you can mutatexc,xdorparms. The argumentind_reactionis the index of the reaction at which the jump occurs. Seeexamples/pdmp_example_eva.jlfor an example.
Problem Type
Constructors
PDMPProblem(F,R,Delta,nu,xc0,xd0,p,tspan)PDMPProblem(F,R,nu,xc0,xd0,p,tspan)when ones does not want to provide the functionDeltaPDMPProblem(F,R,Delta,reaction_number::Int64,xc0,xd0,p,tspan)when ones does not want to provide the transition matrixnu. The lengthreaction_numberof the rate vector must then be provided.
We also provide a wrapper to DiffEqJump.jl. This is quite similar to how a JumpProblem would be created.
PDMPProblem(prob, jumps...)whereprobcan be anODEProblem. For an example, please considerexample/examplediffeqjumpwrapper.jl.
Fields
F: the function of the ODER: the function to compute the transition ratesDelta[Optional]: the function to effect the jumpsnu[Optional]: the transition matrixxc0: the initial condition of the continuous partxd0: the initial condition of the discrete partp: the parameters to be provided to the functionsF, R, Deltatspan: The timespan for the problem.