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.
The index reduction kicks in when there is an approximately zero value in one of the components mole amount. if there is an empty model, probably a vector with all zeros was used as input for a Clapeyron function.
Edit: The error is probably triggered because at one point, a composition becomes negative. reproducer:
using Clapeyron
model = PR(["methane","ethane"])
Clapeyron.index_reduction(model,[1.0,-1e-15])
Thanks – I suspected something like that could cause the computation to get into problems: I had a fixed volume, and gradually increased the amount of one component in the mixture.
What confused me was the phrase “index reduction”, which I thought was related to ModelingToolkit in the setting I used Julia. But I realize other tools (Clapeyron in this case) may also do index reduction with a different meaning.