Economics Dynamics Problems 152

Economics Dynamics Problems 152 - In[9]: = rstar=sol2[[2,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
136 Economic Dynamics Example (the generic logistic equation) x n + 1 = rx n (1 x n ) In[1]: = f[x - ]=rx(1-x) Out[1] = r (1-x) x In[2]: = eq1=f[f[x]] Out[2] =r 2 (1-x) x (1-r (1-x)x) In[3]: = soll=Solve[eq1==x,x] Out[3] = {{x - > - 0}, { x - > - -1+r r } , { x - > - r+r 2 -r -3-2r+r 2 2r 2 } , {x - > - r+r 2 +r -3-2r+r 2 2r 2 }} In[4]: = a1=so11[[3, 1, 2]] Out[4] = r+r 2 -r -3-2r+r 2 2r 2 In[5]: = a2=soll[[4, 1, 2]] Out[5] = r+r 2 +r -3-2r+r 2 2r 2 In[6]: = g[x - ]= x f[x] Out[6] = r(1-x)-rx In[7]: = eq2=Simplify[g[a1]g[a2]] Out[7] = 4+2r-r 2 In[8]: = sol2=Nsolve[eq2==0,r] Out[8] = {{r - > - -1.23607}, {r - > - 3.23607}}
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: In[9]: = rstar=sol2[[2, 1, 2]] Out[9] = 3.23607 In[10]: = a1/.r --> rstar Out[10] = 0.5 In[11]: = a2/.r --> rstar Out[11] = 0.809017 In[12]: = a1/.r --> 32 Out[12] = 0.513045 In[13]: = a2/.r --> 32 Out[13] = 0.799455 In[14]: = Nsolve[-1==4+2r-r 2 ,r] Out[14] = {{r - >- -1.44949}, {r - >- 3.44949}} In[15]: = Nsolve[4+2r-r 2 ==1, r] Out[15] = {{r - >- -1.}, {r - >- 3.}} Considering only positive roots, we have: r = 3 and r = 3 . 44949...
View Full Document

This note was uploaded on 12/14/2011 for the course ECO 3023 taught by Professor Dr.gwartney during the Fall '11 term at FSU.

Ask a homework question - tutors are online