Static equations residuals not equal zero

I have a model involves vintage vehicles which generates 20 equations, some of them are not zero. My tau (which represents tax) is exogenous and I have already solved steady states analytically. Every variable could be represented by tau solely. I don’t understand why dynare is not working in my case. Could anyone help me with that?

I have attached my mod file here.

Thanks you so much. dynamic_analysis.mod (1.9 KB)

Use resid before steady to see the residuals given your presumed steady state values. As you can see, they do not solve the model. So either the model equations are wrong or your steady states. By brute force, one steady state is


y_a               		 2.31078e-05
y_g               		 0.482038
k_a               		 5.55082e-10
k_g               		 0.99407
q_a               		 1.93937e-08
delta_new         		 330.961
r                 		 0.130923
w                 		 0.954077
k                 		 0.99407
l                 		 0.368826
c                 		 0.336418
g_1               		 0.021723
g_2               		 0.0207827
a_new             		 -330.961
l_a               		 7.92775e-11
l_g               		 0.368825
s                 		 1.28431e-05
tau               		 0.1
a_old             		 -330.961
delta_old         		 330.961

This suggests a problem with your model.

Hi Professor,

Thanks so much for your reply and I have checked my steady states equation and updated my calculation. I used mathematica to check my calculations so I am pretty sure they are correct now. I now tried two different ways 1) the first one just with first order condition and updated initial value. 2) the second I added steady_state_model section given that I have closed form solution. There is still problem and could you help me on that? Thanks a lot!dynamic_analysis.mod (4.2 KB)
dynamic_foc.mod (2.1 KB)

They cannot be correct, because your steady_state_model-block only set a few variables, but you need to set all of them.

Thanks so much professor. I thought I could just put the fundamental one to avoid typo. I get some NaN in the residual equation. I used Mathematica to calculate my closed form solution already. For variable l_a, there are actually two solutions, but dynare could be able to pick the positive one? Or i am wrong with that? Many thanks!dynamic_analysis.mod (4.2 KB)

As Dynare says:

The initial values for the steady state of the following variables are complex:

l_a is negative. Dynare will accept the value you provide to it. If you pick the negative solution for l_a it is going to continue with that value.