I tried to build a very simple 3-sector model based on the example given in the user guide. The model contains two intermediate good sectors and one final good sector. The inputs L and K (both total amounts are the same as in the user guide example) are used for the production of the intermediate goods. I checked the steady state in Excel to ensure it is the same as in the user guide example. However, if I run the model in Matlab, Matlab cannot find a solution and it seems that all variables that had no value assigned in the initval-block are equal to zero.

I very much appreciate help in this regard since I cannot find the error. Many thanks!

Many thanks for your quick reply! My worries are that even if I calibrate all variables in the initval-block, Matlab cannot find a solution. As I mentioned, I checked the steady-state values in Excel, so the error must be somewhere in the code. I am wondering whether the accumulation of capital or labor might be a problem, or the calculation of the interest rate “r”. But since I assume perfect substitution between labor and capital in both sectors, I would think that the calculations are fine.

Please find below the initialized version. Sorry for not providing it before.

You can see that the residuals are nonzero and that the “solution” is not symmetric, although the assumptions (production functions for both intermediate goods x and for the final good y) are.

This is always the risk with a nonlinear solver. Obviously your model has more than 1 symmetric steady state. The steady state solver will find the closest local solution. In this case, you need to compute the steady state analytically.

To 1.: I cannot see a difference between both equations. What exactly is the problem with the capital accumulation? I would appreciate if you could explain the intuition why I need to change this equation.

Since “k” is not essential in the model, I provide you below with the same model except for a missing k which I commented. The model still doesn’t run properly.

To 2.: I did compute the steady state analytically and used the values in the model (as described before, I calculated it in Excel and did no encounter any problems with the equations). Nevertheless, Matlab doesn’t use these values for the steady state.

The way you defined it before, k did never appear contemporaneously in your model. That cannot be correct. The way I wrote the equation, it is simply a definition of the capital stock at time t. But as this is only a definition, it will not affect the rest of the model.

You can see from the output of resid that your initial values do not solve the model equations you entered. Therefore, either your entered equations are wrong or your previous computations.

I agree that there must be an error in the code. However, I cannot find it although I searched for it many times. In addition, I also tried different calibrations and the model never solves. This again points to an error in the code, which is untraceable for me.

I would really appreciate if you could have a look at the code once more. Many thanks for your help!