Residuals in static equations and zig zag IRFs in DSGE models

Dear forum friends,
I’ve been stuck for a while with a Dynare code that runs a DSGE model and returns some IRFs upon an exogenous shock.
The code has residuals in some static equations and the IRFs have a zig zag behavior.
Here is the mod file:
nonlinear_dsge.mod (13.5 KB)

Thank you in advance for any help!

There must be a timing error somewhere. Focus on the variables with the oscillating behavior.

Dear Professor Pfeifer,
I have been reviewing my model equations and the Dynare code and I see that everything is with the right timing. I am attaching two files with the equilibrium equations and the steady state solution.
I have focused on both the bald scheme wage equations and the ones concerning public capital because they give problems in the residuals of the static equations. I am not able to see the errors.
Thank you very much for your help.
Equations.pdf (153.8 KB)
Steady_state.pdf (151.5 KB)

Have you tried shutting of features like capacity utilization and investment adjustment costs? Also note that the FOC for the capacity utilization looks rather strange.

Thank you very much Professor,

Removing capacity utilisation from the model and adjustment costs, IRFs look normal. But I don’t understand what the problem is. I take the specification from:, adding taxes and productive government spending.
I still have problems with the residuals of equations of law of motion for public capital and the third equation of wages.

If you are confident that the model equations are correct, then you should try to change parameter values to see what changes in the transmission mechanism and causes the result. Medium-scale models are complex animals.

I have tried to adjust model parameters but the fundamental part of the problem is not solved. I attach the IRFs to a shock in public spending. The zig zag problem must be related to capacity utilisation but I can’t find it after checking everything.

It’s strange that the oscillations in u mostly affect the labor margin. I would focus on that part of the model.