Skip to content

Commit 0fed1d0

Browse files
Document how to mutate parameters p in integrator (fixes #243)
Add documentation explaining that parameters can be modified directly via `integrator.p = new_p`, unlike u and t which require setter functions. This addresses the user's question about how to change the differential equation parameters during integration, particularly in callbacks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 7bc71f7 commit 0fed1d0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/src/basics/integrator.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ As low-level alternative to the callbacks, one can use `set_t!`, `set_u!` and
144144
have efficient ways to modify `u` and `t`. In such case, `set_*!` are as
145145
inefficient as `reinit!`.
146146

147+
For modifying parameters `p`, you can directly assign to the field:
148+
```julia
149+
integrator.p = new_p
150+
```
151+
Unlike `u` or `t`, changing `p` doesn't affect the solver's internal state or
152+
accuracy, so it can be modified directly without a setter function.
153+
147154
```@docs
148155
SciMLBase.set_t!
149156
SciMLBase.set_u!

0 commit comments

Comments
 (0)