Page 1 of 1

Numeric steady state solution in the model block

PostPosted: Mon Jun 13, 2016 2:40 pm
by marcusingholt
I have a model where an essential part of the steady state is solved numerically (rather than analytically) through Matlab's fsolve command. fsolve is called from the steady state file.

Now, I wish to include a steady state term into the model block of my .mod-file. Normally, this can be accomplished through pound operators (i.e., #), but pound operators do not accept Matlab functions such as fsolve. Consequently, I am not able to derive the steady state with pound operations in the beginning of the model block.

Is there a way to include steady state terms into the model block of the .mod-file when the steady state is solved numerically through Matlab functions?

Yours sincerely,
Marcus Mølbak Ingholt
Ph.D. Candidate
University of Copenhagen

Re: Numeric steady state solution in the model block

PostPosted: Mon Jun 13, 2016 4:01 pm
by jpfeifer
Use the
Code: Select all
steady_state()

command inside of the model block. If the steady state can be computed numerically, this will work.

Re: Numeric steady state solution in the model block

PostPosted: Tue Jun 14, 2016 8:32 am
by marcusingholt
Thank you for your quick reply.

Does steady_state() also work during estimation when parameters, hence the steady state, is continuously updated by the computer? That is, does steady_state(y) update the steady state of y when the underlying parameters that determine y in steady state are changed, e.g., during an estimation?

Re: Numeric steady state solution in the model block

PostPosted: Tue Jun 14, 2016 10:08 am
by jpfeifer
Yes. If you make sure your steady states themselves are correctly updated, the steady_state()-operator will take this into account by substituting the recomputed steady state.

Re: Numeric steady state solution in the model block

PostPosted: Tue Jun 14, 2016 2:52 pm
by marcusingholt
That is great. Once again, thank you.