Added check for NaN in Jacobian to stochastic_solvers and added explicit error message to print_info.m
parent
cf2e477e58
commit
1a968d5f22
|
@ -51,7 +51,20 @@ if ~noprint
|
||||||
case 7
|
case 7
|
||||||
error(['One of the eigenvalues is close to 0/0 (the absolute ' ...
|
error(['One of the eigenvalues is close to 0/0 (the absolute ' ...
|
||||||
'value of numerator and denominator is smaller than 1e-6)'])
|
'value of numerator and denominator is smaller than 1e-6)'])
|
||||||
case 19
|
case 8
|
||||||
|
if ~isempty(info(2))
|
||||||
|
global M_;
|
||||||
|
disp_string=deblank(M_.param_names(info(2),:));
|
||||||
|
for ii=1:length(info)-2
|
||||||
|
disp_string=[disp_string,', ',deblank(M_.param_names(info(2+ii),:))];
|
||||||
|
end
|
||||||
|
error(['The Jacobian contains NaNs because the following parameters are NaN: '...
|
||||||
|
disp_string])
|
||||||
|
else
|
||||||
|
error(['The Jacobian contains NaNs'])
|
||||||
|
end
|
||||||
|
|
||||||
|
case 19
|
||||||
error('The steadystate file did not compute the steady state')
|
error('The steadystate file did not compute the steady state')
|
||||||
case 20
|
case 20
|
||||||
error(['Impossible to find the steady state. Either the model' ...
|
error(['Impossible to find the steady state. Either the model' ...
|
||||||
|
|
|
@ -120,6 +120,13 @@ if ~isreal(jacobia_)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if any(any(isnan(jacobia_)))
|
||||||
|
info(1) = 8;
|
||||||
|
NaN_params=find(isnan(M_.params));
|
||||||
|
info(2:length(NaN_params)+1) = NaN_params;
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
kstate = dr.kstate;
|
kstate = dr.kstate;
|
||||||
kad = dr.kad;
|
kad = dr.kad;
|
||||||
kae = dr.kae;
|
kae = dr.kae;
|
||||||
|
|
Loading…
Reference in New Issue