# Same code different versions

**URL:** <https://forum.dynare.org/t/same-code-different-versions/1001>\
**Category:** Dynare help (legacy posts)\
**Created:** [3 April 2009 18:20 UTC](https://forum.dynare.org/t/same-code-different-versions/1001 "2009-04-03T18:20:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maddy](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/838e76/32.png) [@maddy](https://forum.dynare.org/u/maddy)\
**Post date:** [3 April 2009 18:20 UTC](https://forum.dynare.org/t/same-code-different-versions/1001/1 "2009-04-03T18:20:32Z")

</div>

Hi,  
I am able to run my program in version 3 when the order is 1. When I try to set order = 2, I get the following error:

??? Invalid MEX-file ‘C:…\dynare\_v3\matlab\gensylv.dll’: The specified procedure could not be found.

.  
Error in ==\> dr1 at 443  
ghxx = gensylv(2,A,B,C,D);

Error in ==\> resol at 56  
[dr,info] = dr1(dr,check\_flag);

Error in ==\> stoch\_simul at 47  
[dr\_, info] = resol(ys\_,0);

Error in ==\> mymodel at 118  
info=stoch\_simul(var\_list\_);

Error in ==\> dynare at 26  
evalin(‘base’,fname) ;

When I switched to Version 4, I cannot run the same program (code attached). Where am I going wrong?

Thanks,  
Maddy  
[mymodel.mod](https://forum.dynare.org/uploads/default/original/1X/3a0f55ea586a2f8b6e7deebdea2d6164d1a6679a.mod) (891 Bytes)

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [4 April 2009 11:41 UTC](https://forum.dynare.org/t/same-code-different-versions/1001/2 "2009-04-04T11:41:47Z")

</div>

Dear Maddy,

For dynare version 3, I don’t know your platform and your version of matlab but the problem may be that your gensylv dll is outdated (I had this problem recently)… Remove this dll and replace it by the file gensylv.dll or gensylv.mexw32 distributed with dynare version 4 (4.0.3)

For dynare verion 4, I can’t find the steady state… Even if I initialize with the one found with dynare version 3 (actually the steady state given by dynare\_v3 is not very good, the residuals of the static equations are not exactly zero). Don’t you have an analytical expression for the steady state?

Best,  
Stéphane.

---

<div class="post-metadata">

**Author:** ![maddy](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/838e76/32.png) [@maddy](https://forum.dynare.org/u/maddy)\
**Post date:** [6 April 2009 17:53 UTC](https://forum.dynare.org/t/same-code-different-versions/1001/3 "2009-04-06T17:53:15Z")

</div>

Thanks, I was able to solve the problem of order =2 by copying the file from Version 4.  
I face the same problem of not finding the steady state in Version 4. I have the ratio of steady state variables analytically - I don’t know how to use this to find the right steady state values.

Maddy

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [6 April 2009 18:52 UTC](https://forum.dynare.org/t/same-code-different-versions/1001/4 "2009-04-06T18:52:30Z")

</div>

If you are able to obtain epression for steady state ratios it means that you can concentrate the problem. For instance, if you can express the ratio of Y and K as a function of deep parameters, say f(\theta), then you can replace Y by K\*f(\theta). You can do this in the steadystate file associated to your mod file, and call a newton-like algorithm for the remaining variables.

Best,  
Stéphane.

---

<div class="post-metadata">

**Author:** ![maddy](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/838e76/32.png) [@maddy](https://forum.dynare.org/u/maddy)\
**Post date:** [6 April 2009 22:34 UTC](https://forum.dynare.org/t/same-code-different-versions/1001/5 "2009-04-06T22:34:27Z")

</div>

Thanks again for your message! I was hoping to find an example of writing the steady state in the dynare user guide, but it is to be added shortly. Could you give me an example of how I can call the steady state? These are the ss ratios for my model.

m = (((1/ALPHA)_(1/BETA-1+DELTA))^(1/1-ALPHA))k  
c = ((1/ALPHA)(1/BETA-1+DELTA)-((1/ALPHA)_(1/BETA-1+DELTA))^(1/1-ALPHA)-DELTA)\*k

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [7 April 2009 07:26 UTC](https://forum.dynare.org/t/same-code-different-versions/1001/6 "2009-04-07T07:26:10Z")

</div>

You’ll find an example on the forum [here](https://forum.dynare.org/t/steady-state-file/782/4).

Best, Stéphane.
