Problem with deterministic simulation

Hello to everyone,
I am trying to construct a dynare file for the model of Gertler (1999) I do not have any problem with the laissez faire economy and it works perfectly. Then, when adding the government it works for the steady state determination but it fails in running the simulation after the permanent shock on exogenous variables.
The model is right because when I transform two exogenous deterministic variables in stochastic processes both the steady state (identical to the deterministic one) and the simulation work.
When executing the file (in Octave) the error that I receive is:
“error: A(I): Index exceeds matrix dimension.
error: called from:
error: /home/alessandro/Desktop/Final_dissertation/Dynare/gertler_SSS_det_dyn
amic.m at line 16, column 6
error: /usr/share/dynare/matlab/sim1.m at line 71, column 20
error: /usr/share/dynare/matlab/simul.m at line 93, column 9
error: /home/alessandro/Desktop/Final_dissertation/Dynare/gertler_SSS_det.m a
t line 182, column 1
error: /usr/share/dynare/matlab/dynare.m at line 134, column 1”

I suspect it may be a bug of dynare.
Thank you very much,
gertler_SSS_det.mod (1.28 KB)

With Dynare 4.2.2, when running your MOD file, I get the following error message:

ERROR: A .mod file cannot contain both a simul command and varexo_det declaration (all exogenous variables are deterministic in this case)

So I guess that you are using an old version of Dynare which was allowing this
incorrect setup.

If I replace “varexo_det” with “varexo”, then the MOD file runs without error.