Skip to content
Snippets Groups Projects
Verified Commit 0147faad authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fix stack_solve_algo=1 without bytecode, on solve two boundaries simple/complete blocks

The result for the last simulation period was wrong.
parent c9825c80
No related branches found
No related tags found
No related merge requests found
...@@ -47,7 +47,7 @@ function [y, T, oo]= solve_two_boundaries(fname, y, x, params, steady_state, T, ...@@ -47,7 +47,7 @@ function [y, T, oo]= solve_two_boundaries(fname, y, x, params, steady_state, T,
% none. % none.
% %
% Copyright (C) 1996-2020 Dynare Team % Copyright (C) 1996-2022 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -187,8 +187,8 @@ while ~(cvg==1 || iter>maxit_) ...@@ -187,8 +187,8 @@ while ~(cvg==1 || iter>maxit_)
B1_inv = inv(g1a(Elem, Elem)); B1_inv = inv(g1a(Elem, Elem));
if (t < periods) if (t < periods)
S1 = B1_inv * g1a(Elem, Elem_1); S1 = B1_inv * g1a(Elem, Elem_1);
end
g1a(Elem, Elem_1) = S1; g1a(Elem, Elem_1) = S1;
end
b(Elem) = B1_inv * b(Elem); b(Elem) = B1_inv * b(Elem);
g1a(Elem, Elem) = ones(Blck_size, Blck_size); g1a(Elem, Elem) = ones(Blck_size, Blck_size);
if t<periods if t<periods
...@@ -203,6 +203,7 @@ while ~(cvg==1 || iter>maxit_) ...@@ -203,6 +203,7 @@ while ~(cvg==1 || iter>maxit_)
dx = ya; dx = ya;
dx(y_Elem) = za - ya(y_Elem); dx(y_Elem) = za - ya(y_Elem);
ya(y_Elem) = ya(y_Elem) + lambda*dx(y_Elem); ya(y_Elem) = ya(y_Elem) + lambda*dx(y_Elem);
y(y_index, y_kmin + periods) = ya(y_Elem);
for t=periods-1:-1:1 for t=periods-1:-1:1
first_elem = (t-1)*Blck_size+1; first_elem = (t-1)*Blck_size+1;
last_elem = t*Blck_size; last_elem = t*Blck_size;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment