Error: max_recursion_depth exceeded

Dear Professor,
This follows my previous message which can be discarded. After making few correction on my steady state file, I got the following error message:
error: max_recursion_depth exceeded
How can i set this issue in my steady state file to make the Ramsey code run?
Thanks

Where exactly does that problem show up, i.e. what is the full error message?

Thank you,
In fact, the message in as follows:
Using 32-bit preprocessor
Starting Dynare (version 4.5.7).
Starting preprocessing of the model file …
Ramsey Problem: added 12 Multipliers.
Found 12 equation(s).
Found 27 FOC equation(s) for Ramsey Problem.
Evaluating expressions…done
Computing static model derivatives:
*** - order 1***
Computing dynamic model derivatives:
*** - order 1***
*** - order 2***
Computing static model derivatives:
*** - order 1***
*** - order 2***
*** - order 3***
Processing outputs …
done
Preprocessing completed.
error: max_recursion_depth exceeded
I am runing the code on Octave 4.4.1
I tried the same code on Matlab but I got a different error message as follows:
Failure in initial objective function evaluation. FSOLVE cannot continue.

Then this is an Octave issue.

Dear Professor,
I tried on Matlab and got a different error message as follows/
Using 64-bit preprocessor
Starting Dynare (version 4.5.7).
Starting preprocessing of the model file …
Ramsey Problem: added 12 Multipliers.
Found 12 equation(s).
Found 27 FOC equation(s) for Ramsey Problem.
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Computing static model derivatives:
  • order 1
  • order 2
  • order 3
    Processing outputs …
    done
    Preprocessing completed.

Error: File: Benin_steadystate.m Line: 6 Column: 15
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other
syntax error. To construct matrices, use brackets instead of parentheses.

Error in evaluate_steady_state_file (line 52)
[ys,check] = h_steadystate(ys_init, exo_ss);

Error in evaluate_steady_state (line 212)
[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, options,steadystate_check_flag);

Error in resol (line 104)
[dr.ys,M.params,info] = evaluate_steady_state(oo.steady_state,M,options,oo,~options.steadystate.nocheck);

Error in check (line 73)
[dr,info,M,options,oo] = resol(1,M,options,oo);
Error in Benin (line 306)
oo_.dr.eigval = check(M_,options_,oo_);
Error in dynare (line 235)
evalin(‘base’,fname) ;

I checked my steady state code but unable to pin down the error.

Always provide the latest files.

Dear Professor,
These are the latest code I ran to get the error message above.
Regard
Fiscal.mod (4.0 KB) Fiscal_steadystate.m (2.8 KB)

Please be more careful and think about what you are doing before posting.
Instead of adding a white space in a single line, you did a search and replace. The model structure is still called M_. So

isfield(M_ lgy_.'param_nbr') == 1

should for example be

isfield(M_.'param_nbr') == 1

Dear Professor,
Thank you for your remark. I fixed the error and reran it but got different outcome.
Here is the error message:
Failure in initial objective function evaluation. FSOLVE cannot continue.
Though i’ve written the objective function properly in the code

Again, please always provide the latest files.

Dear professor,
I can’t figure out the mistake I am making in the steady state file which leads to the error message sent out by Matlab as follows,
Failure in initial objective function evaluation. FSOLVE cannot continue
I wonder whether the treatment of the instruments in the steady state file is wrong. I set them as unknowns but with initial values set to 0 as there is no equation for these instruments relating them to other variables in the system. I tried many options for the solver but still getting the same message.

In your steady state file, you are calling

[x,fval,exitflag] = fsolve(@Benin_steadystate, x0,options); % Solving the nonlinear system

where does the function Benin_steadystate come from? You did not upload it.

Dear professor,**
You are right. I did rename the file to keep the previous one. The correct names are as follows*
Fiscal.mod (4.0 KB) Benin_steadystate.m (3.2 KB)
I am trying to attach the file with the correct names but it still attaching the file with the name Fiscal instead of Benin. I think my windows system might be facing a challenge

I think this is your problem. Within your steady state file, you are supposed to call a second file solving a simplified problem. As is, you are simply calling the same file again, leading to an infinite recursion.

Good morning professor,
I followed the example file on steady state file you posted “blt_old_ramsey_steadystate.m”
and replicate the file exactly as it is structured by changing the equations and parameters by those in my model. And then I gave the same .mod file name to the steady state file to make sure I followed your instruction. That is how i set the steady state file.
But it seems not to be the convenient way. Could explain to me how I should structure the steady state file?
Thanks

I am sure I did not provide an example with an infinite recursion.

Dear Professor,
I mas talking about a link you provided in a previous post. The link directed me to an example of steady file posted on the forum which I downloaded and used it.

But the way you did it is not correct. Please refer to the NK_baseline_steadystate.m in the Dynare examples folder.