From 0ee98ebd872dd55d6c9f19b5688d80eea0db3a27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stepan@adjemian.eu>
Date: Mon, 23 Sep 2024 21:18:00 +0200
Subject: [PATCH] Delete a vestige: do not call simul() but
 perfect_foresight_solver().

Fixes crash of det_cond_forecast with expected shocks without surprises.

(cherry picked from commit 104f2fe8651be11ba8acae4d3263d5ed355fb139)
---
 matlab/perfect-foresight-models/det_cond_forecast.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/perfect-foresight-models/det_cond_forecast.m b/matlab/perfect-foresight-models/det_cond_forecast.m
index b7468e1353..4652c6c582 100644
--- a/matlab/perfect-foresight-models/det_cond_forecast.m
+++ b/matlab/perfect-foresight-models/det_cond_forecast.m
@@ -429,7 +429,7 @@ if pf && ~surprise
         not_achieved = 1;
         alpha = 1;
         while not_achieved
-            simul();
+            oo_ = perfect_foresight_solver(M_, options_, oo_);
             result = sum(sum(isfinite(oo_.endo_simul(:,time_index_constraint)))) == ny * constrained_periods;
             if result
                 y = oo_.endo_simul(constrained_vars, time_index_constraint);
-- 
GitLab