From 82689795e44b91f81979155b4a795c0b8ae5e4f9 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Wed, 1 Dec 2021 14:36:21 +0100 Subject: [PATCH] dyn_first_order_solver.m: add debugging information --- matlab/dyn_first_order_solver.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/matlab/dyn_first_order_solver.m b/matlab/dyn_first_order_solver.m index e82ae536f..8fceebbe5 100644 --- a/matlab/dyn_first_order_solver.m +++ b/matlab/dyn_first_order_solver.m @@ -275,6 +275,12 @@ if nstatic > 0 b11 = b(1:nstatic, nstatic+1:end); temp(:,index_m) = temp(:,index_m)-A(1:nstatic,:); temp = b10\(temp-b11*ghx); + if DynareOptions.debug + if any(any(~isfinite(temp))) + fprintf('\ndyn_first_order_solver: infinite/NaN elements encountered when solving for the static variables\n') + fprintf('dyn_first_order_solver: This often arises if there is a singularity.\n\n') + end + end ghx = [temp; ghx]; temp = []; end