Page 1 of 1

Using fsolve inside the mod file

PostPosted: Mon Feb 14, 2011 4:06 am
by bigbenmike
Hi, guys:

Can I use fsolve inside a mod file, since the computation of the steady state involves some nonlinear roots finding process.

To be exact, can I just put the following line in the "model" block?

#para1=1.0039;
#para2=0.0001;
#ha_ja=.038;

#xx=fsolve(@(x) para2*x^(sigma-1)-1/ha_ja*x^sigma-para1,.4);
#ha_oz=xx(1);


If I cannot do that, how can I solve the steady state if it cannot be done with paper and pen?

Re: Using fsolve inside the mod file

PostPosted: Tue Feb 22, 2011 9:42 am
by SébastienVillemot
  • Create a steady_state file for your model: search the forum for examples
  • If needed, you can refer to the steady state values of your variables from the (dynamic) model, using the following syntax: STEADY_STATE(y)