Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ECO4145 Mathematical Economics II

Assignment 1

1. Consider a polluted lake with volume V expressed in m3 . The rate of water outflow is r, assumed to be constant. Assume that the rate of water inflow is equal to the rate of water outflow so that the volume of the lake remains constant.

Let xt, t ≥ 0, denote the pollutant concentration in the lake at time t, with xt being the number of grams of pollutants in one m3 of water. The mass of pollutants in the lake at time t is then given by xt V. The pollutant concentration at time 0, namely x0, is known.

Suppose that at time t = 0 the activities that pollute the lake are stopped. As time goes by, the concentration of the pollutants in the lake, which is reduced by the water outflow, will decline. The water inflow - runoff, snow melt - still continue to maintain the volume of the lake at V. The differen- tial equation that governs the evolution of the stock of pollutants in the lake is

= -r xt,

x0 isknown.


(a) Solve the preceding differential equation for xt .

(b) You are given the following data on the volume and the rate of water outflows of the three Great

Lakes:



Lake

Vinm3

rinm3 day

Erie

458×109

479582208

Michigan

4871×109

433092096

Superior

12221×109

178619904

How long does it take for the pollutant concentration in each lake to fall to 10% of its initial value? The solution of the differential equation V = -r xt, x0 is known, is given by

In[]:= s [0] = DSolve[{V x' [t ] - r x [t ] , x [0] x0}, x, t ] // Flatten

求解微分方程 压平

r t


In[ ]:= eq [0] = 0 .1 x0 (x [t ] / . s [0])

r t

Out[ ]= 0 .1 x0 -  V     x0

In[ ]:= s [1] = Solve[eq [0], t ] // Flatten

解方程 压平

Solve :  Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information .

Out[ ]= t

For Lake Erie, the time (in days) it takes for the pollution concentration to go down to 10% of its initial value is 2860.92 days or 7.83813 years.

In[ ]:= s [1] / . V 458 × 109 , r 479 582 208

Out[ ]= {t 2198.96}

t

In[ ]:= / . %

365

Out[ ]= 6.02456

For Lake Michigan, the time (in days) it takes for the pollution concentration to go down to 10% of its initial value is 33693.1 days or 92.3098 years.

In[ ]:= s [1] / . V 4871 × 109 , r 433 092 096

Out[ ]= {t 25 897.2}

t

In[ ]:= / . %

365

Out[ ]= 70.9514

For Lake Superior, the time (in days) it takes for the pollution concentration to go down to 10% of its initial value is 204965 days or561.548 years.

In[ ]:= s [1] / . V 12 221 × 109 , r 178 619 904

Out[ ]= {t 157 541. }

t

In[ ]:= / . %

365

Out[ ]= 431.618

In[ ]:= ClearAll[s, eq ]

清除全部

2. In the preceding problem, the water outflow at each instant is, say r[t] = ρ, where r[t] is the water outflow at time t and ρ > 0 is a constant. The problem is to find the time it takes for the concentra- tion of pollutants in the lake to fall to 10% of its initial value if all the sources of pollution into the lake cease to exist.

Now suppose that the water outflow at each instant t, namely r[t], is not constant, but varies through time around the mean ρ, and is given by


r[t] = ρ (1 + ϵ Sin[2π t]),

where ϵ, 0 ϵ < 1, is a constant.


Show that the time it takes for the concentration of pollutants in the lake to fall to 10% of its initial value - if all the sources of pollution into the lake cease to exist - does not change significantly with the incorporation of the time fluctuating term ϵ Sin[2π t].

- r [t ] × x [t ]

In[]:= eq [1] = x' [t ]

V

r [t ] × x [t ]

Out[]= x[t ] -

V

The solution of the above differential equation is

In[]:= s [2] = DSolve[{eq [1], x [0] x0}, x, t ] // Flatten

解微分方程 压平

Out[]= x Function  {t } , t0 - K[1] x0

The expression for the pollution concentration at timne t

In[]:= x [t ] / . s [2]

Out[]= t0 - K[1] x0

The following equation characterizes the time it takes for the pollutant concentration in the lake to fall to 10% ofits initial level: Log[x[t]] - Log[0.1 x[0]] = 0.

In[]:= eq [2] = Log[x [t ] / . s [2]] - Log[0 .1 x0] 0

对数 对数

Out[]= - Log[0 .1 x0] + Log t0 - K[1] x0 0

In[]:= eq [2] = eq [2] // PowerExpand

幂展开

t     r [K[1]]

0                V

Simplify eq[2] by collecting the terms that involve .

In[]:= eq [2] = Collect eq [2] , ρ

合并同类项 V

t     r [K[1]]

0                V

Now in eq[2] the expression - + captures the impact of the fluctuations in the water outflow around its mean. If we call this expression a, then eq[2] becomes

ϵ ϵ Cos[2 π t ]

2 π 2 π


0                V

Solving eq[2] for t, we obtain


4 ECO4145_Assignment 1_29_01_2022_Solution.nb



In[ ]:= s [3] = Solve[eq [2], t ] // Flatten

解方程 压平

Solve :  Solve was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system . Since many of the methods used by Solve

require exact input, providing Solve with an exact version of the system may help .

t     r [K[1]]

0                V

In[ ]:= s [3] // Expand

展开


0                V



- 2 π +     2 π < π < 3 .



h

2


l

5

o


4

a

2

j

p

4

3


g

4


k

Figure 1._ A route network

Find a continuous and monotonic-to-the-right path that is shortest to go from a to b.

The shortest path from a to b is acfjmob, which has distance v[a] = 13.

4. A robot moves about on the grid shown in the following figure.

x2



4



3



2


The robot is attempting to find its way in this environment to the home square” located in the upper left-hand corner. There are two shaded squares that may or may not contain barriers that the robot is not allowed to pass through. Initially, the robot does not know whether or not the barriers are actually present. So part of its control stategy is to learn about the presence or absence of these barriers. The other part, of course, is to move toward Home.


At the beginning, the robot knows that there is a probability of 0.4 that a barrier exists in the square located at x1 = 1, x2 = 3 and that there is a probability of 0.5 that a barrier exists at x1 = 2, x2 = 2.

The robot can always see one move ahead; that is, if the robot is within one move of a barrier location, it can always determine with certainty whether or not a barrier is there. For a price of 0.3 moves, the robot can make an observation of all the squares that are 2 moves away, where a move is defined to be either one horizontal or one vertical square away from the robot’s current location. In other words, the robot can move or observe diagonally only in 2 moves. The robot’s objective is to get to the Home square while minimizing the expected value of the sum of actual moves and penalties for observation.


Work out the optimal control policy for the robot, assuming that at the beginning the robot finds itself at the co-ordinates x1 = 1, x2 = 1.

The robot has three choices: (i) move horizontally to the right, (ii) move vertically up, or (iii) make an observation.

x2

1           2           3


Home



3



2



Robot


x1


As for the two barriers, there are four possibilities:

(i) None of the barriers exists. The event has probability

In[ ]:= p [0, 0] = (1 - 0.4) × (1 - 0.5)

Out[ ]= 0.3

(ii) There is a barrier at (1, 3), but none at (2, 2). This event has probability

In[ ]:= p [1, 0] = 0.4 × (1 - 0.5)

Out[ ]= 0.2

(iii) There is no barrier at (1, 3), but there is a barrier at (2, 2). This event has probability


In[ ]:= p [0, 1] = (1 - 0.4) × 0.5

Out[ ]= 0.3

(iv) Barriers exist at both (1, 3) and at (2, 2). This event has probability

In[ ]:= p [1, 1] = 0.4 × 0.5

Out[ ]= 0.2


Make a Horizontal Move to the Right

Suppose that the robot chooses to move horizontally to the right. After one move, the robot will find out whether a barrier exists at (2, 2) or not. The former event has probability 0.5, and the latter event also has probability 0.5. Under the event that a barrier exists at (2, 2), the robot has to move around the barrier and make one more horizontal move to the right, make 3 moves vertically upward, then makes 3 horizontal moves to the left to get home. The total cost under this event is 7 moves to get home.

Under the event that there is no barrier - and this event has probability 1 - 0.5 = 0.5 - the robot can move vertically upward three moves, and then finally one horizontal move to the left to get home. Under this event, the cost is 5 moves to get home. The expected number ofmoves to get home by moving horizontally to the right is

In[ ]:= v [ right ] = 0.5 × 7 + 0.5 × 5

Out[ ]= 6.


Make a Vertical Move Upward

Suppose that the robot chooses to move vertically upward. After one move, the robot will find out whether a barrier exists at (1, 3) and whether a barrier exists (2, 2). There are four possibilities.

(i) None of the barriers exist. This has probability p[0, 0], and the robot will continue to move vertically upward home. Under this scenario, it costs the robot3 moves to go home.

In[ ]:= v [up, 1] = 3

Out[ ]= 3

(ii) A barrier exists at (1, 3), but none exists at (2, 2). This has probability p[1, 0], and under this event, the robot will make a horizontal moven to the right, after the first move, then two vertical moves upward, and finally one horizontal move to the left to come home. The total cost is 5 moves to go home

In[ ]:= v [up, 2] = 5

Out[ ]= 5

(iii) No barrier exists at (1, 3), but a barrier exists at (2, 2). This has probability p[0, 1], and the robot will continue to move vertically upward home. Under this scenario, it costs the robot3 moves to go home.

In[ ]:= v [up, 3] = 3

Out[ ]= 3

(iv) Barriers exist at both (1, 3) and (2, 2). This has probability p[1, 1], and the robot will have to backtrack, and then move around the barrier at (2,2) to get home. The total cost under this event is 9 moves.

In[ ]:= v [up, 4] = 9

Out[ ]= 9

The total expected number ofmoves that the robot has to make to get home by moving vertically upward is

In[ ]:= v [up ] = p [0, 0] × v [up, 1] + p [1, 0] × v [up, 2] + p [0, 1] × v [up, 3] + p [1, 1] × v [up, 4] Out[ ]= 4.6



Making an Observation

Suppose that the robot chooses to pay 0.3 to make an observation. After the observation, the robot will find out whether a barrier exists at (1, 3) and whether a barrier exists (2, 2). There are four possibilities.

(i) None of the barriers exist. This has probability p[0, 0], and the robot will continue to move vertically upward home. Under this scenario, it costs the robot 0.3 move to observe and3 more moves to go home for a total of3.3 moves to get home.

In[ ]:= v [observe, 1] = 3.3

Out[ ]= 3.3

(ii) A barrier exists at (1, 3), but none exists at (2, 2). This has probability p[1, 0], and under this event, the robot will make a horizontal move to the right, after the first move, then two vertical moves upward, and finally one horizontal move to the left to come home. The total cost is 0.3+5=5.3 moves to go home

In[ ]:= v [observe, 2] = 5.3

Out[ ]= 5.3

(iii) No barrier exists at (1, 3), but a barrier exists at (2, 2). This event has probability p[0, 1], and the robot will continue to move vertically upward home. Under this scenario, it costs the robot 0.3+3 moves to go home.

In[ ]:= v [observe, 3] = 3.3

Out[ ]= 3.3

(iv) Barriers exist at both (1, 3) and (2, 2). This has probability p[1, 1], and the robot will have to move around the barrier at (2,2) to get home in 7 moves. When the cost of observation is added to the number ofmoves (7) the robot must make to get home, the total cost under this event is 0.3+7 moves.

In[ ]:= v [observe, 4] = 7.3

Out[ ]= 7.3

The total expected number ofmoves that the robot has to make to get home by choosing to observe first is

In[ ]:= v [observe ] = p [0, 0] ×