Debugging deterministic simulations

I am afraid I don’t have a satisfactory answer… When I am in trouble with deterministic simulations, once I have discarded obvious problems (like structural singularity, BK conditions not satisfied around the terminal steady state, or scaling issues if the model is simulated along a BGP) I simply debug (using matlab’s debugger) the solver and look at the residuals after each iteration of the nonlinear solver to identify the culprits (problematic equations). This requires a minimum knowledge of dynare and matlab, and is really not user-friendly. We should implement a debug mode where this kind of information is saved on each iteration, this would certainly help (actually for some of the algorithms we have a debug mode, but we definitely do not store enough information). I do not use this approach often, but if you use the bytecode/block options (and associated solvers) the solvers return informations about the origin of the failure (if possible)… So this may help.

Best,
Stéphane.