Dear Prof Pfeifer,

I’m trying to simulate a simple model under deterministic case. The model is small. The steady state is easy to solve. And BK condition is satisfied.

However, perfect foresight simulations always fail. And it is driving me crazy.

Any clue how I can solve it? Thank you in advance!

I provide my mod and m files in the attachment.GTmodel.zip (3.6 KB)

The problem is the equation

`Lam(1)*(R(1) + 1 - del) = 1;`

All variables here are dated `t+1`

. Thus, in the last period, the derivative with respect to all variables will be 0. This is no problem for stochastic simulation. For deterministic ones, do not rely on auxiliary definitions. Use

```
beta*C/C(+1)/G*(R(1) + 1 - del) = 1;
```

and the file will work.

1 Like

Thank you so much! There are more to learn in deterministic models!