Skip to content

Commit

Permalink
add global nullrate function
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsas committed Dec 14, 2022
1 parent e271864 commit 8c393e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/jumps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ struct VariableRateJump{R, F, R2, R3, R4, I, T, T2} <: AbstractJump
reltol::T2
end

nullrate(u, p, t::T) where {T <: Number} = zero(T)

"""
```
function VariableRateJump(rate, affect!; lrate = nothing, urate = nothing,
Expand All @@ -168,7 +170,7 @@ function VariableRateJump(rate, affect!;
end

if (urate !== nothing && lrate === nothing)
lrate = (u, p, t) -> zero(typeof(t))
lrate = nullrate
end

VariableRateJump(rate, affect!, lrate, urate, rateinterval, idxs, rootfind,
Expand Down

0 comments on commit 8c393e2

Please sign in to comment.