Skip to content
Snippets Groups Projects
Commit b1fc34ef authored by Michel Juillard's avatar Michel Juillard
Browse files

fix bug when there are constraints both on ramsey policy instrument and on

other variables
parent 211a07c7
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,10 @@ end ...@@ -52,6 +52,10 @@ end
etags = M.equations_tags; etags = M.equations_tags;
for i=1:size(etags,1) for i=1:size(etags,1)
if strcmp(etags{i,2},'mcp') if strcmp(etags{i,2},'mcp')
eq_nbr = etags{i,1};
if ramsey_policy
eq_nbr = eq_nbr + M.ramsey_eq_nbr;
end
str = etags{i,3}; str = etags{i,3};
kop = strfind(etags{i,3},'<'); kop = strfind(etags{i,3},'<');
if ~isempty(kop) if ~isempty(kop)
...@@ -61,8 +65,8 @@ for i=1:size(etags,1) ...@@ -61,8 +65,8 @@ for i=1:size(etags,1)
'not recognized'],etags{i,3},strtrim(str(1:kop-1)))) 'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
end end
ub(k) = str2num(str(kop+1:end)); ub(k) = str2num(str(kop+1:end));
eq_index(etags{i,1}) = k; eq_index(eq_nbr) = k;
eq_index(k) = etags{i,1}; eq_index(k) = eq_nbr;
else else
kop = strfind(etags{i,3},'>'); kop = strfind(etags{i,3},'>');
if ~isempty(kop) if ~isempty(kop)
...@@ -72,8 +76,8 @@ for i=1:size(etags,1) ...@@ -72,8 +76,8 @@ for i=1:size(etags,1)
'not recognized'],etags{i,3},strtrim(str(1:kop-1)))) 'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
end end
lb(k) = str2num(str(kop+1:end)); lb(k) = str2num(str(kop+1:end));
eq_index(etags{i,1}) = k; eq_index(eq_nbr) = k;
eq_index(k) = etags{i,1}; eq_index(k) = eq_nbr;
else else
error(sprintf(['Complementarity condition %s can''t be ' ... error(sprintf(['Complementarity condition %s can''t be ' ...
'parsed'],etags{i,3})) 'parsed'],etags{i,3}))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment