Skip to content
Snippets Groups Projects
Commit d97683c2 authored by sebastien's avatar sebastien
Browse files

Improve treatment of error messages in homotopy

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2895 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 85ac76b9
No related branches found
No related tags found
No related merge requests found
...@@ -77,9 +77,5 @@ function homotopy1(values, step_nbr) ...@@ -77,9 +77,5 @@ function homotopy1(values, step_nbr)
oo_.exo_steady_state(values(ix,2)) = points(ix,i); oo_.exo_steady_state(values(ix,2)) = points(ix,i);
oo_.exo_det_steady_state(values(ixd,2)) = points(ixd,i); oo_.exo_det_steady_state(values(ixd,2)) = points(ixd,i);
try
steady_; steady_;
catch
error('HOMOTOPY mode 1: failed')
end
end end
...@@ -100,11 +100,7 @@ function homotopy2(values, step_nbr) ...@@ -100,11 +100,7 @@ function homotopy2(values, step_nbr)
disp([ 'HOMOTOPY mode 2: lauching solver with ' strtrim(varname) ' = ' num2str(v) ' ...']) disp([ 'HOMOTOPY mode 2: lauching solver with ' strtrim(varname) ' = ' num2str(v) ' ...'])
try
steady_; steady_;
catch
error('HOMOTOPY mode 2: failed')
end
end end
end end
\ No newline at end of file
...@@ -103,7 +103,8 @@ function homotopy3(values, step_nbr) ...@@ -103,7 +103,8 @@ function homotopy3(values, step_nbr)
end end
oldvalues = curvalues; oldvalues = curvalues;
inc = 2*inc; inc = 2*inc;
catch catch E
disp(E.message)
disp('HOMOTOPY mode 3: failed step, now dividing increment by 2...') disp('HOMOTOPY mode 3: failed step, now dividing increment by 2...')
inc = inc/2; inc = inc/2;
oo_.steady_state = old_ss; oo_.steady_state = old_ss;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment