Closed j-fu closed 2 months ago
It looks like the vector is just in a different order. Did you check the symbol order is as you expected? Are you using getu
to ensure you get the ordering you want?
I checked for the symbol order, will update the MWE. Anyway, the vector is ones(7), so the IMHO order should not matter.
Both of your outputs are the same, one is just in a different order.
But I do't see the 44.949999999999996 value in the output from v14.
Oh interesting, I see now. Are you sure it's function generation? Did you check the generated ODEs?
@ChrisRackauckas canβt parameter order also change? (And change from the ordering within Catalyst.)
@j-fu what happens if you instead pass probv.p to f?
canβt parameter order also change? (And change from the ordering within Catalyst.)
oh yes that's probably it.
(Sorry Iβm traveling and have cell phone only connectivity till Sunday.)
I'm actually surprised it didn't just error, since it should use the split form and separate the integer parameters from the float ones.
At some low level everything is now upconverted to floats if the symbolics are not explicitly declared as integers.
Iβm not sure I agree with this behavior but it is happening in MTK or lower now.
@j-fu what happens if you instead pass probv.p to f?
Yeah this helps indeed! Thinking about it, it seems that it should be logical to pass probv.p instead of my params tuple, as int might be mangled in whatever way.
Thanks for the quick response!
Yeah, you canβt rely on the Catalyst order any more being preserved in generated functions. So using the initial condition and parameter objects from generated problems is the way to go.
Iβm going to close this issue but feel free to reopen if there are further issues.
Describe the bug π
There seems to be an error with function generation in Catalyst.jl v14. With Catalyst.jl v13, my code shows correct behavior, while with v14, things appear to be wrong. I tried to cook down to the essentials, resulting in the MRE below which looks at the output of the generated ODE description function. We indeed see a difference of results between v13 and v14.
Minimal Reproducible Example π
Expected behavior
With Catalyst.jl v13 this prints
which is correct judging from the results of my example (which is too complex to reproduced here).
With Catalyst.jl v14 this prints
and my example fails.
Environment (please complete the following information):
using Pkg; Pkg.status()
for Catalyst.jl v14using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
for Catalyst.jl v14Additional context @smaasz