Ramsey Policy Steady State and Optimal Static Steady State

Dear All,
I’m trying to solve the ramsey problem of a model where I introduce taxation as a policy tool. The Dynare solved the ramsey policy and gets a steady state tax rate, but this rate is not the same as the grid-search result where I just calculate the steady state under different level of tax rates. In fact, if I just calculate the steady-state welfare, the optimal static tax rate is \tau=-0.271, while the ramsey problem gets the steady state where \tau=-0.253. I’m not sure why this happens. Is this phenomenon normal? Thank you!

I have a following question. Now I’m trying to compare the welfare effect of the Ramsey policy and optimal simple rule around the same steady state solved from the Ramsey problem.
For the Ramsey problem, I use the result from oo_.planner_objective_value.conditional.steady_initial_multiplier as the conditional welfare indicator.
And for the optimal simple rule, I assume that the value of policy \tau_t follows a Taylor-rule type rule:
\frac{1+\tau_t}{1+\tau_{ss}} = \left(\frac{1+\tau_{t-1}}{1+\tau_{ss}}\right)^{\rho}\left(\frac{P_t}{P_{t-1}}\right)^{(1-\rho)\phi}
and calculate the conditional welfare based on oo_.steady_state(index_w,1)+oo_.dr.ghs2(oo_.dr.inv_order_var(index_w),1)/2 from the second order approximation, and I use grid search to find the optimal \phi.
However, I find that the welfare effect of Ramsey policy is lower than that from the optimal simple rule, and I’m not sure why this happens.

The following codes are used to calculate the welfare effects. For the optimal simple rule, run dy_tax_wel.m, which calls the mod file irf_bubbly_tax_wel.mod, and for the Ramsey policy, run irf_bubbly_tax_ramsey. Thank you very much!

ss_AI.m (2.6 KB)
dy_tax_wel.m (1.2 KB)
irf_bubbly_tax_ramsey.mod (6.0 KB)
irf_bubbly_tax_wel.mod (6.0 KB)
solve_steady_state_AI_tau.m (3.9 KB)