Fixed homotopy for perfect foresight models with block option, cosmetic changes.

issue#70
Stéphane Adjemian (Charybdis) 2015-02-20 14:44:45 +01:00
parent dd36a7c255
commit 431e9e596a
1 changed files with 6 additions and 4 deletions

View File

@ -1912,9 +1912,11 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
<< " else" << endl
<< " mthd='UNKNOWN';" << endl
<< " end;" << endl
<< " disp (['-----------------------------------------------------']) ;" << endl
<< " disp (['MODEL SIMULATION: (method=' mthd ')']) ;" << endl
<< " fprintf('\\n') ;" << endl
<< " if options_.verbosity" << endl
<< " printline(41)" << endl
<< " disp(sprintf('MODEL SIMULATION (method=%s):',mthd))" << endl
<< " skipline()" << endl
<< " end" << endl
<< " periods=options_.periods;" << endl
<< " maxit_=options_.simul.maxit;" << endl
<< " solve_tolf=options_.solve_tolf;" << endl
@ -1951,7 +1953,7 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
mDynamicModelFile << " g1=[];g2=[];g3=[];\n";
mDynamicModelFile << " y=" << dynamic_basename << "_" << block + 1 << "(y, x, params, steady_state, 0, y_kmin, periods);\n";
mDynamicModelFile << " tmp = y(:,M_.block_structure.block(" << block + 1 << ").variable);\n";
mDynamicModelFile << " if any(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " if any(isnan(tmp) | isinf(tmp))\n";
mDynamicModelFile << " disp(['Inf or Nan value during the evaluation of block " << block <<"']);\n";
mDynamicModelFile << " return;\n";
mDynamicModelFile << " end;\n";