# Possibility to convert SciMLBase.SplitODEProblem to SciMLBase.ODEProblem

**URL:** <https://discourse.julialang.org/t/possibility-to-convert-scimlbase-splitodeproblem-to-scimlbase-odeproblem/101732>\
**Category:** Modelling & Simulations\
**Tags:** sciml, ordinarydiffeq\
**Created:** [July 18, 2023, 1:05pm UTC](https://discourse.julialang.org/t/possibility-to-convert-scimlbase-splitodeproblem-to-scimlbase-odeproblem/101732 "2023-07-18T13:05:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanDoe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dandoe/32/52717_2.png) [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Post date:** [July 18, 2023, 1:05pm UTC](https://discourse.julialang.org/t/possibility-to-convert-scimlbase-splitodeproblem-to-scimlbase-odeproblem/101732/1 "2023-07-18T13:05:33Z")

</div>

I was wondering whether there is a neat way of converting a [split ODE problem](https://docs.sciml.ai/DiffEqDocs/stable/types/split_ode_types/#SciMLBase.SplitODEProblem) of the form `SplitODEProblem{isinplace}(f1,f2,u0,tspan,p=NullParameters();kwargs...)`  
to an usual [ODE problem](https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/#SciMLBase.ODEProblem)  
`ODEProblem{isinplace,specialize}(f,u0,tspan,p=NullParameters();kwargs...)`.

Mathematically, this corresponds to f\_1 + f\_2 = f; in code, however, I cannot simply add the functions f\_1, f\_2 and am thus interested in this functionality.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 18, 2023, 1:48pm UTC](https://discourse.julialang.org/t/possibility-to-convert-scimlbase-splitodeproblem-to-scimlbase-odeproblem/101732/2 "2023-07-18T13:48:57Z")

</div>

It does it internally automatically if you use a solver that cannot specialize on the splitting.

---

<div class="post-metadata">

**Author:** ![DanDoe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dandoe/32/52717_2.png) [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Post date:** [July 19, 2023, 7:11am UTC](https://discourse.julialang.org/t/possibility-to-convert-scimlbase-splitodeproblem-to-scimlbase-odeproblem/101732/3 "2023-07-19T07:11:10Z")

</div>

Okay, the actual conversion to “standard function” takes place [here](https://github.com/SciML/SciMLBase.jl/blob/091c91aa1da1b8f14e1c7bd3e7c439dc6a218784/src/scimlfunctions.jl#L2138-L2143)

```julia
(f::SplitFunction)(u, p, t) = f.f1(u, p, t) + f.f2(u, p, t)
function (f::SplitFunction)(du, u, p, t)
    f.f1(f.cache, u, p, t)
    f.f2(du, u, p, t)
    du .+= f.cache
end

```

right?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 19, 2023, 11:00am UTC](https://discourse.julialang.org/t/possibility-to-convert-scimlbase-splitodeproblem-to-scimlbase-odeproblem/101732/4 "2023-07-19T11:00:47Z")

</div>

yes
