777_ch02
TRANSCRIPT
-
8/12/2019 777_Ch02
1/15
Chapter 2
Question 1
In[1]:= Clear@x, yD (i) (a)
dydx
= ky and (b) y =c kx. Differentiating (b)
In[2]:= D@c Ek x , xDOut[2]= ck x k
Substitutingyinto dy/dx, then
dydx
=k c
k
xtherefore k c
k
x=
k c
k
x. Hence true.
(ii) (a)dydx
= - xy
, (b) y=x2 +y2 =c. Fromythen
In[3]:= Dt@x ^ 2 + y^2, xDOut[3]= 2 x + 2 y Dt@y, xD
which is equal to zero, since cis a constant. Solving we have
In[4]:= Solve@2 x + 2 y Dt@y, xD == 0, Dt@y, xDDOut[4]=
99Dt
@y, x
D
x
y==Therefore - x
y = -
xy
. Hence, true.
(iii) (a)dydx
= -2yx
, (b) y= ax2
. From (b) differentiate with respect tox, then
In[5]:= D@a x^2, xDOut[5]=
2 ax3
Buty=2 ax2
so thatdydx
= -2yx
. Therefore -2yx
= -2yx
. Hence true.
Question 2
Solving and checking limiting values
This first series of equations solve forp(t). It is then checked for the limit t->0. The upper limit cannot be
checked because no assumptions can be made about the values of aand k.
In[6]:= Clear@p, slope, t, Gompequ, Gompequ2, a, k, p0DIn[7]:= eq1 :=p '@tD ==k p@tD Ha Log@p@tDDL
Chapter 02.nb 1
-
8/12/2019 777_Ch02
2/15
In[8]:= DSolve@eq1, p@tD, tDOut[8]= 99p@tD k t Hak t +k C@1DL==
In[9]:= DSolve@ 8eq1, p@0D ==p0 DOut[12]= LimitAa+k t+Log@a+Log@p0DD , t E
Properties of growth equation
The stationary values are obtained. The programme gives the upper stationary value and warns about the
existence of the lower one.
In[13]:= Solve@k pHa Log@pDL ==0, pDSolve::verif : Potential solution 8p 0< Hpossibly
discarded by verifierL should be checked by hand. May require use of limits.
Out[13]=
88p a
-
8/12/2019 777_Ch02
3/15
In[21]:= Gompequ2
Out[21]= 5+ 0.8 t+Log@5Log@20DD
In[22]:= Plot@Gompequ2,8t, 0, 10 DOut[23]= 5
In[24]:= N@%DOut[24]= 148.413
In[25]:= N@E ^ 4DOut[25]= 54.5982
In[26]:= Plot@Gompequ,8p, 0.1, 150
-
8/12/2019 777_Ch02
4/15
In[27]:= 11 y2
y
Out[27]= 12
Log@1 + yD + 12
Log@1 + yD
In[28]:= xx
Out[28]=x2
2
Hence, 12
Log@1 + yD + 12
Log@1 + yD= x22
+cwhere cis the constant of integration. Solving for y we
obtain
In[29]:= SolveA 12
Log@1 + yD + 12
Log@1 + yD == x22
+ c, yESolve::verif : Potential solution 8y < Hpossibly
discarded by verifierL should be checked by hand. May require use of limits.
Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found.
Out[29]= 99y 1 + 2 c+x2
1 + 2 c+x2
==
(ii)dydx
=y2 - 2y + 1. But y2 - 2y + 1=H1 -yL2. Hence dyH1-yL2 = dx. Integrating both sides
In[30]:= 1H1 yL2 y
Out[30]= 1
1 + y
In[31]:= 1x
Out[31]= x
Solving for y
In[32]:= SolveA 11 + y
+ c ==x, yE
Out[32]= 99y 1 + c xc x
==
(iii)
dy
dx =
y2
x2 hence
dy
y2 =
dx
x2 . Integrating both sides
In[33]:= 1y2
y
Out[33]= 1y
In[34]:= 1x2
x
Out[34]= 1x
Introducing the constant of integration and solving, we have
Chapter 02.nb 4
-
8/12/2019 777_Ch02
5/15
In[35]:= SolveA 1y
== 1x+ c, yE
Out[35]= 99y x1 + c x
==
Question 4
(i)dydx
=x2 - 2x + 1 and y=1 when x=0. Hence dy=Hx2 - 2x + 1L dx. Integrating both sides
In[36]:= 1y
Out[36]= y
In[37]:= Hx2 2x + 1Lx
Out[37]= x x2 + x3
3
Adding the constant of integration and solving forywe obtain
In[38]:= SolveAy ==x x2 + x33
+ c, yE
Out[38]= 99y c + x x2 + x3
3==
Including initial values we can solve for c
In[39]:= SolveAy == 13 H3 c + 3 x 3 x2 + x3L, cE .8y >1, x >001.2Out[86]= H0.930233 + 0.216299 0.3225tL1.33333
But k=s aka- (n+d)k hence
In[87]:= kdot =0.1 4k^0.25 H0.03 + 0.4LkOut[87]= 0.4 k0.25 0.43 k
In[88]:= sol =NSolve@kdot ==0, kDOut[88]= 88k 0. All, AxesOrigin >80, 0.58"t", "k"
-
8/12/2019 777_Ch02
12/15
In[92]:= Plot@kdot,8k, 0, 1keOut[94]= 0.3225
Letf(k) =s aka- (n+d)k then the linear approximation is given by:
k=f(k) +f'(k)(k-ke) =f'(k)(k-ke)
In[95]:= fprime =D@kdot, kD . k >keOut[95]= 0.3225
Since |fprime| < 1 then keis a stable equilibrium.
Question 15
(i)
YHtL
agains Yis simply a linear line through the origin with slope sv
> 0. The phase line is horizontal with
fixed point at the origin, and arrows indicating an ever increasing value of Yfor some YH0L> 0.
(ii)
Given the differential equation Y '(t) - (s/v)Y(t) = 0, we can solve as follows:
In[96]:= Clear@s, YDIn[97]:= DSolve@ 8Y '@tD Hs vLY@tD ==0, Y@0D ==Y0
-
8/12/2019 777_Ch02
13/15
Question 16
Given Y[t] = Y0er t. SolvingD '[t] = kY(t) = kY0e
r t. SinceDis protected, we usexin its place.
In[98]:= Clear@x, r, YDIn[99]:= sol =DSolve@ 8x '@tD ==k Y0 E^Hr tL, x@0D ==x0
-
8/12/2019 777_Ch02
14/15
Question 18
(a)
In[105]:= Clear@fDIn[106]:= f@g_D:=100 Log@2D gIn[107]:= Map@f,82.7, 5.0, 2.5, 2.0, 1.4, 2.4, 2.0, 0.2, 0.2
-
8/12/2019 777_Ch02
15/15
In[111]:= 11620000000.0173H20001992L
Out[111]= 1.33448 109
Question 20
In[112]:= 50000.05 40 + H2000 0.05L HH0.0540L 1LOut[112]= 292508.
Chapter 02.nb 15