From 139bebd8109a2af9f5b467eda70d24a4534bda75 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Thu, 22 Aug 2013 09:47:39 +0200 Subject: [PATCH 1/2] Fix display of residuals before displaying error message The computed steady state was not updated. --- matlab/steady.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/steady.m b/matlab/steady.m index 5ae9a0ac9..2981bc8e3 100644 --- a/matlab/steady.m +++ b/matlab/steady.m @@ -79,9 +79,9 @@ if info(1) end [steady_state,M_.params,info] = steady_(M_,options_,oo_); +oo_.steady_state = steady_state; if info(1) == 0 - oo_.steady_state = steady_state; if options_.noprint == 0 disp_steady_state(M_,oo_); end From f77c1f28435d6ea78b1ed6e5e2d715ec55b32c17 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Thu, 22 Aug 2013 09:49:29 +0200 Subject: [PATCH 2/2] Fix model_diagnostics.m for case where check1 contains NaN as second output Also stops execution when steady state could not be computed as Jacobian at this incorrect steady state is wrong. --- matlab/model_diagnostics.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/matlab/model_diagnostics.m b/matlab/model_diagnostics.m index dc9f58e59..06eaf2bad 100644 --- a/matlab/model_diagnostics.m +++ b/matlab/model_diagnostics.m @@ -65,8 +65,15 @@ end [dr.ys,params,check1]=evaluate_steady_state(oo.steady_state,M,options,oo,1); % testing for problem -if check1 +if check1(1) disp('model diagnostic can''t obtain the steady state') + if any(isnan(dr.ys)) + disp(['model diagnostic obtains a steady state with NaNs']) + end + if any(isinf(dr.ys)) + disp(['model diagnostic obtains a steady state with Inf']) + end + return; end if ~isreal(dr.ys)