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.
time-shift
Johannes Pfeifer 2013-08-22 09:49:29 +02:00
parent 139bebd810
commit f77c1f2843
1 changed files with 8 additions and 1 deletions

View File

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