Merge branch 'static_singularity' into 'master'

dyn_first_order_solver.m: add debugging information

See merge request Dynare/dynare!1965
pac-components
Sébastien Villemot 2021-12-01 17:53:18 +00:00
commit 8b3fc97631
1 changed files with 6 additions and 0 deletions

View File

@ -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