trunk: fixed bugs in homotopy mode 3
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2084 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
6d08e65071
commit
772e3be8b3
|
@ -78,7 +78,6 @@ function homotopy3(values, step_nbr)
|
|||
inc = (targetvalues-oldvalues)/2;
|
||||
kplus = [];
|
||||
kminus = [];
|
||||
old_ss = oo_.steady_state;
|
||||
|
||||
disp('HOMOTOPY mode 3: launching solver at initial point...')
|
||||
|
||||
|
@ -89,6 +88,7 @@ function homotopy3(values, step_nbr)
|
|||
oo_.exo_steady_state(values(ix,2)) = curvalues(ix);
|
||||
oo_.exo_det_steady_state(values(ixd,2)) = curvalues(ixd);
|
||||
|
||||
old_ss = oo_.steady_state;
|
||||
[oo_.steady_state,check] = dynare_solve([M_.fname '_static'],...
|
||||
oo_.steady_state,...
|
||||
options_.jacobian_flag, ...
|
||||
|
@ -113,9 +113,9 @@ function homotopy3(values, step_nbr)
|
|||
end
|
||||
curvalues = oldvalues + inc;
|
||||
kplus = find(curvalues(iplus) >= targetvalues(iplus));
|
||||
curvalues(kplus) = targetvalues(kplus);
|
||||
curvalues(iplus(kplus)) = targetvalues(iplus(kplus));
|
||||
kminus = find(curvalues(iminus) <= targetvalues(iminus));
|
||||
curvalues(kminus) = targetvalues(kminus);
|
||||
curvalues(iminus(kminus)) = targetvalues(iminus(kminus));
|
||||
|
||||
if max(abs(inc)) < tol
|
||||
error('HOMOTOPY mode 3: failed, increment has become too small')
|
||||
|
|
Loading…
Reference in New Issue