Skip to content
Snippets Groups Projects
Commit d9b6d5d9 authored by Ferhat Mihoubi's avatar Ferhat Mihoubi
Browse files

Adds the index of equations (M_.blocksEQU) for a block decomposed model...

Adds the index of equations (M_.blocksEQU) for a block decomposed model without bytecode option and use this index in resid.m to retrieve the residuals
parent 9a96fc12
Branches
Tags
No related merge requests found
...@@ -77,11 +77,7 @@ if options_.block && ~options_.bytecode ...@@ -77,11 +77,7 @@ if options_.block && ~options_.bytecode
oo_.steady_state,... oo_.steady_state,...
[oo_.exo_steady_state; ... [oo_.exo_steady_state; ...
oo_.exo_det_steady_state], M_.params); oo_.exo_det_steady_state], M_.params);
if isempty(M_.blocksMFS{i}) idx = M_.blocksEQU{i};
idx = var_indx;
else
idx = M_.blocksMFS{i};
end
z(idx) = r; z(idx) = r;
end end
elseif options_.bytecode elseif options_.bytecode
......
...@@ -1354,6 +1354,15 @@ StaticModel::writeOutput(ostream &output, bool block) const ...@@ -1354,6 +1354,15 @@ StaticModel::writeOutput(ostream &output, bool block) const
output << "];" << endl; output << "];" << endl;
} }
output << "M_.blocksEQU = cell(" << nb_blocks << ", 1);" << endl;
for (int b = 0; b < (int) nb_blocks; b++)
{
unsigned int block_size = getBlockSize(b);
output << "M_.blocksEQU{" << b+1 << "} = [ ";
for (int i = 0; i < (int) block_size; i++)
output << getBlockEquationID(b, i)+1 << "; ";
output << "];" << endl;
}
} }
SymbolType SymbolType
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment