Skip to content

Commit

Permalink
Update docs/src/model_simulation/examples/periodic_events_simulation.md
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Isaacson <[email protected]>
  • Loading branch information
TorkelE and isaacsas authored Jul 17, 2024
1 parent 532ebc5 commit 759f44e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dprob = DiscreteProblem(circadian_model, u0, (0.0, 100.0), ps)
jprob = JumpProblem(circadian_model, dprob, Direct())
nothing # hide
```
Next, we implement our event through a `DiscreteCallback`. It triggers every 12 time units, and when it does, it flips the value of `l`. Since we will interface with $l$'s value multiple times, we [create specific `getl` and `setl` functions](@ref simulation_structure_interfacing_functions) to do this (in practice, due to this model's small size, the performance impact is negliable).
Next, we implement our event through a `DiscreteCallback`. It triggers every 12 time units, and when it does, it flips the value of `l`. Since we will interface with $l$'s value multiple times, we [create specific `getl` and `setl` functions](@ref simulation_structure_interfacing_functions) to do this (in practice, due to this model's small size, the performance increase is minimal).
```@example periodic_event_example
getl = ModelingToolkit.getp(jprob, :l)
setl = ModelingToolkit.setp(jprob, :l)
Expand Down

0 comments on commit 759f44e

Please sign in to comment.