deterministic simulation - Newton direction not finite

Hello,
please find attached a code of deterministic simulation.
The same model is running when (*):
- not deterministic simulation is considered, but stochastic
- when I Bayesian estimate the model.
The error message I get during deterministic simulation is the following:
"Some element of Newton direction isn't finite. Jacobian maybe singular or there is a problem with initial values"
In more detail:
"An infinite element was encountered when trying to solve equation(s) 54 with respect to the variable(s): iff."
Please give me some advice, I am completely lost. Because of (*), but especially because equation 54 does not contain variable iff.
Thank you very much in advance!
please find attached a code of deterministic simulation.
The same model is running when (*):
- not deterministic simulation is considered, but stochastic
- when I Bayesian estimate the model.
The error message I get during deterministic simulation is the following:
"Some element of Newton direction isn't finite. Jacobian maybe singular or there is a problem with initial values"
In more detail:
"An infinite element was encountered when trying to solve equation(s) 54 with respect to the variable(s): iff."
Please give me some advice, I am completely lost. Because of (*), but especially because equation 54 does not contain variable iff.
Thank you very much in advance!