# Manually update operator in a SplitODEProblem

**URL:** <https://discourse.julialang.org/t/manually-update-operator-in-a-splitodeproblem/139138>\
**Category:** Modelling & Simulations\
**Tags:** diffeq\
**Created:** [September 1, 2026, 2:36pm UTC](https://discourse.julialang.org/t/manually-update-operator-in-a-splitodeproblem/139138 "2026-09-01T14:36:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![homocarbonis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/homocarbonis/32/223614_2.png) [@homocarbonis](https://discourse.julialang.org/u/homocarbonis)\
**Post date:** [September 1, 2026, 2:36pm UTC](https://discourse.julialang.org/t/manually-update-operator-in-a-splitodeproblem/139138/1 "2026-09-01T14:36:39Z")

</div>

Hello, I have some library code which constructs a SplitODEProblem with a DiagonalOperator as f1, and I’m trying to write a function to remake the problem with problem.f.f1.A updated according to new parameter values.

I have tried passing an `update_func!` to `DiagonalOperator` but the problem is that it gets called automatically at every time step which isn’t what I want.

Is there any thing else I can do short of bundling all the arguments passed to SplitODEProblem into a struct and rebuilding the problem from scratch every time?

---

<div class="post-metadata">

**Author:** ![homocarbonis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/homocarbonis/32/223614_2.png) [@homocarbonis](https://discourse.julialang.org/u/homocarbonis)\
**Post date:** [September 1, 2026, 3:00pm UTC](https://discourse.julialang.org/t/manually-update-operator-in-a-splitodeproblem/139138/2 "2026-09-01T15:00:46Z")

</div>

I’ve think found a workaround. `DiagonalOperator` has an `accepted_kwargs` option which can be used to pass an update flag to `update_func!`:

```julia
update_func!(λ,u,p,t; update=false) = update && f!(λ, p)
DiagonalOperator(λ0; update_func!, accepted_kwargs=Val((:update,)))

```
