Skip to content
Snippets Groups Projects
Commit 6b308ccb authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge branch 'dynare_solve' into 'master'

dynare_solve.m: return with valid solution even if Jacobian is ill-behaved

See merge request Dynare/dynare!1682
parents 7f1fcaa3 1b56a56e
Branches
Tags
1 merge request!1682dynare_solve.m: return with valid solution even if Jacobian is ill-behaved
Pipeline #2628 passed
......@@ -78,6 +78,10 @@ if jacobian_flag
wrong_initial_guess_flag = false;
if ~all(isfinite(fvec)) || any(isinf(fjac(:))) || any(isnan((fjac(:)))) ...
|| any(~isreal(fvec)) || any(~isreal(fjac(:)))
if max(abs(fvec)) < tolf %return if initial value solves problem
info = 0;
return;
end
disp('Randomize initial guess...')
% Let's try random numbers for the variables initialized with the default value.
wrong_initial_guess_flag = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment