# First order solves, second order won't

**URL:** <https://forum.dynare.org/t/first-order-solves-second-order-wont/609>\
**Category:** Dynare help (legacy posts)\
**Created:** [12 March 2008 03:39 UTC](https://forum.dynare.org/t/first-order-solves-second-order-wont/609 "2008-03-12T03:39:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhargreaves](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@dhargreaves](https://forum.dynare.org/u/dhargreaves)\
**Post date:** [12 March 2008 03:39 UTC](https://forum.dynare.org/t/first-order-solves-second-order-wont/609/1 "2008-03-12T03:39:39Z")

</div>

The attached code (a toy model starting to think about non-linear equations for probability of mortgage default) solves fine if I set order=1 but it won’t solve the second order approximation: this error, or something similar in later versions of Dynare… Any ideas?? thanks! David

> > > > > > > > > > > > > > > > .  
> > > > > > > > > > > > > > > > ??? Reference to non-existent field ‘ghs2’.

Error in ==\> dr2 at 11  
ghs2 = dr.ghs2;

Error in ==\> dynare\_solve at 41  
fvec = feval(func,x,varargin{:});

Error in ==\> resol at 55  
dr.ys = dynare\_solve(‘dr2’,ys,dr);

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

Error in ==\> pd at 108  
info=stoch\_simul(var\_list\_);

Error in ==\> dynare at 26  
evalin(‘base’,fname) ;  
[pd.mod](https://forum.dynare.org/uploads/default/original/1X/95e5d74134cf0321464f5a2ab4ea306875465fd0.mod) (555 Bytes)

---

<div class="post-metadata">

**Author:** ![dhargreaves](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@dhargreaves](https://forum.dynare.org/u/dhargreaves)\
**Post date:** [3 June 2008 05:08 UTC](https://forum.dynare.org/t/first-order-solves-second-order-wont/609/2 "2008-06-03T05:08:20Z")

</div>

_the ghs2 issue is because there are no leads in the model._

When I added one it was happy to run in 2007a.

Note that (as others have commented) sometimes second order stochastic simulations result in an error namely

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

I am getting this with several examples in R2008a but R2007a seems to still work.
