Skip to content

Commit

Permalink
doc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsas committed Dec 29, 2022
1 parent 6ceef8d commit bba4aaf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
10 changes: 5 additions & 5 deletions docs/src/jump_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@ Note that
`SSAStepper` when using systems with only bounded `VariableRateJump`s and the
`Coevolve` aggregator.
- When choosing a different aggregator than `Coevolve`, `SSAStepper` can not
currently be used, and the `JumpProblem` must be coupled to a continuous
problem type such as an `ODEProblem` to handle time-stepping. The continuous
time-stepper treats *all* `VariableRateJump`s as `ContinuousCallback`s, using
the `rate(u, p, t)` function to construct the `condition` function that
triggers a callback.
currently be used, and the `JumpProblem` must be coupled to a continuous
problem type such as an `ODEProblem` to handle time-stepping. The continuous
time-stepper treats *all* `VariableRateJump`s as `ContinuousCallback`s, using
the `rate(u, p, t)` function to construct the `condition` function that
triggers a callback.


#### Defining a Regular Jump
Expand Down
22 changes: 10 additions & 12 deletions src/jumps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ performance charactertistics.
see below. These must calculate a time window over which the rate function is bounded by a
constant. Note that it is ok if the rate bound would be violated within the time interval
due to a change in `u` arising from another `ConstantRateJump`, `MassActionJump` or
*bounded* `VariableRateJump being executed, as the chosen aggregator will then handle
*bounded* `VariableRateJump` being executed, as the chosen aggregator will then handle
recalculating the rate bound and interval. *However, if the bound could be violated within
the time interval due to a change in `u` arising from continuous dynamics such as a
coupled ODE, SDE, or a general `VariableRateJump`, bounds should not be given.* This
Expand Down Expand Up @@ -91,9 +91,8 @@ affect!(integrator) = integrator.u[1] -= 1
vrj = VariableRateJump(rate, affect!)
```
In case we want to use the `Coevolve` aggregator, we need to pass the rate boundaries and
interval for which the rates apply. The `Coevolve` aggregator allow us to perform discrete
steps with `SSAStepper()`.
To define a bounded `VariableRateJump` that can be used with supporting aggregators such as
`Coevolve`, we must define bounds and a rate interval:
```julia
rateinterval(u,p,t) = (1 / p[1]) * 2
rate(u,p,t) = t * p[1] * u[1]
Expand All @@ -105,14 +104,13 @@ vrj = VariableRateJump(rate, affect!; lrate = lrate, urate = urate,
```
## Notes
- When using the `Coevolve` aggregator, `DiscreteProblem` can be used. Otherwise,
`ODEProblem` or `SDEProblem` must be used to be correctly simulated.
- **When not using the `Coevolve` aggregator, `VariableRateJump`s result in `integrator`s
storing an effective state type that wraps the main state vector.** See
[`ExtendedJumpArray`](@ref) for details on using this object. Note that the presence of
*any* `VariableRateJump`s will result in all `ConstantRateJump`, `VariableRateJump` and
callback `affect!` functions receiving an integrator with `integrator.u` an
[`ExtendedJumpArray`](@ref).
- When using an aggregator that supports bounded `VariableRateJump`s, `DiscreteProblem` can
be used. Otherwise, `ODEProblem` or `SDEProblem` must be used.
- **When not using aggregators that support bounded `VariableRateJump`s, or when there are
general `VariableRateJump`s, `integrator`s store an effective state type that wraps the
main state vector.** See [`ExtendedJumpArray`](@ref) for details on using this object. In
this case all `ConstantRateJump`, `VariableRateJump` and callback `affect!` functions
receive an integrator with `integrator.u` an [`ExtendedJumpArray`](@ref).
- Salis H., Kaznessis Y., Accurate hybrid stochastic simulation of a system of coupled
chemical or biochemical reactions, Journal of Chemical Physics, 122 (5),
DOI:10.1063/1.1835951 is used for calculating jump times with `VariableRateJump`s within
Expand Down

0 comments on commit bba4aaf

Please sign in to comment.