Only accept steady state when fsolve retuns with normal return code 1

Otherwise, termination due to tolerance criteria will be accepted as correct steady state
time-shift
Johannes Pfeifer 2015-11-16 11:11:58 +01:00
parent a55f00073b
commit 1457666221
1 changed files with 9 additions and 1 deletions

View File

@ -113,8 +113,16 @@ if options.solve_algo == 0
end;
end
if exitval > 0
if exitval == 1
info = 0;
elseif exitval > 1
M=evalin('base','M_'); %get variable names from workspace
resid = evaluate_static_model(x,varargin{:},M,options);
if max(abs(resid)) > 1e-6
info = 1;
else
info = 0;
end
else
info = 1;
end