in which order are auxiliary variable definitions stored ?
DynamicModel.cc:3787 and 3848, new definitions are inserted in front of the deque ModelTree.cc:1382, new definition is pushed in the back of the deque
The order of the definitions matters because, for example, a conditional expectation lagged by 2 periods is built on the basis of the auxiliary variable for the lagged expectation by 1 period.
StaticModel.cc:1707 and 1735 write the equations in the wrong order when equations are inserted in front of the deque
There are other problems related to the handling of auxiliary variables in the *.m files, when computing the steady state of models with auxiliary variables, see ticket 213.