Failed to solve perfect foresight model - pollution model

Dear Prof Pfeifer,
I’m trying to simulate a model NK SOE model with pollution externality and exogenous carbon tax under deterministic case. The steady state seems to be ok, BK condition is satisfied and works well under stoch simulation.

However, perfect foresight simulations always fail.
Any clue on how I can solve it? Thank you in advance!

pollution.mod (14.6 KB)

This is hard to debug. The only clue I got is that the simulation seems to have a hard time after the first iteration and diverges. I don’t really have insights into why that is the case. Possible culprits can be the very different scaling of variables (m_t) is huge or problems with the Jacobian at the initial values. For only solver, I got a complaint about u_t being 0. Maybe that helps.