1 Introduction

Real populations never evolve in isolation. As a result, a key question in ecology is finding conditions that allow multiple species to coexist. There is a general theory for deterministic coexistence (Hofbauer 1981; Hutson 1984; Hofbauer and So 1989; Hofbauer and Sigmund 1998; Smith and Thieme 2011). However, due to the intrinsic randomness of environmental fluctuations, deterministic models should be seen only as first order approximations of the real world. In order to get a better understanding of population dynamics we have to take into account environmental stochasticity. Recently there has been significant progress towards a general theory of stochastic coexistence (Schreiber et al. 2011; Benaim 2018; Benaïm and Schreiber 2018; Hening and Nguyen 2018).

Many species of animals live in restricted habitats and are at risk of being overharvested. Harvesting, hunting and other forms of overexploitation have already driven species to extinction. On the other hand, underharvesting can lead to the loss of valuable resources. One has to carefully balance both conservation and economic considerations in order to find the optimal harvesting strategies. It can take a population a significant amount of time to recover from large harvests. This, in combination with the random environmental fluctuations, can make it impossible for the population to survive and can lead to extinctions (Lande et al. 1995, 2003).

In certain cases, added conservation efforts have to be made in order to save a species from extinction. Therefore, it makes sense to be able to repopulate a species by seeding animals into the habitat. There is no reason to assume that the price of the harvesting or seeding is constant. If the harvested population is smaller the cost of harvesting is usually higher due to the fact that it is harder to find the individuals one wants to harvest. Similarly, the marginal cost of seeding will be lower, if one has a large population. We present a model that incorporates all these factors and effects. We consider \(d\ge 0\) species interacting nonlinearly in a stochastic environment where the species can be harvested as well as seeded into the system and the price of harvesting and seeding is density-dependent. The problem becomes finding the optimal harvesting-seeding strategy that maximizes the expected total income from the harvest minus the lost income from the species seedings. Mathematically, the problem we consider belongs to a class of singular stochastic control problems. Singular stochastic control problems have been studied extensively in various settings. To mention just a few, we refer to works of Alvarez and Shepp (1998), Alvarez (2000), Lungu and Øksendal (1997), Song et al. (2011), Hening et al. (2019), Alvarez and Hening (2018) for single species ecosystems in random environments and of Lungu and Øksendal (2001), Tran and Yin (2015), Tran and Yin (2017) for interacting populations. The reader can also find analogous results in the setting of corporate strategy (Radner and Shepp 1996), and optimal dividend strategies (Asmussen and Taksar 1997; Jin et al. 2013; Scheer and Schmidli 2011). Numerical methods for optimal harvesting have been developed by Jin et al. (2013), Tran and Yin (2016) and capital injections have been introduced by Dickson and Waters (2004), Kulenko and Schmidli (2008), Scheer and Schmidli (2011).

Considering optimal dividend problems in insurance and risk management (Dickson and Waters 2004; Jin et al. 2013; Kulenko and Schmidli 2008; Scheer and Schmidli 2011), it was observed that higher profit can be obtained if investors are allowed not only to remove but also to inject capital. In the harvesting setting, the idea of repopulating species (which we will call seeding) is natural and has been done for conservation efforts as well as for fisheries and agriculture. We propose a general model in which the control consists of two components: harvesting and seeding. In contrast to the existing literature, in our framework, to maximize the expected total discounted reward, the controller can add individuals of various species to maintain the system at a certain level and to avoid extinction. Moreover, we work with a system of interacting species. There are few theoretical results regarding the multi-species harvesting problem (Lungu and Øksendal 2001; Tran and Yin 2017). In a model with several species, one needs to decide which species to harvest at a given time. In addition, our model is complicated because we also allow seeding. At a given time, there are several possibilities. One can do nothing and let the population dynamics run on its own, or one can have any possible combination of seeding and harvesting of the d species.

To find the optimal harvesting-seeding strategy (also called the optimal control) and its associated total discounted reward (also called the value function), the usual approach is to solve the associated the Hamilton–Jacobi–Bellman (HJB) partial differential equations. However, for the singular control problems we consider, the HJB equations become a system of nonlinear quasi-variational inequalities. We use the viscosity solution approach for partial differential equations to study the value functions and associated control problems. It is usually impossible to find closed-form solutions to the HJB system. In order to side-step this difficulty and still gain valuable information, we develop numerical algorithms to approximate the value function and the optimal harvesting-seeding strategy. We do this by using the Markov chain approximation methodology developed by Kushner and Martins (1991).

The main contributions of our work are the following:

  1. (1)

    We formulate the harvesting-seeding problem for a system of interacting species living in a stochastic environment.

  2. (2)

    We establish the finiteness and the continuity of the value function and characterize the value function as a viscosity solution of an associated HJB system of quasi-variational inequalities.

  3. (3)

    We develop numerical approximation schemes based on the Markov chain approximation method.

  4. (4)

    We discover new phenomena by analyzing natural examples for one and two-species systems.

The rest of our work is organized as follows. In Sect. 2 we describe our model and the main results. Particular examples are explored using the newly developed numerical schemes in Sect. 3. Finally, all the technical proofs appear in the appendices.

2 Model and results

Assume we have a probability space \((\Omega , {\mathcal {F}}, {{\mathbb {P}}})\) satisfying the usual conditions. We consider d species interacting nonlinearly in a stochastic environment. We model the dynamics as follows. Let \(\xi _i(t)\) be the abundance of the ith species at time \(t\ge 0\), and denote by \(\xi (t)=(\xi _1(t), \dots , \xi _d(t))'\in \mathbb {R}^d\) (where \(z'\) denotes the transpose of z) the column vector recording all the species abundances.

One way of adding environmental stochasticity to a deterministic system is based on the assumption that the environment mainly affects the growth/death rates of the populations. This way, the growth/death rates in an ODE (ordinary differential equation) model are replaced by their average values to which one adds a white noise fluctuation term (Turelli 1977; Braumann 2002; Gard 1988; Evans et al. 2013; Schreiber et al. 2011; Gard 1984).

Under this assumption the dynamics becomes

$$\begin{aligned} d \xi (t)=b(\xi (t)) dt+\sigma (\xi (t)) d w(t). \end{aligned}$$
(2.1)

where \(w(\cdot )=(w_1(\cdot ), ..., w_d (\cdot ))'\) is a d-dimensional standard Brownian motion and \(b,\sigma :[0,\infty )^d\rightarrow [0,\infty )^d\) are smooth enough functions. Let \(S=(0, \infty )^d\) and \({{\bar{S}}}=[0, \infty )^d\). We assume that \(b(0)=\sigma (0)=0\) so that 0 is an equilibrium point of (2.1). This makes sense because if our populations go extinct, they should not be able to get resurrected without external intervention (like a repopulation/seeding event). If \(\xi _i(t_0)=0\) for some \(t_0\ge 0\), then \(\xi _i(t)=0\) for any \(t\ge t_0\). Thus, \(\xi (t)\in {{\bar{S}}}\) for any \(t\ge 0\).

For \(x, y\in \mathbb {R}^d\), with \(x=(x_1, \dots , x_d)'\) and \(y=(y_1, \dots , y_d)'\), we write \(x\le y\) or \(y\ge x\) if \(x_j\le y_j\) for each \(j=1, \dots , d\), while \(x < y\) if \(x_j < y_j\) for each \(j=1, \dots , d\).. We also define the scalar product \(x\cdot y=\sum _{j=1}^d x_j y_j\). For a real number a, we denote \(a^+=\max \{a, 0\}\) and \(a^-=\max \{-a, 0\}\). Thus, \(a=a^+-a^-\) and \(|a|=a^++a^-\). For \(x=(x_1, \dots , x_d)'\in \mathbb {R}^d\), \(x^+=\big ( x_1^+, \dots , x_d^+\big )'\) and \(x^-=\big ( x_1^-, \dots , x_d^-\big )'\). Let \(\mathbf{e_i}\in \mathbb {R}^d\) denote the unit vector in the ith direction for \(i=1, \dots , d\).

To proceed, we introduce the generator of the process \(\xi (t)\). For a twice continuously differentiable function \(\Phi (\cdot ): \mathbb {R}^d\mapsto \mathbb {R}\), we define

$$\begin{aligned} \begin{array}{ll} {\mathcal {L}}\Phi (x)&\!\displaystyle \,=b(x)\nabla \Phi (x)+\dfrac{1}{2}\hbox {tr}\big (\sigma (x)\sigma '(x)\nabla ^2 \Phi (x)\big ), \end{array} \end{aligned}$$

where \(\nabla \Phi (\cdot )\) and \(\nabla ^2 \Phi (\cdot )\) denote the gradient and Hessian matrix of \(\Phi (\cdot )\), respectively.

Next, we have to add harvesting and seeding to (2.1). Let \(Y_i(t)\) denote the amount of species i that has been harvested up to time t and set \(Y(t)=(Y_1(t), \dots , Y_d(t))'\in \mathbb {R}^d\). Let \(Z_i(t)\) denote the amount of species i seeded into the system up to time t and set \(Z(t)=(Z_1(t), \dots , Z_d(t))'\in \mathbb {R}^d\). The dynamics of the d species that takes into account harvesting and seeding is given by

$$\begin{aligned} X(t)=x+\int \limits _0^t b(X(s)) ds + \int \limits _0^t \sigma (X(s)) dw(s) - Y(t) +Z(t), \end{aligned}$$
(2.2)

where \(X(t)=(X_1(t), \dots , X_d(t))'\in \mathbb {R}^d\) are the species abundances at time \(t\ge 0\). We also assume the initial species abundances are

$$\begin{aligned} X(0-)=x\in {{\bar{S}}}. \end{aligned}$$
(2.3)

Notation For each time t, \(X(t-)\) represents the state before harvesting starts at time t, while X(t) is the state immediately after. Hence X(0) may not be equal to \(X(0-)\) due to an instantaneous harvest Y(0) or an instantaneous seeding Z(0) at time 0. Throughout the paper we use the convention that \(Y(0-)=Z(0-)=0\). The jump sizes of Y(t) and Z(t) are denoted by \(\Delta Y(t):=Y(t) - Y(t-)\) and \(\Delta Z(t):=Z(t) - Z(t-)\), respectively. We use \(Y^c(t):= Y(t) - \sum \nolimits _{0\le s\le t} \Delta Y(s)\) and \(Z^c(t):= Z(t) - \sum \nolimits _{0\le s\le t} \Delta Z(s)\) to denote the continuous part of Y and Z. Also note that \(\Delta X(t):= X(t) - X(t-)= \Delta Z(t)-\Delta Y(t)\) for any \(t \ge 0\).

Let \(f_i: {{\bar{S}}}\mapsto (0, \infty )\) represent the instantaneous marginal yields accrued from exerting the harvesting strategy \(Y_i\) for the species i, also known as the price of species i. Let \(g_i: {{\bar{S}}}\mapsto (0, \infty )\) represent the total cost we need to pay for the seeding strategy \(Z_i\) on species i. We will set \(f=(f_1, \dots , f_d)'\) and \(g=(g_1, \dots , g_d)'\). For a harvesting-seeding strategy (YZ) we define the performance function as

$$\begin{aligned} J(x, Y, Z):= {{\mathbb {E}}}_{x}\bigg [\int \limits _0^{\infty } e^{-\delta s} f( X(s-) )\cdot dY(s)-\int \limits _0^{\infty } e^{-\delta s} g( X(s-)) \cdot dZ(s)\bigg ],\nonumber \\ \end{aligned}$$
(2.4)

where \(\delta > 0\) is the discounting factor, \({{\mathbb {E}}}_{x}\) denotes the expectation with respect to the probability law when the initial abundances are \(X(0-)=x\), and \(f(X(s-))\cdot dY(s):=\sum _{i=1}^d f_i(X(s-)) dY_i(s)\).

Control strategy Let \({\mathcal {A}}_{x}\) denote the collection of all admissible controls with initial condition x. A harvesting-seeding strategy (YZ) will be in \({\mathcal {A}}_x\) if it satisfies the following conditions:

(a):

the processes Y(t) and Z(t) are right continuous, nonnegative, and nondecreasing with respect to t; moreover, \(\Delta Y_i(t) \Delta Z_i(t)=0\) for \(i=1, \dots , d\) and \(t\ge 0\),

(b):

the processes Y(t) and Z(t) are adapted to \(\sigma \{w(s): 0\le s\le t\}\), augmented by the \({{\mathbb {P}}}\)-null sets,

(c):

The system (2.2) has a unique solution \(X(\cdot )\) with \(X(t)\ge 0\) for any \(t\ge 0\),

(d):

\(0< J(x, Y, Z)<\infty \) for any \(x\in S\), where \(J(\cdot )\) is the functional defined in (2.4).

Remark 2.1

The condition \(\Delta Y_i(t) \Delta Z_i(t)=0\), for any \(i=1, \dots , d\) and any \(t\ge 0\) means that we do not allow the simultaneous harvesting and seeding of the same species. Note that this would never yield an optimal harvesting-seeding strategy because of the assumption \(f_i < g_i\).

The optimal harvesting-seeding problem The problem we will be interested in is to maximize the performance function and find an optimal harvesting strategy \((Y^*, Z^*)\in {\mathcal {A}}_{x}\) such that

$$\begin{aligned} J(x, Y^*, Z^*)=V(x):= \sup \limits _{(Y, Z)\in {\mathcal {A}}_{x}}J(x, Y, Z). \end{aligned}$$
(2.5)

The function \(V(\cdot )\) is called the value function.

Remark 2.2

We note that the optimal harvesting strategy might not exist, i.e. the maximum over \({\mathcal {A}}_x\) might not be achieved in \({\mathcal {A}}_x\).

Assumption 2.3

We will make the following standing assumptions throughout the paper.

(a):

The functions \(b(\cdot )\) and \(\sigma (\cdot )\) are continuous. Moreover, for any initial condition \(x\in {{\bar{S}}}\), the uncontrolled system (2.1) has a unique global solution.

(b):

For any \(i=1, \dots , d\), \(x, y\in \mathbb {R}^d\), \({f_i(x)}< g_i(y) \); \(f_i(\cdot )\), \(g_i(\cdot )\) are continuous and non-increasing functions.

Remark 2.4

Note that Assumption 2.3 (a) does not put significant restraints on the dynamics of the species. Our framework therefore contains a very broad class of models. In particular, this covers all Lotka-Volterra competition and predator–prey models as well as the more general Kolmogorov systems (Du et al. 2016; Li and Mao 2009; Mao and Yuan 2006; Hening and Nguyen 2018). The continuity and monotonicity of the functions \(f(\cdot ), g(\cdot )\) from Assumption 2.3(b) are standard (Alvarez 2000; Song et al. 2011; Tran and Yin 2017). In particular, \(g_i\) is non-increasing because one can see this as an economy of scale which implies that the per unit cost of restocking decreases as more is restocked The additional requirement that \({f_i(x)}< g_i(y) \) for any \(x, y\in {{\bar{S}}}\) can be explained as follows: the cost of seeding an amount of a species is always higher than the benefit received from harvesting the same amount. This makes sense because in order to seed the species, one has to have access to a pool of individuals of this species. For this, one either has to keep individuals at a specific location (thus using resources to sustain them) or one has to transport/buy individuals. In the setting of optimal dividend payments, these extra costs reflect penalizing factors (Kulenko and Schmidli 2008) and transaction costs (Jin et al. 2013; Scheer and Schmidli 2011).

We collect some of the results we are able to prove about the value function.

Proposition 2.5

Let Assumption 2.3 be satisfied. Then the following assertions hold.

(a):

For any \(x, y\in {{\bar{S}}}\),

$$\begin{aligned} V(y)\le V(x) - f(x)\cdot (x-y)^++g(x)\cdot (x-y)^-. \end{aligned}$$
(2.6)
(b):

If \(V(0)<\infty \), then \(V(x)<\infty \) for any \(x\in {{\bar{S}}}\) and V is Lipschitz continuous.

Example 2.6

In the current setting, contrary to the regular harvesting setting without seeding, V(0) can be nonzero because of the benefits from seedings. Consider the single species system given by

$$\begin{aligned} dX(t)=X(t)(a-bX(t))dt + \sigma X(t) dw(t)-dY(t) +dZ(t), \quad X(0)=x,\nonumber \\ \end{aligned}$$
(2.7)

where ab,  and \(\sigma \) are constants and the price function is \(f(x)=1, x\ge 0\). It has been shown in Alvarez and Shepp (1998) that, if there is no seeding, the value function is given by

$$\begin{aligned} V_0(x)= \psi (x) \text { for }x<x^*, \quad V_0(x)= x-x^*+\psi (x^*) \text { for }x\ge x^*, \end{aligned}$$

where \(x^*\in (0, \infty )\) and \(\psi : [0, \infty )\rightarrow [0, \infty )\) is twice continuously differentiable, and \(\psi (x)>x\) for all \(x\in (0, x^*]\). Let \(g(x)=\kappa \in {\mathbb {R}}\), where \(1<\kappa <\psi (x^*)/x^*\). Let \((Y, Z)\in {\mathcal {A}}_0\) be such that \(J(0, Y, 0)=V_0(x)\) and \(Z(t)=Z(0)=x^*\) for all \(t\ge 0\). Then

$$\begin{aligned} V(0)\ge J(0, Y,Z)\ge \psi (x^*)-\kappa x^*>0. \end{aligned}$$

Since \(V(0)>0\), the system does not get depleted in a finite time under an optimal harvesting strategy.

Proposition 2.7

Let Assumption 2.3 be satisfied. Moreover, suppose that there is a positive constant C such that

$$\begin{aligned} b_i(x)\le \delta x_i+C, \quad x\in {{\bar{S}}}, \quad i=1, \dots , d. \end{aligned}$$
(2.8)

Then there exist a positive constant M such that

$$\begin{aligned} V(x)\le \sum \limits _{i=1}^d f_i(0) x_i+ M, \quad x\in {{\bar{S}}}. \end{aligned}$$

Remark 2.8

We note that the condition on the drift \(b(\cdot )\) is very natural. Consider the one-dimensional dynamics given by

$$\begin{aligned} dX(t)=bX(t)dt + \sigma X(t) dw(t)-dY(t) +dZ(t), \quad X(0)=x, \end{aligned}$$
(2.9)

with \(f(x)=1, x\ge 0\) and any function \(g(\cdot )\). It is clear that if \(b>\delta \), the value function in the harvesting problem with no seeding is

$$\begin{aligned} V_0(x)=\inf \limits _{(Y, Z)\in {\mathcal {A}}_{x}, Z=0 }J(x, Y, Z)=\infty \quad \text {for all}\quad x>0. \end{aligned}$$

As a result the value function for (2.9) will be \(V(x)=\infty , x>0.\)

Seeding can also change the finiteness of the value function. Indeed, consider the harvesting problem

$$\begin{aligned} dX(t)=b(X(t))dt + \sigma (X(t)) dw(t)-dY(t) +dZ(t), \quad X(0)=x, \end{aligned}$$
(2.10)

with \(f(x)=1, g(x)=2, x\ge 0\). Suppose that \(g(x)=\sigma (x)=0\) for \(x<1\) and \(b(x)=(1+\delta ) x( 1-x)\) and \(\sigma (x)=0\) for \(x>1\). Then it is clear that without seeding we get the value function \(V_0(x)=\infty \) for \(x>1\) and \(V_0(x)=x\) for \(x\le 1\). When seeding is allowed, we have \(V(x)=\infty \) for all \(x\ge 0\).

We get the following characterization of the value function.

Theorem 2.9

Let Assumption 2.3 be satisfied and suppose \(V(x)<\infty \) for \(x\in {S}\). The value function \(V(\cdot )\) is a viscosity solution to the HJB equation

$$\begin{aligned} \max \limits _{i} \bigg \{({\mathcal {L}}-\delta )V(x), f_i(x)-\dfrac{\partial V}{\partial x_i}(x), \dfrac{\partial V}{\partial x_i}(x)-g_i(x)\bigg \}= 0. \end{aligned}$$
(2.11)

Remark 2.10

Theorem 2.9 is a theorem that tells us how to find the value function. The problem is that the solutions of (2.11) are not always smooth enough for \({\mathcal {L}}V\) to make sense. This is why we work with viscosity solutions of (2.11).

We next explain what a viscosity solution means. For any \(x^0\in S\) and any function \(\phi \in C^2(S)\) such that \(V(x_0)=\phi (x_0)\) and \(V(x)\ge \phi (x)\) for all x in a neighborhood of \(x^0\), we have

$$\begin{aligned} \max \limits _{i} \bigg \{({\mathcal {L}}-\delta )\phi (x^0), f_i(x^0)-\dfrac{\partial \phi }{\partial x_i}(x^0), \dfrac{\partial \phi }{\partial x_i}(x^0)-g_i(x^0)\bigg \}\le 0. \end{aligned}$$

Similarly, for any \(x^0\in S\) and any function \(\varphi \in C^2(S)\) satisfying \(V(x_0)=\phi (x_0)\) and \(V(x)\le \phi (x)\) for all x in a neighborhood of \(x^0\), we have

$$\begin{aligned} \max \limits _{i} \bigg \{({\mathcal {L}}-\delta )\varphi (x^0), f_i(x^0)-\dfrac{\partial \varphi }{\partial x_i}(x^0), \dfrac{\partial \varphi }{\partial x_i}(x^0)-g_i(x^0)\bigg \}\ge 0. \end{aligned}$$

This extends the results by Haussmann and Suo (1995a, b), Lungu and Øksendal (2001) where the authors had to assume that the coefficients \(b, \sigma \) are bounded or the prices \(f_i\) are not density-dependent. Usually the functions \(b,\sigma \) are not bounded and the prices depend on the abundances of the species. Moreover, we consider both harvesting and seeding. Therefore, our results provide a significant generalization of those previously shown by Haussmann and Suo (1995a), Lungu and Øksendal (2001).

We also get the following verification theorem, that tells us that if a function satisfies certain properties, then it will be the value function. We note that this is natural analogue with seeding of Theorem 2.1 of Lungu and Øksendal (2001), Alvarez et al. (2016).

Theorem 2.11

Let Assumption 2.3 be satisfied. Suppose that there exists a function \(\Phi : {{\bar{S}}}\mapsto [0, \infty )\) such that \(\Phi \in C^2({{\bar{S}}})\) and that \(\Phi (\cdot )\) solves the following coupled system of quasi-variational inequalities

$$\begin{aligned} \sup \limits _{(x, i)} \bigg \{({\mathcal {L}}-\delta )\Phi (x), f_i(x)-\dfrac{\partial \Phi }{\partial x_i}(x), \dfrac{\partial \Phi }{\partial x_i}(x)-g_i(x)\bigg \}\le 0, \end{aligned}$$
(2.12)

where \(({\mathcal {L}}-\delta )\Phi (x)={\mathcal {L}}\Phi (x)-\delta \Phi (x)\). Then the following assertions hold.

(a):

We have

$$\begin{aligned} V(x)\le \Phi (x)\quad \text {for any } x\in {S}. \end{aligned}$$
(2.13)
(b):

Define the non-intervention region

$$\begin{aligned} {\mathcal {C}}= \left\{ x\in S: f_i(x)<\dfrac{\partial \Phi }{\partial x_i}(x)<g_i(x) \right\} . \end{aligned}$$

Suppose that

$$\begin{aligned} ({\mathcal {L}}-r)\Phi (x)=0, \end{aligned}$$
(2.14)

for all \(x\in {\mathcal {C}}\), and that there exists a harvesting-seeding strategy \(\big (\widetilde{Y}, \widetilde{Z}\big ) \in {\mathcal {A}}_{x}\) and a corresponding process \(\widetilde{X}\) such that the following statements hold.

(i):

\(\widetilde{X}(t)\in \overline{{\mathcal {C}}}\) for Lebesgue almost all \(t\ge 0.\)

(ii):

\(\int \nolimits _0^{t} \left[ \nabla \Phi (\widetilde{X}(s))- f(\widetilde{X}(s))\right] \cdot d\widetilde{Y}^c(s)=0\) for any \(t\ge 0\).

(iii):

\(\int \nolimits _0^{t} \Big [g(\widetilde{X}(s))-\nabla \Phi (\widetilde{X}(s)) \Big ] \cdot d\widetilde{Z}^c(s)=0\) for any \(t\ge 0\).

(iv):

If \(\widetilde{X}(s)\ne \widetilde{X}(s-)\), then

$$\begin{aligned} \Phi (\widetilde{X}(s))-\Phi (\widetilde{X}(s-))=- f(\widetilde{X}(s-)) \cdot \Delta \widetilde{Z}(s). \end{aligned}$$
(v):

\(\lim \limits _{N\rightarrow \infty }E_{x}\Big [e^{-rT_N}\Phi (\widetilde{X}(T_N))\Big ]=0\), where for each \(N=1, 2, \dots \),

$$\begin{aligned} \beta _N:=\inf \{t\ge 0: |X(t)|\ge N\},\quad T_N: = N \wedge \beta _N.\end{aligned}$$
(2.15)

Then \(V(x)=\Phi (x)\) for all \(x\in S\), and \(\big (\widetilde{Y},\widetilde{Z}\big )\) is an optimal harvesting-seeding strategy.

Remark 2.12

Following (Lungu and Øksendal 2001) we note that if we can find a function satisfying (2.12), (2.13) and (2.14), then one can construct a strategy satisfying assumptions (i), (ii), (iii) and (iv) from Theorem 2.11 part b) by solving the Skorokhod stochastic differential equation for the reflection of the process X(t) in the domain \({\mathcal {C}}\). We refer the reader to check further literature (Lungu and Øksendal 2001; Bass 1998; Freidlin 2016; Lions and Sznitman 1984) for more details about Skorokhod stochastic differential equations.

We can extend Principle 2.1 of Lungu and Øksendal (2001) as follows.

Principle 2.13

(One-at-a-time principle) Suppose the diffusion matrix \(\sigma (x)\sigma '(x)\) is nondegenerate for all \(x\in S\). Then it is almost always optimal to harvest or to seed from at most one species at a time.

Proof

We follow (Lungu and Øksendal 2001). Assume for simplicity \(d=2\) so that we have two species. The non-intervention region \({\mathcal {C}}\) is bounded by the four curves curves \(\Lambda ^f_1, \Lambda ^f_2, \Lambda ^g_1, \Lambda ^g_2\) given by

$$\begin{aligned} \Lambda ^f_i = \left\{ (x_1,x_2)\in S~\Bigg |~ \frac{\partial \Phi }{\partial x_i}=f_i(x_1,x_2)\right\} \end{aligned}$$

and

$$\begin{aligned} \Lambda ^g_i = \left\{ (x_1,x_2)\in S~\Bigg |~ \frac{\partial \Phi }{\partial x_i}=g_i(x_1,x_2)\right\} . \end{aligned}$$

Note that we would have simultaneous harvesting and seeding of species i only when the process is at \(\Lambda ^f_i \cap \Lambda ^g_i \), simultaneous harvesting of the two species only when the process is at \(\Lambda ^f_1 \cap \Lambda ^f_2 \), simultaneous harvesting of species 1 and seeding of species 2 only when the process is at \(\Lambda ^f_1 \cap \Lambda ^g_2\), etc. Now, if the diffusion is non-degenerate, the probability it hits a set of the form \(\Lambda ^f_i \cup \Lambda ^f_j\) for \(i\ne j\) or \(\Lambda ^f_i \cup \Lambda ^g_j \) is equal to zero. This argument can be extended to n dimensions—see Principle 2.1 of Lungu and Øksendal (2001). \(\square \)

2.1 Numerical scheme

A closed-form solution to the HJB equation from Theorem 2.9 is virtually impossible to obtain. Moreover, the initial value of V(0) is not specified. In order to by-pass these difficulties and to gain information about the value function and the optimal harvesting-seeding strategy we provide a numerical approach. Using the Markov chain approximation method (Budhiraja and Ross 2007; Jin et al. 2013; Kushner and Martins 1991; Kushner and Dupuis 1992), we construct a controlled Markov chain in discrete time to approximate the controlled diffusions. For the convergence analysis, we also suppose that both \(f(\cdot )\) and \(g(\cdot )\) are constant functions. Let \(h>0\) be a discretization parameter. Since the real population abundances cannot be infinite, we choose a large number \(U>0\) and define the class \({\mathcal {A}}^U_{x}\subset {\mathcal {A}}_{x}\) that consists of strategies \((Y,Z)\in {\mathcal {A}}_x\) such that the resulting process X stays in \([0,U]^d\) for all times. The class \({\mathcal {A}}^U_{x}\) can be constructed by using Skorokhod stochastic differential equations (Bass 1998; Freidlin 2016; Lions and Sznitman 1984) in order to make sure that the process stays in \([0,U]^d\) for all \(t>0\).

Let \(({\tilde{Y}}^U, {\tilde{Z}}^U)\in {\mathcal {A}}^U_{x}\) and \(V^U(x)\) be defined as the optimal harvesting-seeding strategy and the value function when we restrict the problem to the class \({\mathcal {A}}^U_{x}\subset {\mathcal {A}}_{x}\)

$$\begin{aligned} J(x, {\tilde{Y}}^U, {\tilde{Z}}^U)=V^U(x):=\sup \limits _{(Y, Z)\in {\mathcal {A}}_{x}^U} J(x, Y, Z) \end{aligned}$$
(2.16)

Remark 2.14

We conjecture that, generically, the optimal strategy will live in \({\mathcal {A}}_x^U\) for U large enough, i.e. there exists \(U>0\) such that for all \(x\in [0,U]^d\) we have

$$\begin{aligned} J(x, Y^*, Z^*)=V(x):= & {} \sup \limits _{(Y, Z)\in {\mathcal {A}}_{x}}J(x, Y, Z) =V^U(x)\\:= & {} \sup \limits _{(Y, Z)\in {\mathcal {A}}_{x}^U} J(x, Y, Z)=J(x, {\tilde{Y}}^U, {\tilde{Z}}^U). \end{aligned}$$

The verification Theorem 2.11 provides a heuristic argument for this conjecture.

Assume without loss of generality that U is an integer multiple of h. Define

$$\begin{aligned} S_{h}: = \{x=(k_1 h, \dots , k_d h)'\in \mathbb {R}^d: k_i=0, 1, 2, \dots \}\cap [0, U]^d. \end{aligned}$$

Let \(\{X^h_n: n=0, 1, \dots \}\) be a discrete-time controlled Markov chain with state space \(S_{h}\). We define the difference

$$\begin{aligned} \Delta X_n^h = X_{n+1}^h-X_{n}^h. \end{aligned}$$

At any discrete-time step n, one can either harvest, seed, or do nothing. We use \(\pi ^h_n\) to denote the action at step n, where \(\pi ^h_n=-i\) if there is seeding of species i, \(\pi ^h_n=0\) if there is no seeding or harvesting of species i, and \(\pi ^h_n=i\) if there is harvesting. Denote by \(\Delta Y^h_n\) and \(\Delta Z^h_n\) the harvesting amount and the seeding amount for the chain at step n, respectively. If \(\pi ^h_n=0\), then the increment \(\Delta X_n^h\) is to behave like an increment of \(\int b dt +\int \sigma dw\) over a small time interval. Such a step is also called “diffusion step”. If \(\pi ^h_n=-i\), then \(\Delta Y^h_n=0\in \mathbb {R}^d\) and \(\Delta Z^h_n=h\mathbf{e_i}\). If \(\pi ^h_n=i\), then \(\Delta Y^h_n=h\mathbf{e_i}\) and \(\Delta Z^h_n=0\in \mathbb {R}^d\). Note that \(\Delta X^h_n=-\Delta Y^h_n + \Delta Z^h_n\). Moreover, we can write

$$\begin{aligned} \Delta X_n^h= & {} \Delta X_n^h I_{\{ \text {diffusion step at } n\}} + \Delta X_n^h I_{\{\text {harvesting step at }n\}}\nonumber \\&+ \Delta X_n^h I_{\{\text {seeding step at }n\}}. \end{aligned}$$
(2.17)

For definiteness, if \(X^{h}_{n, i}\) is the ith component of the vector \(X^h_n\) and \(\{j: X^{h}_{n, j}=U\}\) is non-empty, then step n is a harvesting step on species \(\min \{j: X_{n, j}^{h}=U\}\). Let \(\pi ^h = (\pi _0^h, \pi _1^h, \dots )\) denote the sequence of control actions. We denote by \(p^h(x, y)|\pi )\) the transition probability from state x to another state y under the control \(\pi \). Denote \({\mathcal {F}}^h_n=\sigma \{X^h_m, \pi ^h_m, m\le n\}\).

The sequence \(\pi ^h\) is said to be admissible if it satisfies the following conditions:

(a):

\(\pi ^h_n\) is \(\sigma \{X^h_0, \dots , X^h_{n}, \pi ^h_0, ..., \pi ^h_{n-1}\}\text {---adapted},\)

(b):

For any \(x\in S_h\), we have

$$\begin{aligned} {{\mathbb {P}}}\{ X^h_{n+1} =x | {\mathcal {F}}^h_n\}= {{\mathbb {P}}}\{X^h_{n+1}= x | X^h_n, \pi ^h_n\} = p^h( X^h_n, x| \pi ^h_n), \end{aligned}$$
(c):

Denote by \(X^{h}_{n, i}\) the ith component of the vector \(X^h_n\). Then

$$\begin{aligned} {{\mathbb {P}}}\big ( \pi ^h_{n}=\min \{j: X^{h}_{n, j} = U\} | X^{h}_{n, j} = U \text { for some } j\in \{1, \dots , d \}, {\mathcal {F}}^h_n\big )=1.\nonumber \\ \end{aligned}$$
(2.18)
(d):

\(X^h_n\in S_h\) for all \(n=0, 1, 2, \dots \).

The class of all admissible control sequences \(\pi ^h\) for initial state x will be denoted by \({\mathcal {A}}^h_{x}\).

For each couple \((x, i)\in S_h\times \{0, \pm 1, \dots , \pm d\}\), we define a family of the interpolation intervals \(\Delta t^h (x, i)\). The values of \(\Delta t^h (x, i)\) will be specified later. Then we define

$$\begin{aligned} \begin{array}{ll} &{}\displaystyle t^h_0 = 0,\quad \Delta t^h_m = \Delta t^h(X^h_m, \pi ^h_m), \quad t^h_n = \sum \limits _{m=0}^{n-1} \Delta t^h_m.\\ \end{array} \end{aligned}$$
(2.19)

For \(x\in S_h\) and \(\pi ^h\in {\mathcal {A}}^h_{x}\), the performance function for the controlled Markov chain is defined as

$$\begin{aligned} J^h(x, \pi ^h) = {{\mathbb {E}}}\sum _{m=1}^{\infty } e^{-\delta t_m^h}\bigg [f (X^h_m)\cdot \Delta Y_{m}^{h}-g(X^h_m) \cdot \Delta Z_{m}^{h} \bigg ]. \end{aligned}$$
(2.20)

The value function of the controlled Markov chain is

$$\begin{aligned} V^h(x) = \sup \limits _{\pi ^h\in {\mathcal {A}}^h_{x}} J^h (x, \pi ^h). \end{aligned}$$
(2.21)

Theorem 2.15

Suppose Assumptions 2.3 and B.1 hold. Then \(V^h(x)\rightarrow V^U(x)\) as \(h\rightarrow 0\). Thus, for sufficiently small h, a near-optimal harvesting-seeding strategy of the controlled Markov chain is also a near-optimal harvesting-seeding policy of the original continuous-time problem.

3 Numerical examples

3.1 Single species system

We consider a single species ecosystem. The dynamics that includes harvesting and seeding will be given by

$$\begin{aligned} d X(t) = X(t)\big (b-cX(t)\big ) + \sigma X(t) dw(t)-dY(t) +dZ(t). \end{aligned}$$
(3.1)

For an admissible strategy (YZ) we have

$$\begin{aligned} J(x, Y, Z)={{\mathbb {E}}}\left[ \int _0^\infty e^{-\delta s} f(X(s-))dY(s)-\int _0^\infty e^{-\delta s} g(X(s-))dZ(s)\right] .\qquad \end{aligned}$$
(3.2)

Based on the algorithm constructed above and in Appendix B, we carry out the computation by value iterations. Let \((Y_0,Z_0)\) be the policy that drives the system to extinction immediately and has no seeding. Then \(J(x, Y_0, Z_0)=f(x)x\) for all x. Recall (Alvarez and Shepp 1998) that \(J(x, Y_0, Z_0)\) is also referred to as current harvesting potential. Letting \((Y_0, Z_0)\) be the initial strategy, we set the initial values

$$\begin{aligned} V_0^h(x)=f(x)x, \quad x = 0, h, 2h, \dots , U = 10. \end{aligned}$$

We outline how to find the values of \(V(\cdot )\) as follows. At each level \(x=h,2h, \dots , U\), denote by \(\pi (x, n)\) the action one chooses, where \(\pi (x, n)=1\) if there is harvesting, \(\pi (x, n)=-1\) if there is seeding, and \(\pi (x, n)=0\) if there is no harvesting or seeding. We initially let \(\pi (x, 0)=1\) for all x and we try to find better harvesting-seeding strategies. We find an improved value \(V^h_{n+1}(x)\) and record the corresponding optimal action by

$$\begin{aligned} \pi (x, n)=\hbox {argmax}\left\{ i=-1, 0, 1: V^{h, i}_{n+1} (x, \alpha )\right\} ,\quad V^h_{n+1}(x)= V^{h, \pi (x, n)}_{n+1} (x), \end{aligned}$$

where

$$\begin{aligned} \begin{array}{ll} &{}\displaystyle V^{h, 1}_{n+1}(x)=V^h_n(x-h) + f(x)h,\\ &{}\displaystyle V^{h, -1}_{n+1}(x)=V^h_n(x+h) - g (x)h,\\ &{}\displaystyle V^{h}_{n+1, 0} (x) =e^{-\delta \Delta t^h(x, 0) }\Big [ V^{h}_{n} (x+h) p^h (x, x+h | \pi )+V^{h}_{n} (x-h) p^h ( x, x-h | \pi \big ) \Big ]. \end{array} \end{aligned}$$

The iterations stop as soon as the increment \(V^h_{n+1}(\cdot )-V^h_n(\cdot )\) reaches some tolerance level. We set the error tolerance to be \(10^{-8}\).

The numerical experiments provide evidence that the following conjecture holds

Conjecture 3.1

Suppose we have one species that evolves according to (3.1) and suppose Assumption 2.3 holds. One can construct the optimal harvesting-seeding strategy \((Y^*,Z^*)\) as follows. There exist lower and upper thresholds \(0\le u^*< v^*<\infty \) such that after \(t\ge 0\) the abundance of the species always stays in the interval \([u^*,v^*]\). More explicitly if \(X(0-)=x\) then

$$\begin{aligned} \begin{aligned} (Y^{u^*}(t), Z^{v^*}(t))&= {\left\{ \begin{array}{ll} \left( (x-v^*)^+,(u^*-x)^+\right) &{}\quad {if t=0,} \\ (L(t,v^*), L(t,u^*)) &{} \quad {if t>0} \end{array}\right. } \end{aligned} \end{aligned}$$
(3.3)

where \(L(t,u^*)\) (respectively \(L(t,v^*)\)) is the local time push of the process X at the boundary \(u^*\) (respectively \(v^*\)).

Fig. 1
figure 1

Value function and optimal policies: \(f(x)=1, g(x)=3\) for \(x\ge 0.\)

For the first numerical experiment we take \(b=3, c=2, \sigma =1\) in (3.1). Let \(\delta =0.05\), and \(f(x)=1,g(x)=3\) for all \(x\ge 0\). Figure 1 shows the value function V(x) as a function of the initial population x and provides optimal policies, with 1 denoting harvesting, \(-1\) denoting seeding, and 0 denoting no harvesting or seeding. It can be seen from Fig. 1 that the optimal policy is a barrier strategy. There are levels \(L_1\) and \(L_2\) such that \([0, L_1)\) is the seeding region, \([L_1, L_2)\) is the diffusion region where there is no control of the population, and \([L_2, U]\) is the harvesting region. Because of the benefit from seeding, \(V(0)>0\). These observations agree with those in the analogous financial setting (Jin et al. 2013; Scheer and Schmidli 2011).

Next, suppose that g takes very large values. In particular, we take \(g(x)=50, x\ge 0\). In this case, one can observe that there is no seeding; see Fig. 2. In other words, because the cost of seeding is very high, the optimal strategy does not benefit from seeding.

To explore how noise impacts the problem, we explore what happens when \(\sigma =1000\) and keep the other coefficients the same. The results are shown on Fig. 3. It turns out, as expected, that if the noise is very large, the value function is close to the current harvesting potential \(J(\cdot , Y_0, Z_0)\) and no seeding is needed. This is because the large noise will drive the species extinct with probability 1 and, therefore, the optimal strategy is to immediately harvest all individuals. We refer the reader to the works by Alvarez and Shepp (1998), Tran and Yin (2016), Hening et al. (2019), Alvarez and Hening (2018) for more insight regarding how noise impacts harvesting.

Fig. 2
figure 2

Value function and optimal policies: \(f(x)=1, g(x)=50\) for \(x\ge 0\)

Fig. 3
figure 3

Value function and optimal policies: \(f(x)=1, g(x)=3, \sigma (x)=1000\) for \(x\ge 0.\)

Fig. 4
figure 4

Value function versus initial population for a two-species competitive model

3.2 Two-species ecosystems

Example 3.2

Consider two species competing according to the following stochastic Lotka-Volterra system

$$\begin{aligned} \begin{array}{ll} &{}\displaystyle d X_1(t) = X_1(t)\Big (b_1-a_{11}X_1(t) - a_{12} X_2(t) \Big ) + \sigma _1X_1(t)dw(t)-dY_1(t) + dZ_1(t)\\ &{}\displaystyle d X_2(t) = X_2(t)\Big (b_2-a_{21}X_1(t) - a_{22} X_2(t) \Big ) + \sigma _2X_2(t)dw(t)-dY_2(t) + dZ_2(t) \end{array}\nonumber \\ \end{aligned}$$
(3.4)

and suppose that \(\delta =0.05\), \(f_1(x)=1\), \(f_2(x)=2\), \(g_1(x)=4, g_2(x)=4\) for all \(x\in [0, \infty )^2\). We take \(U = 5\). In addition, set

$$\begin{aligned} b_1=3, a_{11}=2, a_{12}=1, \sigma _1=3, b_2=2, a_{21}=1, a_{22}=2, \sigma _2=3. \end{aligned}$$

Figure 4 shows the value function V as a function of initial population sizes (xy). Figure 5 provides the optimal harvesting-seeding policies, with “1” denoting harvesting of species 1, “\(-1\)” denoting seeding of species 1, “2” denoting harvesting of species 2, “\(-2\)” denoting seeding of species 2 and “0” denoting no harvesting or seeding. It can be seen from Fig. 5 that when population size of each species is larger than a certain level, it is optimal to harvest. However, for a very large region, harvesting of species 1 is the first choice. Moreover, one can observe that it is never optimal to seed species 1 (Fig. 6). As shown in Fig. 7, if we assume both species abundances are 0 initially, we should only seed species 2. This tells us that the benefits obtained from species 2 are larger than those from species 1 due to its higher price; i.e, \(f_2(x)=2>1=f_1(x)\).

Fig. 5
figure 5

Optimal harvesting-seeding strategy versus population size for a two-species competitive model

Fig. 6
figure 6

Optimal harvesting-seeding strategy versus population size for a two-species competitive model: the case \(y=0\) (the left picture) and \(x=0\) (the right picture)

Fig. 7
figure 7

Value function versus initial population for a two-species predator–prey model

Fig. 8
figure 8

Optimal harvesting-seeding strategy versus population size for a two-species predator–prey model

Example 3.3

Consider a predator–prey system modelled by the stochastic Lotka–Volterra system

$$\begin{aligned} d X_1(t)= & {} X_1(t)\Big (b_1-a_{11}X_1(t) - a_{12} X_2(t) \Big )\nonumber \\&+\, \sigma _1X_1(t)dw(t)-dY_1(t) + dZ_1(t)\nonumber \\ d X_2(t)= & {} X_2(t)\Big (\!-b_2 + a_{21}X_1(t) - a_{22} X_2(t) \Big )\nonumber \\&+\, \sigma _2X_2(t)dw(t)-dY_2(t) + dZ_2(t). \end{aligned}$$
(3.5)

Conditions for the coexistence and extinction of the different species can be found in Hening and Nguyen (2018). Suppose that \(\delta =0.05\), \(f_1(x)=1\), \(f_2(x)=1\), \(g_1(x)=6, g_2(x)=6\) for all \(x\in [0, \infty )^2\). We take \(U = 5\). In addition, let

$$\begin{aligned} b_1=2, a_{11}=1.2, a_{12}=1, \sigma _1=1.2, b_2=1, a_{21}=1.2, a_{22}=7, \sigma _2=1.3. \end{aligned}$$
Fig. 9
figure 9

Optimal harvesting-seeding strategy versus population size for a two-species predator–prey model: the case \(y=0\) (the left picture) and \(x=0\) (the right picture)

Figure 7 shows the value function V as a function of initial population (xy). Figure 8 provides the optimal harvesting-seeding strategies, with “1” denoting harvesting on species 1, “\(-1\)” denoting seeding on species 1, “2” denoting harvesting on species 2, “\(-2\)” denoting seeding on species 2 and “0” denoting no harvesting or seeding. We see in Fig. 9 that, as expected, since the predator goes extinct if there is no prey, the optimal strategy is to immediately harvest all the predators at time \(t=0\).