# Dynare on Mac vs PC - steady state errors

**URL:** <https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243>\
**Category:** Dynare help (legacy posts)\
**Created:** [2 June 2017 11:54 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243 "2017-06-02T11:54:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jd1090](https://forum.dynare.org/user_avatar/forum.dynare.org/jd1090/32/5086_2.png) [@jd1090](https://forum.dynare.org/u/jd1090)\
**Post date:** [2 June 2017 11:54 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/1 "2017-06-02T11:54:24Z")

</div>

Hi,

I’ve recently switched from using a PC to using a MAC and I encountered some issues. Namely, for some reason, the .mod files that use the non-linear solver fsolve to compute the steady states always result in sizeable residuals all over the model equations on my MAC (even though the .mod files run fine on the PC without any residuals). I’ve tried using both stable and unstable versions of dynare, but the issue prevails. Other .mod files without fsolve also work fine on both PC and MAC.

The strange thing is that the _steadystate.m file works fine separately (gives rise to accurate steady state values as in PC), but as soon as I run the .mod file, the results in the oo_.steady\_state are mostly complex values. There seems to be some sort of mapping bug.

Any suggestions? Thanks

P.S. I’m using Mac OS X Yosemite 10.10.5 and Matlab 2016a.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [4 June 2017 15:13 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/2 "2017-06-04T15:13:12Z")

</div>

Could you please provide me with the files

---

<div class="post-metadata">

**Author:** ![jd1090](https://forum.dynare.org/user_avatar/forum.dynare.org/jd1090/32/5086_2.png) [@jd1090](https://forum.dynare.org/u/jd1090)\
**Post date:** [4 June 2017 16:18 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/3 "2017-06-04T16:18:29Z")

</div>

Thanks for taking the time to look at it.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [5 June 2017 17:21 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/4 "2017-06-05T17:21:41Z")

</div>

We had a look at this and could not replicate the issue on Mac. Could you please try to copy the file to a different folder an run it there. That’s a quick check whether there is some file conflict.

---

<div class="post-metadata">

**Author:** ![jd1090](https://forum.dynare.org/user_avatar/forum.dynare.org/jd1090/32/5086_2.png) [@jd1090](https://forum.dynare.org/u/jd1090)\
**Post date:** [6 June 2017 05:16 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/5 "2017-06-06T05:16:50Z")

</div>

That’s weird. I’ve tried copying them to other folders (only three of the above files) and into other versions of dynare, but I always get the following in the .log file:

[quote]Starting Dynare (version 4.6-unstable-079bf6c60e6fbc5db99759041cf33b739be0f570).  
Starting preprocessing of the model file …  
Found 82 equation(s).  
Evaluating expressions…done  
Computing static model derivatives:

- order 1  
Computing dynamic model derivatives:
- order 1
- order 2  
Processing outputs …  
done  
Preprocessing completed.

resid: The initial values for the steady state of the following variables are complex:  
y\_US  
c\_US  
nx\_US  
uc\_US  
ul\_US  
GAMMA\_US  
l\_US  
w\_US  
OMEGA\_US  
d\_US  
r\_US  
pd\_US  
n\_US  
PI\_US  
PIo\_US  
PHI\_US  
THETA\_US  
DELTA\_w\_US  
dDELTA\_w\_US  
erpt\_US\_US  
erpt\_x\_US  
erpt\_cpi\_US  
y\_UK  
c\_UK  
d\_UK  
r\_UK  
mc\_UK  
po\_UK  
pd\_UK  
n\_UK  
p\_x\_UK

Residuals of the static equations:

Equation number 1 : NaN  
Equation number 2 : NaN  
Equation number 3 : NaN  
Equation number 4 : NaN  
Equation number 5 : NaN  
Equation number 6 : NaN  
Equation number 7 : NaN  
Equation number 8 : NaN  
Equation number 9 : NaN  
Equation number 10 : NaN  
Equation number 11 : NaN  
Equation number 12 : NaN  
Equation number 13 : NaN  
Equation number 14 : NaN  
Equation number 15 : NaN  
Equation number 16 : NaN  
Equation number 17 : NaN  
Equation number 18 : NaN  
Equation number 19 : NaN  
Equation number 20 : -1  
Equation number 21 : NaN  
Equation number 22 : NaN  
Equation number 23 : NaN  
Equation number 24 : NaN  
Equation number 25 : NaN  
Equation number 26 : 0  
Equation number 27 : -0.3  
Equation number 28 : NaN  
Equation number 29 : 0  
Equation number 30 : 0.0050029  
Equation number 31 : 0.6965  
Equation number 32 : 3.9226  
Equation number 33 : NaN  
Equation number 34 : NaN  
Equation number 35 : 0  
Equation number 36 : NaN  
Equation number 37 : -Inf  
Equation number 38 : NaN  
Equation number 39 : Inf  
Equation number 40 : -1.2969  
Equation number 41 : 0  
Equation number 42 : Inf  
Equation number 43 : NaN  
Equation number 44 : -Inf  
Equation number 45 : Inf  
Equation number 46 : -Inf  
Equation number 47 : -1  
Equation number 48 : Inf  
Equation number 49 : -1  
Equation number 50 : -1.5  
Equation number 51 : 3  
Equation number 52 : NaN  
Equation number 53 : NaN  
Equation number 54 : -1  
Equation number 55 : -1  
Equation number 56 : 1.6667  
Equation number 57 : NaN  
Equation number 58 : -Inf  
Equation number 59 : NaN  
Equation number 60 : 1  
Equation number 61 : NaN  
Equation number 62 : Inf  
Equation number 63 : 3.1875  
Equation number 64 : NaN  
Equation number 65 : NaN  
Equation number 66 : NaN  
Equation number 67 : 2.467  
Equation number 68 : NaN  
Equation number 69 : 0  
Equation number 70 : 0.66167  
Equation number 71 : 0  
Equation number 72 : NaN  
Equation number 73 : 0  
Equation number 74 : NaN  
Equation number 75 : -0.62728  
Equation number 76 : NaN  
Equation number 77 : NaN  
Equation number 78 : 0.023079  
Equation number 79 : 0  
Equation number 80 : -0.011555  
Equation number 81 : -1  
Equation number 82 : 4

{Error using print\_info (line 76)  
The steadystate file did not compute the steady state  
Error in steady (line 104)  
print\_info(info,options\_.noprint, options\_);  
Error in erpt (line 600)  
steady;  
Error in dynare (line 223)  
evalin(‘base’,fname) ;}  
erpt\_steadystate.m  
{Undefined variable “erpt\_steadystate” or class “erpt\_steadystate.m”.}  
erpt\_steadystate

\<a href = "matlab: helpview([docroot '/tool[/quote]

such that the steady states that are in oo\_.steady\_state are:

[quote]NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
1.00000000000000 + 0.00000000000000i  
4.00000000000000 + 0.00000000000000i  
NaN + NaNi  
NaN + NaNi  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.661666666666667 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
NaN + NaNi  
NaN + NaNi  
NaN + NaNi  
4.00000000000000 + 0.00000000000000i  
4.00000000000000 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
-0.0230790845075262 + 0.121114052717325i  
NaN + NaNi  
NaN + NaNi  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.666666666666667 + 0.00000000000000i  
2.66666666666667 + 0.00000000000000i  
0.700000000000000 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
0.372724332599842 - 2.29840864753238i  
0.0230790845075262 - 0.121114052717325i  
-1.50539871502855e-05 - 5.47920322972983e-06i  
4.00000000000000 + 0.00000000000000i  
NaN + NaNi  
NaN + NaNi  
1.46703228259499 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
1.00000000000000 + 0.00000000000000i  
NaN + NaNi  
0.999997080744763 - 1.08639763851670e-11i  
-0.000357710188133353 - 1.33123023715598e-09i  
0.999998478862161 - 4.49151522320393e-06i  
-1.52113783935537e-06 - 4.49151522320393e-06i  
-0.546872770003802 - 2.03520520818762e-06i  
-0.546874168127744 + 2.45629738768965e-06i  
0.250000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i  
0.00000000000000 + 0.00000000000000i[/quote]

while the \_steadystate.m file gives:

[quote]ans =  
1.0e+03 \*  
0.0001  
0.0000  
0.0001  
1.0306  
-0.3021  
3.3958  
0.0003  
0.0003  
-0.0169  
0.0000  
0.0010  
0.0005  
0.0006  
0.0004  
0.0001  
0.0007  
0.0002  
0.0001  
0.0001  
0.0001  
0.0010  
0.0010  
0.0010  
0.0010  
0  
0  
0.0600  
0.0010  
0  
0  
0.0010  
0.0000  
0.0016  
0.0010  
0.0010  
0.0010  
0.0010  
0.0000  
0.0002  
0.0001  
0.0000  
0.0002  
0.0002  
-0.0001  
0.0186  
-0.0063  
0.0613  
0.0003  
0.0004  
0.0169  
0.0000  
0.0010  
0.0007  
0.0008  
0.0015  
0.0001  
0.0006  
0.0002  
0.0001  
0.0000  
0.0001  
0.0010  
0.0010  
0.0010  
0.0010  
0  
0  
0.0600  
0.0010  
0  
0  
0.0010  
0.0000  
0.0006  
0.0010  
0.0010  
0.0010  
0.0000  
0.0010  
0.0004  
0.0002  
-0.0000[/quote]

[/quote]

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [6 June 2017 06:29 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/6 "2017-06-06T06:29:00Z")

</div>

Have you tried debugging the program to see what is going on, i.e. setting a breakpoint in the steady state file?

---

<div class="post-metadata">

**Author:** ![jd1090](https://forum.dynare.org/user_avatar/forum.dynare.org/jd1090/32/5086_2.png) [@jd1090](https://forum.dynare.org/u/jd1090)\
**Post date:** [6 June 2017 07:37 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/7 "2017-06-06T07:37:13Z")

</div>

Yes, it seems to work fine until the fsolve is called. After that, the computations break down. It’s odd, because I borrowed some code from a colleague and I managed run his code with fsolve, but it is specified without a separate steady state file (i.e. it’s all in one .m file and the .m file itself generates a .mod file).

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [6 June 2017 09:56 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/8 "2017-06-06T09:56:37Z")

</div>

But what does fsolve say? Is there any error code/indication that things go wrong?

---

<div class="post-metadata">

**Author:** ![jd1090](https://forum.dynare.org/user_avatar/forum.dynare.org/jd1090/32/5086_2.png) [@jd1090](https://forum.dynare.org/u/jd1090)\
**Post date:** [6 June 2017 10:57 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/9 "2017-06-06T10:57:47Z")

</div>

No, there is no error message in fsolve - the usual output comes out:

[quote]erpt\_steadystate

Equation solved.

fsolve completed because the vector of function values is near zero  
as measured by the default value of the function tolerance, and  
the problem appears regular as measured by the gradient.

[/quote]

Basically, no matter where the breaking point is, the .mod file somehow spits out crazy steady state values in the oo\_, while the _steadystate.m file can be stopped at any point and runs perfectly fine. The values in the oo_ don’t seem to depend on where the breaking point is. It is as though the .mod file does not recognise the \_steadystate.m file at all.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [7 June 2017 06:31 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/10 "2017-06-07T06:31:51Z")

</div>

What do you mean with

> [@](#):
>
> does not recognise the \_steadystate.m file at all

Is the output of fsolve still correct and the problem is introduced later on? Or is the fsolve output already complex?

---

<div class="post-metadata">

**Author:** ![jd1090](https://forum.dynare.org/user_avatar/forum.dynare.org/jd1090/32/5086_2.png) [@jd1090](https://forum.dynare.org/u/jd1090)\
**Post date:** [7 June 2017 07:28 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/11 "2017-06-07T07:28:09Z")

</div>

The output of fsolve is correct. The problem is introduced with command ‘steady’ in the .mod file, when the \_steadystate.m file is called.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [7 June 2017 14:19 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/12 "2017-06-07T14:19:19Z")

</div>

Then please trace the error further. During the call to the mod-file, the steady\_state-file including fsolve seems to be called correctly. There must then be a transformation happening that implies the values found by fsolve are not passed back unaltered. Or do things go wrong the second time the steady state file is called? Because the

```auto

```

command should call the steady state file a second time.

---

<div class="post-metadata">

**Author:** ![jd1090](https://forum.dynare.org/user_avatar/forum.dynare.org/jd1090/32/5086_2.png) [@jd1090](https://forum.dynare.org/u/jd1090)\
**Post date:** [12 June 2017 06:34 UTC](https://forum.dynare.org/t/dynare-on-mac-vs-pc-steady-state-errors/6243/13 "2017-06-12T06:34:42Z")

</div>

Just in case someone else encounters a similar problem, I want to say that I’ve given up trying to debug this. I’ll be doing my dynare work on the PC. But if you figure out why this is happening - drop me a line. I’d appreciate it.
