What is the current rule for ordering of array-valued variables once structural_simplify has been called and sort_eqs is set to false? My current array has something like this:
Ordering of symbols is not guaranteed after symbolic transformations, and parameters are now stored in a custom MTKParameters object instead of a vector. Frequently Asked Questions · ModelingToolkit.jl
So no, you cannot swap ordering, and you don’t need to swap the order if you use symbolic indexing, for example sol[sys.Φ_s_c[2]].
Thanks Bart, I was curious because I am trying to visualize the full system’s Jacobian which contains equations with Laplacian of Φ_s_c. This ordering leads to some odd-looking parts at the switched variables.
The function ModelingToolkit.calculate_jacobian does have a kwarg dvs=unknowns(sys) but I am not sure if passing differential vars with a different ordering will affect the ordering in the calculated jacobian, you could try this.