Can't work with third order

Hi, I can’t stoch_simul a mod file with third order perturbation in 4.5.1 version(while no problem when order=2), but can run correctly in 4.4.3 version. Can anyone help me with this?

Hi, Can you post the error message and the mod file?


Dear Stéphane
Thank you for your help, I am trying to do a third order perturbation as you would see from the attached code(from our forum)in Dynare 5.1.1. When I run the model with order=3, Matlab exits automatically without any hints after the computer screen shows the steady state value. However, the program with order=2 works normally in Dynare 5.1.1. In addition, I run the mod file with order=3 or order=2 successfully in Dynare 4.4.3. Surprisingly, all the model files with order=3 have similar experience in my Dynare 5.1.1. Now I am quite confused the problem why the mod file can’t work well in 5.1.1. By the way I use Matlab version 2014a in my computer. I think something is wrong with my computer system, but I don’t know what to do about it.Really appreciate your help.
deficit_sticky.mod (4.7 KB)

@tianyuwuhe That is strange. I cannot reproduce the problem on my machine. Are you using Windows 10?

Dear professor
thanks a lot for your reply, I am using Windows 7 and my friend got the same results as you with Windows 10. Is it because of my low operating system version?


Could you post the log file generated by Matlab? When Matlab crashes a log file called matlab_crash_dump.XXXX is saved on the disk, I do not know where on windows machines. Also, did you try with Octave? This could help in determining if it is a pure Matlab issue or Windows issue.


Also, could you please check whether there is a *.jnl-file created in the folder. If yes, please post it here.

I am encountering the same issue.

I have a .mod file that had worked in 4.4.3 with a third-order perturbation solver but no longer works with 4.5.1.

It still works with order=1 option.

I have attempted to run my file in both a Windows 7 machine and a Mac with macOS Sierra. My MATLAB is R2016b. With Windows, MATLAB simply crashes as tianyuwuhe’s experience. On the Mac I get the following error message:

Invalid MEX-file '/Applications/Dynare/4.5.0/matlab/../mex/matlab/osx/k_order_perturbation.mexmaci64':
dlopen(/Applications/Dynare/4.5.0/matlab/../mex/matlab/osx/k_order_perturbation.mexmaci64, 6): Library not
loaded: @rpath/libhdf5.6.dylib
  Referenced from: /Applications/Dynare/4.5.0/mex/matlab/osx/k_order_perturbation.mexmaci64
  Reason: image not found.

(As you can see, I have tried with 4.5.0 as well.)


HI,dear experts:
Following your advice ,I found the log file generated when Matlab crashed, also I discoverd two facts using Dynare 4.5.1 diffent from using Dynare 4.4.3. First, aftering running the model using Dynare 4.5.1, there is an file named checksum which isn’t generated in Dynare 4.4.3. Second.aftering running the model using Dynare 4.5.1 first with order=3,Dynare didn’t automatically add any required subfolders in the matlab’s path,and the error hint in error.bmp shows up sometimes.Here is the (17.3 KB). I think something is wrong with my Matlab,but don’t know what to do about it. Thank for your patient reply.

Hi Feng,

Have you had any luck resolving the issue?

@jpfeifer: Given that this is an issue that appears across platforms, might there be a bug in Dynare such that it works for first-order solution, but not with second- or third-order?


@tlin Your mac problem is one with building the mex-files. It is different from the crash on Windows. Our developer dealing with Macs will hopefully get back to you soon.

@tlin and @tianyuwuhe For Windows, as I said

What puzzles me is that I can run the respective file at third order on Windows 10, 64bit, Dynare 4.5.1. Could you please try what happens if you run

stoch_simul (order=3, pruning, nocorr, nomoments, irf=12,irf_shocks=(epsh));

i.e. only request the IRF to a single shock.

Thank you, @jpfeifer, for the response!

I have run @tianyuwuhe’s model and reproduced the error. The resulting jnl is attached in the zip file. Note that Dynare/MATLAB crashes running either the model with just one single shock or all shocks. (1.3 KB)


I have attached the dump file below. (1.3 KB)

I opened a ticket at
Could you please check which version of C:\Windows\system32\msvcrt.dll you have on your machine. You should be able to find this info in the file details in the Windows Explorer

I apologize for the delay.

The msvcrt.dll version is 7.0.7601.17744.

Mine is 7.0.15063.0. What is the latest Visual C++ Redistributable on your machine? Mine in 2015.

According to Control Panel, it is 2015, 14.0.23506.

To clarify, the machine has MS Visual C++ 2015 Redistributable (x64) - 14.0.23506.

Could you please try reinstalling it? My version is 14.0.23918

I have just installed the latest update of MS Visual C++ 2015 Redistributable; it is now 14.0.24212.

However, my msvcrt.dll has not changed; it is still version 7.0.7601.17744.

I am attaching the .jnl after MATLAB crashes. It did not generate a dump file. (2.4 KB)