Perfect foresight solution from a point out of SS-Bank run

Dear Professor Jpfeifer ,
I am working in a model of bank run. I have written my .mod file for an economy with banking sector. without bank run, everything works great. Now I would like to simulate the situation with bank run. So according to Gertler Kiyotaki 2015, the economy starts at the SS at t=0. at period one, a shock hits the economy. At period two bank run happens and banking sector becomes inactive(so the economy goes to the model without banking sector). At period three the economy starts with the same model with banking sector at period zero with an initial values of end of period two and goes toward the SS. I have calculated the endogenous variables at period two(without banking sector) out of dynare and I would like to put these values at the initial values in a deterministic model and ask dynare to calculate perfect foresight solution from the initial values without banking sector to the SS with banking sector. I put the initval; block and simul(periods=500,stack_solve_algo = 0); but it was not successful. Then I realised that the endogenouse variables in oo._endo._simul(:,1) are not set as the initial values I have set in initval; block. Then I read your post at [Optimal policy in timeless perspective) so I manually changed the initial values. It still does not work. I even used the LMMCP at dynare.org/DynareWiki/NewFeatures, but it does not work. I was wondering if you could guide me to find how I can solve it. In general, is it possible to start from a point (out of steady state) and ask dynare to calculate the way to the SS? I put .mod file and others in a Zip file.
I am looking forward to hearing from you.
Sincerely,
Leo
Var_at_run.zip (7.52 KB)

Have you checked whether the terminal value provided is really the steady state of the model? And if yes, have you checked whether the model converges to this steady state if started from a slightly different initial condition? If that is both the case, how different are the initial conditions you are trying to set from the terminal ones?

Dear Professor Jpfeifer,
Yes, the terminal value is really the steady state calculated by the external file. The initial values are totally different from the SS of the model, because they come from the other model(without banking sector). You mean, I slightly change the SS of each variable and put it as the initial value(one by one) and see it is converge or not? How can I check it is convergent? Should I check : oo_.deterministic_simulation.status ?
Sincerely,
Leo

If your terminal condition really is a steady state, these values should solve the model. I.e. if you start from these values, you should stay there. If the model is locally stable, if you slightly alter these values, the model should converge to this steady state and stay there. This is something you should try. If the model does not locally converge to the provided values, then starting from further away will usually also not be sucessful. The way to go would be to put the steady state in endval and a slightly changed version in initval.