A question about Blanchard & Kahn conditions

dear all
I built an OLG model to study changes in the relative levels of two commodity prices, but now encountered a programming error:

Blanchard & Kahn conditions are not satisfied: indeterminacy.

Moreover, the model checking command did not detect any significant errors:

MODEL_DIAGNOSTICS: No obvious problems with this mod-file were detected.

I tried to change the values of some parameters, but it didn’t solve the problem.
I have attached the code to the attachment. Can anyone help me?
Thank you for your attention!

model.mod (2.3 KB)

Check your timing. For example, is the timing of the price level in

p(+1) * B * log(1 + exp(k) / B) + r * exp(d) / pai_a(+1) = exp(x_2(+1)) + p(+1) * exp(y_2(+1));


Dear professor, thank you for your attention.
This is the market clearing condition for the second phase of the agent in the OLG model.
The modeling process looks like this

So did I set the timing wrong during modeling?

You need to ask yourself when these decisions are taken. Is the equation above really reflecting a decision at time t based on expectations about the future? Or is this decision taken once the household enters period 2. In that case, the whole equation needs to be shifted by one period as the household observes e.g. prices.

thank you very much! the problem solved!
Although I’ve been studying DSGE and DYNARE for years, I still feel like I’m missing the point in some areas.
In addition to reading this forum, are there any books or papers or resources you would recommend for me to study if I want to make progress in this field like you?
Because every time I come across this kind of problem, I always panic and don’t know where to start to solve it.

Blanchard & Kahn conditions are not satisfied: indeterminacy.

Unfortunately, debugging is mostly a matter of experience.

What a pity…
Thank you again for your help