Steady state impossible to find after 2nd order stochastic simulation

Dear all,
I am currently working on replicating the model from Heathcote and Perri’s paper “The International Diversification Puzzle is not as bad as you think” (2013) (paper here ) in Dynare using the Devereux-Sutherland method.
kkk.mod (13.1 KB)

I find the steady state, and dynare runs the first order stochastic simulation well. However, when it comes to the second order stochastic simulation it shows the following error message:
Error using print_info (line 83)
Impossible to find the steady state. Either the model doesn’t have a steady state, there
are an infinity of steady states, or the guess values are too far from the solution

Error in stoch_simul (line 100)
print_info(info, options_.noprint, options_);

Error in kkk (line 497)
info = stoch_simul(var_list_);

Error in dynare (line 235)
evalin(‘base’,fname) ;

Model diagnostics also says that nothing is wrong with the model. Please help! URGENT!

Kind regards,
Ivan Cvetkovic

I am getting an error that the inx function is missing.

inx.m (349 Bytes)
I apologize, I forgot to attach the function. Here it is

When i use resid before the call, I get:

Equation number 43 : 6172895040186.498

Focus on that equation