MTK - solve: weird error message

I’m on Julia v1.11.6 on Windows 11 64bit, using MTK v10.19.0, OrdinaryDiffEq v6.101.0. I try to use Clapeyron v0.6.15 with the code.

My code worked without a flaw (except some warnings related to arrays and Clapeyron) in the past (ca. 1 month ago).

Here are some snippets from the execution:

# -- original model
@mtkcompile sep = Separator()

leads to some warnings + the output:

Next, setting up the problem:

julia> tspan = (0, 230)

julia> # Solve problem
julia> prob = ODEProblem(sep, [], tspan, saveat=1)
tspan = (0, 230)

# Solve problem
julia> prob = ODEProblem(sep, [], tspan, saveat=1)
ODEProblem with uType Vector{Float64} and tType Int64. In-place: true
Initialization status: FULLY_DETERMINED
Non-trivial mass matrix: false
timespan: (0, 230)
u0: 2-element Vector{Float64}:
 160.0
   0.2

Then I try to solve the problem:

julia> sol = solve(prob)
index reduction resulted in an empty model.

Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] index_reduction(model::MultiFluid{EmpiricAncillary, AsymmetricMixing, EmpiricDeparture}, bools::BitVector)
    @ Clapeyron C:\Users\Bernt\.julia\packages\Clapeyron\Jd4CF\src\utils\index_reduction.jl:33
  [3] index_reduction(model::MultiFluid{EmpiricAncillary, AsymmetricMixing, EmpiricDeparture}, z...

Any idea what the problem is? Has Clapeyron changed?? Or something to do with MTK or OrdinaryDiffEq?

The error message is coming from Clapeyron so you may want to ask them what changed.

1 Like

Thanks for quick response. That narrows in my debugging. I saw the JuliaCon 2025 presentation of what is new in MTK, and didn’t quite get whether v10.x had introduced the new array structure.

Weird. The code works for tspan = (0,200); in the past, it worked for tspan = (0,230).

My guess is that some of the values computed in Clapeyron.jl have changed slightly (minor updates) so that some values become negative or NaN or something for t>200.

The weird thing is that usually, the solvers then give a more understandable crash report then of “index reduction resulted in an empty model”.

Well it’s Clapeyron.jl throwing the error, so we don’t know what it means, what it stands for, or how to improve the error message. You have to talk to them. The “index reduction” is unrelated to DAE index reduction.

1 Like