Different formats but same equations leads to different results


There is one problem that confuses me a lot. I have attached my mod. file.
In the file, eq(a) and eq(c) are the same equations; the only difference is that eq(a) is the original format with variable C(+1) and C, and in eq(c), I substituted in the equation for C(+1) and C (equation for C is eq(e)). The same applies to eq (b) and eq(d). However, the model system with eq(c),e(d) works, but with eq(a), eq(b), it won’t work, and it says:
Error using print_info (line 32)
The steady-state has NaNs or Inf.

Error in steady (line 102)
print_info(info,options_.noprint, options_);

Error in fun_simulation_rbc_agg.driver (line 360)

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

I am confused, as these are basically the same equations but in different formats. Why won’t it work with the format of the original equation?

I have attached the PDF file, which shows the equations (a), (b) and (e). Is there anyone know the reason?

Best wishes
equations.pdf (26.2 KB)
fun_simulation_rbc_agg.mod (4.3 KB)

In your initval-block, you have

C = (gamma*C_m^((kappa-1)/kappa)+(1-gamma)*C_n^((kappa-1)/kappa))^(kappa/(kappa-1));

before defining C_m and C_n. That causes NaN.

Dear Johannes,

Thank you so much! I have changed the initial block, and it works!