I am trying to solve an open economy model for 2 countries.
I have the following mod, function and steady state file.

Dynare says that there is some issue- “Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.” I have tried to see if I have written the function incorrectly, but that’s not the case.

I am calling a function into the steady state file, and running the mod file. My files are attached.

I have corrected the codes, as suggested. instead of a function file, I created an anonymous function as is usually there in these codes. the steady state file is complete. I still have the following issues in implementing this open economy model for large economies.

(a) The residuals indicate that I need to pick a value of consumption home and abroad which also implies that marginal utility of money across economies is identical because they are a part of eurozone.

(b) I solved them using ‘levenbergMarquardt’ and ‘fsolve’ both. Could it be a possibility that there are no roots possible? Or is it an issue with the way I am closing large open economies like the ones I am trying to model?

I have updated the files. And I thanks for the prompt reply.

Your steady state file says that the system of equations was sucessfully solved. At the same time, Dynare complains that two equations have residuals. This usually means that the steady state file and the entered model do not match. There is either a problem with you steady state file, or the entered model equations are still wrong (or both). For the beginning, focus on the equations with residuals.