The deterministic case fails but the stochastic case is OK

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. BK condition is satisfied. And the stochastic simulation works fine.

However, the perfect foresight simulation always fails. It seem that there is a singular Jacobian problem…
I have read the link But there is no similar problem in my mod file.
Any clue how I can solve it? Thank you in advance!

I provide my mod and m files in the attachment (105.5 KB)
The zip file includes both deterministic case and stochastic case. And run “Main_RunMe.m”, you can see the results



found a solution.