Load necessary packages
rm(list = ls())
## First specify the packages of interest
= c("rootSolve","ggplot2","kableExtra")
packages
## Now load or install&load all
<- lapply(
package.check
packages,FUN = function(x) {
if (!require(x, character.only = TRUE)) {
install.packages(x, dependencies = TRUE)
library(x, character.only = TRUE)
}
} )
(i) Considering harvest, y(x) = min[x, 0.1] = x
<- function(x) {0.04*x*(1-(x/100)) - x}
f1 print(paste("For harvest,y(x) = min[x, 0.1] = x, the steady state stock is: ",uniroot(f1, lower = 0, upper = 100)[1]))
## [1] "For harvest,y(x) = min[x, 0.1] = x, the steady state stock is: 0"
Considering stock is positive, otherwise the equation gave -2400 as an alternative value for x
(ii) Considering harvest, y(x) = min[x, 0.1] = 0.1
<- function(x) {0.04*x*(1-(x/100)) - 0.1}
f1 print(paste("For y(x) = min[x, 0.1] = 0.1, the steady state stock is: ",uniroot.all(f1, lower = 0, upper = 100)[1], "& ",uniroot.all(f1, lower = 0, upper = 100)[2]))
## [1] "For y(x) = min[x, 0.1] = 0.1, the steady state stock is: 2.56583495658461 & 97.4341650434154"
print(ggplot(data.frame(x=c(0, 100)), aes(x=x)) +
labs(x = "x", y = "F(x)-y(x)", title = "Constant harvest at y(x) = min[x, 0.1] = 0.1") +
theme(panel.grid = element_blank()) +
geom_hline(yintercept = 0, color = "blue", linetype = "dotted", size=1)+
geom_vline(xintercept = 2.56, color = "orange", linetype = "dashed", size=1)+
geom_vline(xintercept = 97.43, color = "orange", linetype = "dashed", size=1)+
stat_function(fun=f1))
\(x_1\) is a stable steady state if and only if
\(\frac{d(F(x_\infty)-y(x_\infty))}{dx} < 0\)
= expression(0.04*x*(1-(x/100)) - 0.1)
ex1 = D(ex1,'x') #derivate wrt x
D1 for (x in c(2.56, 97.43)) {
=eval(D1)
eD1print(paste("For x= ",x,"derivate evaluates to ",eD1))
}
## [1] "For x= 2.56 derivate evaluates to 0.037952"
## [1] "For x= 97.43 derivate evaluates to -0.037944"
Considering constant harvest y = x, the curve has one steady state at x=0. Considering constant harvest, y = 0.1 :
At x = 2.56, \(\frac{d(F(x_\infty)-y(x_\infty))}{dx} = 0.379 > 0 = UNSTABLE\)
At x= 97.43, \(\frac{d(F(x_\infty)-y(x_\infty))}{dx} = -.0379 < 0 = STABLE\)
Proportional Harvest
<- function(x) {0.05*x*(1-(x/400)) - 0.02*x}
f2 print(paste("On solving the equation using uniroot we get the steady state stocks as",uniroot.all(f2, lower = 0, upper = 400)[1], "& ",uniroot.all(f2, lower = 0, upper = 400)[2],", and the corresponding harvest levels as",0.02*uniroot.all(f2, lower = 0, upper = 400)[1], "& ",0.02*uniroot.all(f2, lower = 0, upper = 400)[2]) )
## [1] "On solving the equation using uniroot we get the steady state stocks as 0 & 240 , and the corresponding harvest levels as 0 & 4.8"
print(ggplot(data.frame(x=c(0, 400)), aes(x=x)) +
labs(x = "x", y = "F(x)-y(x)", title = "Harvest proportional to the stock") +
theme(panel.grid = element_blank()) +
geom_hline(yintercept = 0, color = "blue", linetype = "dotted", size=1)+
geom_vline(xintercept = 0, color = "red", linetype = "dashed", size=1)+
geom_vline(xintercept = 240, color = "green", linetype = "dashed", size=1)+
stat_function(fun=f2))
\(x_\infty\) is a stable steady state if and only if
\(\frac{d(F(x_\infty)-y(x_\infty))}{dx} < 0\)
= expression(0.05*x*(1-(x/400)) - 0.02*x)
ex2 = D(ex2,'x') #derivate wrt x
D2 for (x in c(0, 240)) {
=eval(D2)
eD2print(paste("For x= ",x,"derivate evaluates to ",eD2))
}
## [1] "For x= 0 derivate evaluates to 0.03"
## [1] "For x= 240 derivate evaluates to -0.03"
\[At\hspace{2mm} x=0, \hspace{10mm}\frac{d(F(x_\infty)-y(x_\infty))}{dx} = 0.03 > 0 = UNSTABLE\]
\[And \hspace{2mm} at \hspace{2mm}x= 240,\hspace{10mm} \frac{d(F(x_\infty)-y(x_\infty))}{dx} = -0.3 < 0 = STABLE\]
Sol.
For steady state equating difference of growth and harvest to zero. \[F(x)-y(x) = 0 \] \[0.04x(1-x/100) - \mu x =0 \] \[0.04(1-x/100) - \mu =0 \] \[.04(1-x/100) = \mu \] \[or, x=(0,100) => \mu =(0.04,0) \]
Lets vary \(\mu\) from 0 to 0.04 in steps of 0.01 and evaluate x For convenience using m for \(\mu\)
for (m in seq(0,0.04,0.01)) {
<- function(x) {0.04*x*(1-(x/100)) - m*x}
f3 print(paste("For m = ",m,", the steady state stock is: ",uniroot(f3, lower = 0, upper = 100)[1]))}
## [1] "For m = 0 , the steady state stock is: 0"
## [1] "For m = 0.01 , the steady state stock is: 0"
## [1] "For m = 0.02 , the steady state stock is: 0"
## [1] "For m = 0.03 , the steady state stock is: 0"
## [1] "For m = 0.04 , the steady state stock is: 0"
par(mfrow = c(2, 3))
for (m in seq(0,0.04,0.01)) {
<- function(x) {0.04*x*(1-(x/100)) - m*x}
f3 curve(f3, from=0, to=100, , xlab="x", ylab="F(x)-y(x)")
title(m, line =1)
}
We can see both from the \(\mu\) value and from the above plots that the steady stock levels are at \[x_\infty \in \{0,100\}\]
\(x_\infty\) is a stable steady state if and only if
\(\frac{d(F(x_\infty)-y(x_\infty))}{dx} < 0\)
= expression(0.04*x*(1-(x/100)) - (0.04-0.0004*x)*x)
ex3 = D(ex3,'x') #derivate wrt x
D3 for (x in c(0, 100)) {
=eval(D3)
eD3print(paste("For x= ",x,"derivate evaluates to ",eD3))
}
## [1] "For x= 0 derivate evaluates to 0"
## [1] "For x= 100 derivate evaluates to 0"
At x= 0, \(\frac{d(F(x_\infty)-y(x_\infty))}{dx} = 0 = STABLE\) At x= 100, \(\frac{d(F(x_\infty)-y(x_\infty))}{dx} = 0 = STABLE\)
Sol. \[F(x) = \gamma *x(1-x/K)^{\phi}\] \[Growth \hspace{2mm}Rate = F(x)/x = \gamma (1-x/K)^{\phi}\] The effect of \(\phi\) on growth rate : \[\frac{dF(x)/x}{d\phi} = \frac{d\gamma (1-x/K)^{\phi}}{d\phi}\]
As \(\gamma\) is +ve, \((1-x/K)^{\phi} \ge 0\) as x \(\le\) K and \(ln(1-x/K)\) is +ve, we have
\[\frac{dF(x)/x}{d\phi}=\gamma ln((1-x/K)(1-x/K)^{\phi} \ge 0\]
Given, \[F(x) = \gamma *x(1-x/K)^{\phi}, \phi>0;\] MSY is the largest harvest that can be sustained. It occurs at the highest point on the graph of the growth function which is obtained by solving \[\frac{dF(x)}{dx} \overset{set}{=} 0 \] I denote g for \(\gamma\) and i for \(\phi\) for the purpose of differentiation in R
= expression(g*x*(1-(x/K))^i)
f = D(f,'x') #derivate wrt x
D1 D1
## g * (1 - (x/K))^i - g * x * ((1 - (x/K))^(i - 1) * (i * (1/K)))
Setting F.O.C. output, D1 equals to zero:
\[\frac{dF(x)}{dx} \overset{set}{=} 0 \] \[=> \gamma(1-x/K)^{\phi}-\gamma x(1-x/K)^{\phi-1}*\phi/K \overset{set}{=} 0 \] \[or, (1-x/K)= x*\phi/K \] \[or, K=x + x*\phi \] \[or, K=x(1 + \phi) \] \[or, x=K/(1 + \phi) \]
Vary \(\phi\) (denoted as i) from 0.5 to 2 at an interval of 0.5
par(mfrow = c(2, 2))
for (i in seq(0.5,2,0.5)) {
= function(x){0.03*x*(1-(x/100))^i}
eq curve(eq, from=0, to=100, , xlab="x", ylab="F(x)-y(x)")
title(i, line =1)
}