With the model specified by the following file, sincos.ode, there's a difference in the ordering of states in the generated Python code and in the generated C code using enum-based indexing.
states("main",
s = 0,
c = 1)
expressions("main")
ds_dt = -c
dc_dt = s
With the model specified by the following file,
sincos.ode
, there's a difference in the ordering of states in the generated Python code and in the generated C code using enum-based indexing.We then generate code with the following commands
The C code ends up reordering the states in the enum declaration, whereas Python keeps the states in the order they were declared in
sincos.ode
.C
Python
We should make the ordering consistent to avoid confusing bugs when mixing Python and C.