1 Introduction

There are many elements which combine to make colombian coffee a unique product. Firstly, coffee farmers manually harvest only ripe coffee cherries, which requires great effort due to the topography of the colombian Andes. Secondly, farmers carry out post-harvest processes, which entail the elimination of defective grains, pulping, washing, and drying. Later, the coffee is threshed to obtain parchment coffee, the raw roasting material. The economic importance of coffee as an export good is well justified by the impact it has on thousands of colombian families and millions of consumers around the world (Fedecafé 2019).

According to the National Federation of Coffee Growers,Footnote 1 (FNC for the acronym in Spanish), about 560000 families grow coffee in Colombia on farms of less than 5 hectares and they are responsible for 69% of production. Of the 940000 hectares of coffee grown in Colombia, around 780000 correspond to technified crops, which means they are planted with improved coffee varieties, such as rust resistant trees (about 80% compared to only 35% that were in 2010). The annual production of Colombian coffee from 1956 to 2018, reported in Fig. 1a, shows a positive trend, with turnarounds typically related to climatic phenomena (such as El Niño). It is however evident from Fig. 1b that the revenue from exportations is not directly related to production. Global economic factors, such as the interaction with other international coffee markets, and even changes in the currency exchange rates, definitely influence the revenue, but there is a growing consensus on the role played by the coffee quality attributes, with respect to which the production is nowadays increasingly diversified. Indeed, a wide variety of specialty coffees are currently produced, and consumers around the world are learning the value of high quality coffee, for which they are willing to pay higher prices. The FNC defines the special coffees as those obtained through (i) the development of new equipment and new forms of preparation, which guarantee better beverage quality, (ii) the association of coffee production with concepts such as sustainability, (iii) caring for the environment, (iv) social responsibility, and (v) economic equity. Special coffees are becoming a source of income for small producers who mainly market their product locally or through alternative trade shops, or who manage to export their coffee with certificated origin and production. According to the report “Global Specialty Coffee Market Size by Grade (80–84.99, 85-89.99, 90–100) by Application (Home, Commercial) by Region and Forecast 2019 to 2025”,Footnote 2 the world market for coffee reached revenues up to USD 35.9 billion in 2018, with a prospect of USD 83.6 billion by 2025. Unfortunately, in Colombia, the systematic collection, analysis, and dissemination of accurate information on the production, processing, and sales of special coffees is not yet consolidated, mainly because special coffees are often produced in small quantities and marketed directly by the producer. Currently, the FNC statistical records of coffee exports are only available by type: green, decaffeinated green, roasted in beans, roasted and ground, and extract and soluble (Fedecafé 2019).

Fig. 1
figure 1

a Anual registered Colombian coffee production in thousands of bags of 60 kg of green coffee. b Value of exports to all destinations—Anual total. Unit: Millions of dollars (Fedecafé 2019)

Beyond the main denominations (i)–(v) of special coffees, one of the factors that most impacts the quality of coffee is the cultivation protocols, that must be optimized to minimize the attack of pests and diseases, eliminate outer fruit layers, and control humidity (Montoya-Restrepo 1999). The most widespread coffee pest worldwide is a beetle, the coffee berry borer (CBB) Hypothenemus hampei (Coleoptera: Curculionidae: Scolytinae) (Pardey 2006). CBB adult females bore into coffee beans through the navel and into the endosperm, where it makes galleries to deposit its eggs. CBB causes different types of damage to the product, which are caused by (i) boring and feeding habits of adult and immature insects, which cause a reduction in yield and final product quality, and (ii) physical damage, which causes bored beans to become vulnerable to infection and further pest attacks (Damon 2000). Montoya’s investigation (Montoya-Restrepo 1999) strove to define what CBB infestation percentages and what levels of damage permit to obtain a coffee drink of acceptable quality. Specifically, the investigation supports the hypothesis that, beyond the damage, the CBB directly impacts the coffee market, by introducing a variety of different coffee types/qualities, classified depending on the proportion of bored grains that pass to production.

As a result of this situation, significant efforts have been made to identify the best CBB control strategies, among biological control, carried out via parasitism and predation (Follett et al. 2016; Infante 2018; Monagan et al. 2017; Morris and Perfecto 2016; Rodríguez et al. 2017), chemical control methods, by means of insecticides (Pardey 2006), and cultural control, the safest of all possible, that refers to agricultural practices, such as collecting overripe and dry grains (black grains no longer useful) to prevent adult CBB insects from finding refuge (Alarcón et al. 2017; Pardey 2006). Institutions supporting coffee production in Colombia, such as the FNC, recommend a combination of the three strategies, known as the Integrated CBB Control (Constantino et al. 2017; Pardey 2006).

The situation however calls for a more comprehensive view of the CBB phenomenon, that includes the market dynamics and its feedback on coffee production and on the whole agro-ecological context. It is indeed the final coffee consumer who exerts the selection to determine which new products invade the market and which get established or eliminated. In turn, strategic decisions on the production and commercialization sides are source of innovation for coffee types and qualities, innovations that are then filtered by the market competition. In this sense, it is important to study this feedback loop between market and production of coffee, when CBB damage is considered a cause of quality differentiation. Such a study should be able to determine the conditions under which an innovative special coffee, characterized by some quality attribute that differentiates it from standard coffee, can invade the market and either replace or coexist with standard coffee. In particular, conditions for coexistence open up the possibility for further diversification, even of two initially similar products. Under this comprehensive view, the role CBB control strategies will be particularly highlighted, not only limited at the pest containment, but extended to control the emergence of market niches for different coffee products.

These kinds of questions are addressed by evolutionary modeling approaches, and particularly by the Adaptive Dynamics (AD) framework (Dercole and Rinaldi 2008; Dieckmann and Law 1996; Geritz et al. 1997, 1998; Metz et al. 1996). AD is a theoretical modeling framework which originated in evolutionary biology and describes the long-term evolution of quantitative traits (i.e., continuous attributes determined by the cumulative contributions of many genes). The key feature of AD is to explicitly consider the feedback loop that binds demographic and evolutionary change. In biology, demography selects the traits who win the competition and evolution proceeds through sequences of genetic mutations that are selected by demography. In economics, the role of mutations and selection are played by innovations on the production side and market competition on the consumer side. By focusing on incremental innovations, put forward at a frequency that is low compared to the market dynamics, AD describes the evolution of the products’ traits (the coffee quality in our case) in terms of a differential equation, called the AD canonical equation, thus characterizing evolutionary equilibria as well as transients and non-stationary regimes (Dercole et al. 2003, 2006, 2010; Dercole and Rinaldi 2010; Dieckmann et al. 1995). Most importantly, AD endogenously integrates the changing system’s diversity, as the number of coexisting product types increases when innovative and established products coexist and further differentiate, evolutionary branching, and is pruned when evolution eliminates outcompeted products, evolutionary extinction (Dercole et al. 2016; Doebeli and Dieckmann 2000; Geritz et al. 1997, 1998) (see Champagnat et al. 2006; Dercole 2016; Dercole and Geritz 2016; Genieys et al. 2009 for further theoretical developments). This is the most important added value of AD to the economic literature on diversification. As extensively discussed in Dercole et al. (2008), product diversity is both a means and a result of economic development and growth in variety is crucial and not independent from growth in production (Grübler 1998; Saviotti 1996, 2001; Stirling 1998). In the AD framework, product diversity indeed emerges as a result of the feedback between innovation and competition processes.

Since its introduction, a wide range of applications have been published. Biologically oriented applications have addressed competition (Dercole et al. 2002; Doebeli and Dieckmann 2000; Johansson et al. 2010), and predator–prey interactions (Abrams 1997, 2003; Dercole et al. 2003, 2006; Dercole and Rinaldi2010; Dieckmann et al. 1995; Landi et al. 2013), food chains (Dercole and Rinaldi 2010), mutualistic (Dercole 2005; Dieckmann and Law 1996; Doebeli and Dieckmann 2000; Ferriere et al. 2002) and cannibalistic interactions (Dercole 2003; Dercole and Rinaldi 2002), evolution of dispersal (Colombo et al. 2008; Dercole et al. 2007; Parvinen 2002), and even evolution at the genetic level (Collet et al. 2013; Kisdi and Geritz 1999). In the socio-economic context, technological innovations (Dercole et al. 2008, 2010; Toro-Zapata et al. 2018) and the evolution of fashion traits (Landi and Dercole 2016) have been investigated with the tools of AD. However, to the best of our knowledge, no application have addressed an agro-industrial phenomena, such as coffee production.

Here, a stylized AD model is formulated and analyzed to describe the evolution of coffee quality. An agro-ecological model describes the growth and harvest of the coffee plantation coupled with the demography of a CBB population, the latter explicitly structured into immature and adult individuals to reflect the damage caused by their reproduction and feeding habits. A market model describes the competition of different coffee types, defined by the proportion of healthy versus bored grains used in their production. Consumer preference favoring high or low quality is considered in competition describe their budget limitations, therefore, the model indirectly considers the rol of coffee prices. The model is, e.g., useful to derive the conditions under which a special coffee invades a market dominated by standard one; and conditions under which the special coffee eventually eliminates the standard one from the market, product substitution, or the two types coexist by sharing the market. Linking this conditions to the consumers’ preference for low or hight quality coffees is a way to consider their budget limitations and the roles of coffee price in market diversification. Finally, the AD canonical equation describes the evolution of coffee quality, closing the feedback loop between the introduction of new coffee types and their competition in the market. The analysis of the model provides insights on the impact of CBB population on the evolving structure of the coffee market. The major result is that, independently of the consumers’ preference for high or low quality, a mild control of the CBB population allows the emergence of several coffee types/qualities through evolutionary branching, whereas a strong (and expensive) pest control would impoverish the market diversity and could therefore lead to an economic loss.

2 Methods

2.1 Standard-special coffee model

We consider a coffee plantation of H hectares and n trees per hectare, each tree with the average productivity ρ (kilos of mature coffee beans on a healthy, unharvested tree, on average (Arcila et al. 2007)). We do not consider seasonality, so the product k = nHρ gives us the biomass of coffee beans reached at equilibrium by the healthy, unexploited plantation (factors such as soil, climate, care, affecting production, are included in the parameter ρ, see Arcila et al. 2007). This simplification allows us to use the logistic equation to describe the growth of the healthy coffee biomass C(t) available in the plantation on a daily basis, with net growth rate r (the difference between daily production rate and loss of overripe and dry grains at low density) and carrying capacity k.

To include the effect of CBB on coffee production, we model the CBB population with two classes, according to the state of maturity of individuals. Let I(t) be the density of immatures (eggs, larvae, and pupae) and M(t) be the density of adult females in the plantation. Because adult females cause damage, by boring healthy beans to oviposit, we consider an average daily production of bored coffee given by the term βC(t)M(t). Bored coffee beans translate into a new class of unhealthy coffee, denoted by Cb(t), for which we use a loss rate d possibly higher than the one included in the net growth rate r of healthy coffee.

Assuming that coffee growers harvest coffee (healthy and bored) proportionally to the available biomass (constant harvesting effort h), we get the following two equations for the growth of coffee:

$$ \begin{array}{@{}rcl@{}} \dot C &=& rC\left( 1-\frac{C}{k}\right)-\beta C M-hC, \end{array} $$
(1a)
$$ \begin{array}{@{}rcl@{}} \dot C_{b} &=& \beta C M-(h+d)C_{b}. \end{array} $$
(1b)

At the same time, the demography of the CBB population is described by

$$ \begin{array}{@{}rcl@{}} \dot{I} &=& \epsilon \beta C M-(\delta+\omega) I, \end{array} $$
(2a)
$$ \begin{array}{@{}rcl@{}} \dot{M} &=& \omega I-\mu M, \end{array} $$
(2b)

where parameter ω is the maturation rate (1/ω is the average duration of the immature stage), 𝜖 is the CBB reproductive efficiency (the food-to-oviposition conversion rate), and δ and μ are the mortality rates (from natural causes or as a result of control strategies by the farmer) in the two classes. Equations (1a) and (2a) constitute the agro-ecological model.

Harvested coffee is used for the production of parchment coffee and subsequent commercialization. Depending on the mix of healthy and bored coffee beans, we consider parchment coffee of two different qualities, which share the market with sold quantities (kg per day, on average) denoted by N1(t) and N2(t), respectively. These will henceforth be referred to as “standard coffee” for N1, of quality q1, and as “special coffee” for N2, of quality q2. The quality q is assumed to be a continuous attribute that controls the mix of healthy and bored coffee beans. Specifically, we use the smooth sigmoid function

$$ Q(q)=\frac{q^{\alpha}}{q_{0}^{\alpha} + q^{\alpha}},\ \ \alpha>1, $$
(3)

from 0 (at q = 0) to 1 (when \(q\rightarrow \infty \)), for the fraction of the harvest of healthy coffee to be used in production, the complementary fraction 1 − Q(q) taken from the harvest of bored coffee. The resulting quality therefore depends of the quality attribute q, but also on the agro-ecological context. The threshold parameter q0 separates low quality coffee (qi < q0, so that Q(qi) < 1/2), promoting the use of bored coffee beans, from high quality coffee (qi > q0, Q(qi) > 1/2), promoting the use of healthy beans, i = 1 or 2.

Consumers’ demand is not explicitly considered in this model. However, consumers’ budget constraints are translated into the preference for high or low quality coffees. Consumers’ preference is a source of competition between the two types of coffee, that we include in the following Lotka-Volterra market competition model:

$$ \begin{array}{@{}rcl@{}} \dot{N}_{1} &=& N_{1}\left( Q(q_{1})hC + (1-Q(q_{1}))hC_{b}-f(q_{1},q_{1})N_{1}-f(q_{1},q_{2})N_{2}\right), \end{array} $$
(4a)
$$ \begin{array}{@{}rcl@{}} \dot{N}_{2} &=& N_{2}\left( Q(q_{2})hC + (1-Q(q_{2}))hC_{b}-f(q_{2},q_{1})N_{1}-f(q_{2},q_{2})N_{2}\right), \end{array} $$
(4b)

where Pi = Q(qi)hC + (1 − Q(qi))hCb is the production of coffee type i and f(qi, qj) is the competition function, measuring the loss of market share for coffee type i for each unit sold of coffee type j (f(qi, qi) = 1). In the absence of special coffee (type 2) and with a constant production Pi (at an equilibrium of the agro-ecological model (1a2a)), standard coffee (type 1) penetrates the market logistically, with initial rate (\(\dot N_{1}/N_{1}\) at low N1) assumed to be the production itself. Eventually, the sold amount reaches production (market clearing, i.e., N1 = P1), that sets a single-coffee market with quality q1.

For the competition function, we use the log-normal formulation proposed in Dercole et al. (2008) in a context of technological change:

$$ f(q_{1},q_{2})=\exp\left( {\frac{\ln^{2}f_{1}}{2{f_{2}^{2}}}}\right)\exp\left( -\frac{1}{2{f_{2}^{2}}}\ln^{2}\left( \frac{f_{1}q_{1}}{q_{2}}\right)\right). $$
(5)

See Fig. 2a for a graphical representation. Coffee qualities with low or high ratio q1/q2 are assumed to weakly compete (f tends to zero as the ratio goes to either zero or infinity), because targeted by customers with widely different budgets. On the contrary, similar coffees do compete. How competition fades as the ratio q1/q2 leaves 1 is controlled by parameter f2, that plays the role of the log-normal standard deviation. A key competition parameter is f1: it indicates the consumers’ preference for higher (f1 > 1) or lower (f1 < 1) coffee quality, depending on budget constraints. Indeed, if f1 > 1, the share loss f(q1, q2) for coffee type 1 is larger/smaller than 1 if q2 is larger/smaller than (and close to) q1, while the loss f(q2, q1) is reciprocally smaller/larger than 1 (see Fig. 2b, orange curve), which gives a competitive advantage to the larger quality. Vice-versa, f1 < 1 gives a competitive advantage to the lower quality (see Fig. 2b, blue curve), while competition is symmetric for f1 = 1.

Fig. 2
figure 2

a Competition function f(q1, q2) with f1 = 1.1 and f2 = 1. The restriction to q1 = 1 is shown by the orange curve. b Planar representation of the restriction to q1 = 1 for both f1 = 1.1 (orange) and f1 = 1/1.1 (blue). As highlighted in the zoomed inset, for f1 = 1.1 (consumers’ preference for higher coffee quality; orange curve), the share loss for coffee type 1 (with quality q1 = 1) is larger than 1 and maximum when q2 = f1 = 1.1 (f(1,1.1) = 1.0046). At this value of q2, the share loss f(q2, q1) for coffee type 2 can be read on the orange curve, because f(q2, q1) = f(1,q1/q2) (f(1,1/1.1) = 0.9865). Similarly, for f1 = 1/1.1 (consumers’ preference for lower coffee quality; blue curve), the maximal share loss for coffee type 1 (again equal to 1.0046) is realized for q2 = 1/1.1 = 0.9090, while the corresponding share loss for coffee type 2 can be read (on the blue curve) as f(1,q1/q2) = f(1,1.1) (again equal to 0.9865)

The agro-ecological and market model (1a2a4a) constitute our henceforth called “standard-special coffee model.” It is subject to non-negative initial conditions. In Table 1, we summarize the state variables and parameters, respectively indicating the initial conditions and the baseline values used in simulations.

Table 1 State variables and parameters of the agro-ecological and market models, together with initializations and baseline values respectively employed in simulations

2.2 Standard coffee model, invasion fitness, and invasion conditions

Before special coffee enters the market, standard coffee (type 1) is the only option, and the two eqs. (4aa,b) of the standard-special coffee model degenerate into the single equation

$$ \dot{N}_{1}=N_{1}\left( Q(q_{1})hC + \left( 1-Q(q_{1})\right)hC_{b}-N_{1}\right). $$
(6)

Eq. (6), jointly with the agro-ecological eqs. (1a2a) constitute our henceforth called “standard coffee model.” As already discussed in Section 2.1, the model directs the market dynamics to an equilibrium at which all the production is sold (N1 = P1). Including the variables of the agro-ecological model, and also the special coffee (type 2) with no sales (N2 = 0), we denote this equilibrium with

$$ E_{0}: \left( C, C_{b}, I, M, N_{1}, N_{2}\right)=\left( \bar{C}, \bar{C}_{b}, \bar{I}, \bar{M}, \bar{N}(q_{1}),0\right), $$
(7)

where

$$ \bar{N}(q_{1})=Q(q_{1})h\bar{C} + (1-Q(q_{1}))h\bar{C}_{b} $$
(8)

shortly denotes the “standard coffee equilibrium.” Note that E0 is also an equilibrium for the standard-special coffee model (1a2a4a).

Invasion of a small amount of special coffee (type 2), arising from an innovation when the market is at (or close to) E0 is possible only if the quality q2 of the special coffee is such that E0 is an unstable equilibrium for the standard-special coffee model. On the contrary, i.e., if E0 is a locally asymptotically stable (LAS) equilibrium of the standard-special coffee model, then the initially small sales N2 of special coffee will drop and the special coffee will exit the market soon after its introduction. The stability of E0 is determined by the sing of the so-called “invasion fitness” of the innovation (Dercole and Rinaldi 2008; Metz et al. 1992)

$$ \lambda(q_{1},q_{2})=Q(q_{2})h\bar{C}+(1-Q(q_{2})) h \bar{C}_{b}-f(q_{2}, q_{1})\bar{N}(q_{1}), $$
(9)

that is technically the eigenvalue of the system’s Jacobian at the equilibrium E0 associated with the eigenvector with nonzero N2-component. More economically, the invasion fitness is the per-unit exponential rate of penetration, in terms of initial sales (N2 nearly zero), of the special coffee quality q2, facing the established quality q1 at its equilibrium \(\bar {N}(q_{1})\). Indeed, λ(q1, q2) can be derived from Eq. (4b) as \(\dot N_{2}/N_{2}\), by setting \(N_{1}=\bar {N}(q_{1})\) and N2 = 0 in the right-hand side and by replacing C and Cb with their equilibrium values. Note that λ(q1, q1) = 0. This is economically obvious, because standard coffee is at the market equilibrium.

2.3 The AD canonical equation and branching in the quality attribute

The dynamics described by the standard-special coffee model (1a2a4a) occur in the agro-ecological, industrial, and market timescales, simply “market timescale” in the following, where time t is measured in days. The main assumption of Adaptive Dynamics (AD) is that this timescale is faster than the one on which innovations in the production process are put forward in the market. In terms of the quality attribute here considered, if new types of coffee are put on sale on average every τ days, we assume τ is relatively large. The timescale t/τ, on which the unit represents the average time between two consecutive innovations, is called the “innovation timescale.” This is the timescale on which AD describes the dynamics of the coffee quality attributes, that is indeed innovation-driven and henceforth called “innovation dynamics.”

In the scenario in which only one type of coffee is established in the market, with quality q1, and in the technical limit of rare (large τ) and small innovations, the expected innovation dynamics of the intrinsically stochastic path of q1 is described by the following differential equation

$$ \dot q_{1}=\frac{1}{2}\sigma^{2}(q_{1})\bar{N}(q_{1}) \left.\frac{\partial}{\partial q_{2}}\lambda(q_{1},q_{2})\right|_{q_{2}=q_{1}}, $$
(10)

where the dot-notation here stands for the time-derivative on the innovation timescale. Equation (10) is the AD canonical equation for the quality attribute q1 (Dercole and Rinaldi 2008; Dieckmann and Law 1996). It describes the expected dynamics of q1 resulting from a sequence of substitutions of the currently established coffee by an innovative one.

When an innovative type of coffee q2 is put on sale, the established quality q1 is at (or close to) its equilibrium \(\bar {N}(q_{1})\) (see Eq. (8)), because of the large time τ elapsed since the previous innovation. The sign of the invasion fitness λ(q1, q2) therefore determines whether the innovation invades or quickly disappears. Moreover, one of theoretical pillar of AD, the “invasion implies substitution” theorem (Dercole and Geritz 2016; Dercole and Rinaldi 2008), says that if q2 is sufficiently close to q1, invasion under a nonzero “selection gradient”

$$ s(q_{1})=\left.\frac{\partial}{\partial q_{2}}\lambda(q_{1},q_{2})\right|_{q_{2}=q_{1}}, $$
(11)

implies the substitution of the former quality by the new one. Mathematically speaking, this means that the point of substitution

$$ E_{1}: \left( C, C_{b}, I, M, N_{1}, N_{2}\right)=\left( \bar{C}, \bar{C}_{b}, \bar{I}, \bar{M}, 0, \bar{N}(q_{2})\right), $$
(12)

is also an equilibrium of the standard-special coffee model (1a2a4a) and that the trajectories originating close to E0 with low initial sales N2 of the new quality coffee q2 converge to E1. After the substitution transient, the coffee quality q1 is kicked out of the market and replaced by quality q2, that can therefore be renamed q1, i.e., the new established quality.

Note that the selection gradient determines the direction of the innovation process. Geometrically, it is the slope of the fitness landscape at (q1, q1) in the direction of the special coffee quality q2. Considering the fitness first-order expansion w.r.t. q2 at q2 = q1, i.e.,

$$ \lambda(q_{1},q_{2})=\underbrace{\lambda(q_{1},q_{1})}_{0} + s(q_{1})(q_{2}-q_{1})+\cdots, $$
(13)

one sees that under a positive selection gradient, the quality q1 is replaced by innovative products with higher quality; vice-versa, under a negative selection gradient, lower quality coffees win the competition (in both cases, it results s(q1)(q2q1) > 0 for q2 sufficiently close to q1).

Because of the timescale separation obtained for large τ, innovations can be considered one at a time and each substitution transient takes a small time on the innovation timescale. Assuming that innovations are randomly introduced into the market (at frequency 1/τ) with mean quality equal to the currently established q1 and small standard deviation σ(q1)/τ, the expected quality dynamics become smooth on the innovation timescale and ruled by the AD canonical Eq. (10) (the timescale of Eq. (10) is actually t/τ2, because of the double scaling of frequency and size of innovations by τ). The name canonical follows from the fact that, in evolutionary biology, the selection gradient appears in other evolutionary models based on fitness landscapes, such as quantitative genetics (Dieckmann and Law 1996).

The AD canonical Eq. (10) can be used as long as the quality attribute q1 is far from a stationary solution \(\bar {q}\) that nullifies the selection gradient Eq. (11), a so-called “singular strategy” in the AD jargon. Indeed, close to a singular strategy, invasion does not necessarily imply substitution. Let us restrict the attention to a stable singular strategy \(\bar {q}\), i.e., an attracting equilibrium of Eq. (10), toward which the innovation process directs the quality attribute q1. In particular, expanding the invasion fitness λ(q1, q2) up to second-order w.r.t. both (q1, q2) at \((\bar {q},\bar {q})\), one can see that λ(q1, q2) and λ(q2, q1) can both be positive close to \((\bar {q},\bar {q})\), so that both quality attributes q1 and q2 can invade a market established by the other. Without going into the details of the expansion (originally developed in Geritz et al. 1997, 1998; Metz et al. 1996 and also included in Dercole and Rinaldi 2008), this occurs under the condition

$$ \left.\frac{\partial^{2}}{\partial q_{1}\partial q_{2}}\lambda(q_{1},q_{2})\right|_{q_{1}=q_{2}=\bar{q}}<0 $$
(14)

in a region of the plane (q1, q2) that, locally to \((\bar {q},\bar {q})\), is a cone with vertex in \((\bar {q},\bar {q})\) and symmetric opening w.r.t. the anti-diagonal \((\bar {q}-q,\bar {q} +q)\) (see Fig. 4 in the Results section, panels A and B locally to point \((\bar {q}_{1},\bar {q}_{1})\), where the pairs of signs indicate the signs of λ(q1, q2) and λ(q2, q1), respectively). This is the region of “coexistence” of coffee types 1 and 2 (the (+,+) region in Fig. 4a and b), because for (q1, q2) in this region, the trajectories of the standard-special coffee model (1a2a4a) originating close to equilibria E0 and E1 converge to an internal equilibrium of coexistence, characterized by positive sales \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\) of both coffee types (Dercole and Geritz 2016).

The coexistence of two different, though very similar, types of coffee is the first step to go from a single-coffee market to a diversified one. However, to really generate two different products, the innovation process must be such that, after the coexistence is established, successive innovations move q1 and q2 in opposite directions. First of all, the invasion fitness of an innovative type \(q^{\prime }\) facing two established coffee types with qualities q1 and q2 is a function of the three arguments \((q_{1},q_{2},q^{\prime })\), that we denote by \({\Lambda }(q_{1},q_{2},q^{\prime })\). Its expression is not important here and will be derived in the next section. Let us here consider \({\Lambda }(q_{1},q_{2},q^{\prime })\) as a function of the innovative quality \(q^{\prime }\), for given q1 and q2 (let us also assume q2 > q1, though this choice is irrelevant). Taking into account that \({\Lambda }(q_{1},q_{2},q^{\prime })\) vanishes at both \(q^{\prime }=q_{1}\) and \(q^{\prime }=q_{2}\) (because of the market equilibrium), the quadratic expansion of Λ w.r.t. \(q^{\prime }\) is shaped, locally to \(\bar {q}\), as in Fig. 3. Working out the details (see again Geritz et al. 1997, 1998; Metz et al. 1996 or Dercole and Rinaldi 2008), it turns out that the discriminant between the two cases is linked to the invasion fitness in the single-coffee market (see Eq. (9)). Specifically, if

$$ \left.\frac{\partial^{2}}{\partial {q_{2}^{2}}}\lambda(\bar{q},q_{2})\right|_{q_{2}=\bar{q}}>0, $$
(15)

the quadratic approximation is an upward parabola, so that innovations in the quality q1 invade and replace the established coffee type 1 if \(q^{\prime }<q_{1}\), while the same occurs for the coffee type 2 if \(q^{\prime }>q_{2}\) (in both cases the invasion fitness \({\Lambda }(q_{1},q_{2},q^{\prime })\) is positive, see Fig. 3a). As a result, the quality attributes q1 and q2 get further diversified and the market selection is said to be “disruptive” at the singular strategy. On the contrary, if

$$ \left.\frac{\partial^{2}}{\partial {q_{2}^{2}}}\lambda(\bar{q},q_{2})\right|_{q_{2}=\bar{q}}<0, $$
(16)

the quadratic approximation is a downward parabola and only innovations that make q1 and q2 more similar do win the competition. As a result, even if the model formally allows for the coexistence of two similar coffee types, in practice, the market remains single-product. Singular strategies characterized by condition Eq. (16) are said to be locally “evolutionarily stable” (ESS), that means protected from the invasion of similar strategies. Note that evolutionarily stability is a different concept from the dynamical stability of the equilibria of the canonical Eq. (10). To underline the difference, the latter concept is often called “convergence stability” in the AD jargon.

Fig. 3
figure 3

Quadratic approximation of the invasion fitness \({\Lambda }(q_{1},q_{2},q^{\prime })\) w.r.t. the innovative quality attribute \(q^{\prime }\) for given established attributes (q1, q2)

Convergence stable singular strategies characterized by conditions (14) and (15) are called “branching points” (BP) of the innovation process (Geritz et al. 1997, 1998; Metz et al. 1996). If \(\bar {q}\) is a BP, the dynamics of the quality attribute q1 is first attracted by \(\bar {q}\), in a phase in which the market is single-product (there is only one type of established coffee that is at the market equilibrium for each value of q1), but with q1 evolving on the innovation timescale. Once close to \(\bar {q}\), a second coffee type with quality q2 gets established in the market (because of the coexistence condition (14)) and a second phase with two coexisting and evolving products begins. The disruptive condition (15) implies that the two quality attributes q1 and q2 initially diverge one from the other at the beginning of this second phase. To study the further innovation dynamics of q1 and q2, we need to derive a two-dimensional AD canonical equation, in which substitution sequences are considered for both the established coffee types. This is done in the following section.

Convergence stable singular strategies at which one or both of the conditions (14) and (15) hold with reversed inequality sign are called “terminal points” (TP) of the innovation process (Dercole and Rinaldi 2008). Indeed the innovation dynamics driven by rare and small innovations halt there. Cases with vanishing second fitness derivatives in Eqs. (14) and (15) are bordering cases between BP and TP and are technically bifurcation points (Della Rossa et al. 2015; Dercole et al. 2016).

2.4 Innovation dynamics after branching

After a branching at \(\bar {q}\), the market sets at the equilibrium

$$ E_{\mathrm{c}}: \left( C, C_{b}, I, M, N_{1}, N_{2}\right)=\left( \bar{C}, \bar{C}_{b}, \bar{I}, \bar{M}, \bar{N}_{1}(q_{1},q_{2}), \bar{N}_{2}(q_{1},q_{2})\right) $$
(17)

of the standard-special coffee model (1a2a4a). The explicit expressions for the equilibrium sales \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\) can be given in terms of the standard coffee equilibrium \(\bar {N}(q_{1})\) (see Eq. (8)) and the competition function f(qi, qj), i.e.,

$$ \bar{N}_{1}(q_{1}, q_{2}) =\frac{\bar N(q_{1}) - f(q_{1}, q_{2})\bar{N}(q_{2})}{{1}-{f}(q_{1}, q_{2})f(q_{2}, q_{1})},\quad \bar {N}_{2}(q_{1}, q_{2}) = \frac{\bar {N}(q_{2}) - f(q_{2}, q_{1})\bar {N}(q_{1})}{{1}-{f}(q_{1}, q_{2})f(q_{2}, q_{1})}. $$
(18)

Similarly to the single-coffee market, the invasion fitness \({\Lambda }(q_{1},q_{2},q^{\prime })\) of an innovative coffee type with quality attribute \(q^{\prime }\) facing the two established types 1 and 2 is its per-unit (exponential) penetration rate, in terms of initial sales \(N^{\prime }\) (\(N^{\prime }\) nearly zero), when types 1 and 2 are at the market equilibrium Ec. To derive the per-unit (exponential) rate \(\dot N^{\prime }/N^{\prime }\), we need to extend the standard-special coffee model to a three-type model, including the standard, special, and innovative types. We here only write the differential equation for the innovative type:

$$ \frac{\dot{N}^{\prime}}{N^{\prime}}=Q(q^{\prime})hC + (1-Q(q^{\prime}))hC_{b} - f(q^{\prime},q_{1})N_{1} - f(q^{\prime},q_{2})N_{2} - N^{\prime}, $$
(19)

from which it immediately follows the expression of the invasion fitness:

$$ \begin{array}{@{}rcl@{}} {\Lambda}(q_{1},q_{2},q^{\prime})&=&Q(q^{\prime})h\bar C+(1-Q(q^{\prime})) h \bar{C}_{b} \\ && - f(q^{\prime}, q_{1})\bar{N}_{1}(q_{1},q_{2}) - f(q^{\prime}, q_{2})\bar{N}_{2}(q_{1},q_{2}). \end{array} $$
(20)

Again assuming that innovations are rare events on the daily market time-scale that introduce small variations in coffee quality (i.e., quality \(q^{\prime }\) is close to either q1 or q2), the expected innovation dynamics followed by the two established qualities q1 or q2 are ruled by the following two-dimensional AD canonical equation:

$$ \dot{q_{i}}= \frac{1}{2}{\sigma_{i}^{2}}(q_{i})\bar{N}_{i}(q_{1},q_{2})\left.\frac{\partial}{\partial q^{\prime}}{\Lambda}(q_{1},q_{2},q^{\prime})\right|_{q^{\prime}=q_{i}},\quad i=1,2. $$
(21)

3 Results

3.1 The agro-ecological equilibrium

The agro-ecological model (1a2a) has only one equilibrium at which healthy and bored coffee coexist with the CBB immature and adult insects. The equilibrium densities (nullifying the right-hand sides of Eqs. (1a), (2a)) are

$$ \bar C=\frac{\mu(\delta+\omega)}{\epsilon\beta\omega}, \bar C_{b}=\frac{\mu r (\delta+\omega)}{\epsilon\beta\omega(h+d)}\frac{B_{0}-1}{B_{0}}, \bar I=\frac{\mu r}{\beta\omega}\frac{B_{0}-1}{B_{0}}, \bar M=\frac{r}{\beta}\frac{B_{0}-1}{B_{0}}, $$
(22)

where

$$ B_{0}=\frac{r/h}{1+(r/h)\frac{\mu(\delta+\omega)}{\epsilon\beta \omega k}}, $$
(23)

is the so-called basic-reproduction-number of the CBB population—the average number of secondary CBB females produced by a CBB female in a generation (Ripa and Larral 2008; Romero and Cortina Guerrero 2007; Ruiz Cárdenas and Baker 2010). Only if B0 > 1 the CBB population is able to persist. Indeed, the coexistence equilibrium Eq. (22) is stable for B0 > 1 and characterized by positive densities (stability can be easily checked by means of linearization). Otherwise, the CBB population cannot develop (or goes extinct if initially present) and system (1a2a) converges to the CBB-free equilibrium with C = (1 − h/r)k and Cb = I = M = 0. Note that the densities in Eq. (22) make no sense for B0 < 1 (\(\bar C_{b}\), \(\bar I\), and \(\bar M\) are negative for B0 < 1) and they coincide with the CBB-free equilibrium for B0 = 1 (system (1a2a) undergoes a transcritical bifurcation when B0 varies across 1, through which the coexistence equilibrium and the CBB-free one collide and exchange stability (Dercole and Rinaldi 2011)). Also note that r > h is an obvious necessary condition to have B0 > 1, i.e., the harvesting rate h cannot exceed the coffee growth rate.

Because we are interested in the CBB-related aspects of the plantation management and control, we focus in the following on the case B0 > 1 and on the equilibrium densities in Eq. (22).

Solving the condition B0 > 1 for the CBB boring and adult-mortality rates β and μ and for the harvesting rate h, gives the following thresholds:

$$ \beta>\beta_{0} \!= \frac{\mu r(\delta+\omega)}{\epsilon \omega k(r-h)}, \mu<\mu_{0} \!= \frac{\epsilon\beta\omega k (r-h)}{r(\delta+\omega)}, h<h_{0} \!= r\!\left( \!1-\frac{\mu(\delta+\omega)}{\epsilon\beta \omega k}\!\right). $$
(24)

These three parameters will be considered in the following analyses, because they allow to discuss the joint effects of coffee production and CBB control practices. For instance, the threshold h0 sets the harvesting rate that is enough, according to the model, to achieve CBB eradication.

3.2 Innovation dynamics in the single-coffee market

Substituting the agro-ecological equilibrium densities Eq. (22) in the expressions for the standard coffee equilibrium Eq. (8) and for the invasion fitness Eq. (9), the invasion fitness λ(q1, q2) can be explicitly determined. Figure 4 shows the contour plot of the invasion fitness for the reference values in Table 1 of the model parameters, distinguishing the cases of consumers’ preference for low/high coffee quality (low/high budget, \(f_{1}\lessgtr 1\), left/right column) and for different values of the CBB adult-mortality rate μ.

Fig. 4
figure 4

Contour plots of the invasion fitness λ(q1, q2) (left/right column: consumers’ preference for low/high coffee quality, \(f_{1}\lessgtr 1\); top/bottom line: different values of the CBB adult-mortality rate μ; other model parameters set as in the reference Table 1). The fitness is positive in blue-shaded regions, negative in red-shaded ones, and vanishes on the diagonal (black) and on the borders between blue and red regions (green curves). In panels A and B, the intersections of the green zero-contour line with the diagonal identify the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\), respectively stable and unstable, of the AD canonical Eq. (10). The red curve is specular w.r.t. the diagonal of the green one and is used to define the positive/negative regions of the specular fitness λ(q2, q1) (the fitness of the innovative quality q1 in the market set by q2). The pair of signs in each region respectively indicates the signs of λ(q1, q2) and λ(q2, q1). In the (+,+) region, the coffee qualities (q1, q2) coexist in the market

At points (q1, q2) where the fitness is positive (blue-shaded regions), a small amount of special coffee with quality q2 can invade a single-coffee market dominated by the standard coffee with quality q1. On the contrary, the special coffee fails to invade at points (q1, q2) where the fitness is negative (red-shaded regions). The fitness is trivially zero on the diagonal q1 = q2 (because of the market equilibrium (8)), but vanishes also along non-trivial combinations (q1, q2) at the borders between blue and red regions (green solid curves). The intersections of a non-trivial zero-contour line with the diagonal identify the singular strategies of the AD canonical Eq. (10), i.e., the equilibria of the innovation dynamics of the quality attribute q1. Indeed, at a transversal intersection (see Fig. 4a and b), the directional derivative of λ(q1, q2) is zero in any direction, including the vertical one of the selection gradient (11).

Because the AD canonical Eq. (10) is one-dimensional, the stability of the singular strategies can also be graphically determined in Fig. 4a and b. Indeed, the fitness is positive (blue) above the diagonal on the left of the singular strategy \(\bar {q}_{1}\) and below the diagonal on the right, so that small innovations with q2 > q1 win the competition for \(q_{1}<\bar {q}_{1}\), whereas the winner has q2 < q1 for \(q_{1}>\bar {q}_{1}\). This means that \(\bar {q}_{1}\) is a stable singular strategy. On the contrary, the fitness is positive below the diagonal on the left of \(\bar {q}_{1}^{(u)}\) and above the diagonal on the right, so that \(\bar {q}_{1}^{(u)}\) is unstable. The unstable equilibrium \(\bar {q}_{1}^{(u)}\) separates the initial values of the quality attribute that generate an innovation dynamics leading to the stable equilibrium \(\bar {q}_{1}\), from those begetting the runaway toward the worst or the best quality, under consumers’ preference for low/high coffee quality, respectively. Indeed, for \(q_{1}<\bar {q}_{1}^{(u)}\) in Fig. 4a, the fitness is positive below the diagonal (not well visible at the scale of the figure), so that innovations with q2 < q1 always win the competition and make q1 converge to zero. Recall that zero quality corresponds to 100% use of bored grains, see the mixing factor Q(q1) in Eq. (3), and is therefore the worst coffee quality described by the model. Vice-versa, for \(q_{1}>\bar {q}_{1}^{(u)}\) in Fig. 4b, the fitness is positive above the diagonal and the runaway of q1 is toward \(+\infty \), making Q(q1) converge to one, i.e., 100% use of healthy grains (best quality).

The two singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\) are not present in Fig. 4c and d. Under consumers’ preference for low/high coffee quality, they collide and disappear through a fold bifurcation (Dercole and Rinaldi 2011) for sufficiently low/high CBB mortality rate μ. With no singular strategy, the runaway toward worst or best quality is unavoidable. The first scenario (low budget), requires the harvest to be mainly composed of bored coffee grains, so that decreasing the quality does not reduce production (see again the role of the mixing factor Q(q1) in Eq. (3)). This condition requires a well-developed pest and is therefore realized for low CBB mortality. On the contrary, the second scenario (high budget), requires a healthy coffee harvest and, hence, a weak (or extinct) CBB population. In both scenarios, the consumers’ preference is the dominating force driving the innovation process. Interestingly, for intermediate CBB mortality, the interaction of agro-ecological, production, and consumers’ sides, determines the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\).

The graphical (and numerical) analysis of Fig. 4 is accompanied by analytical results (obtained by means of symbolic computation) reported in Appendix. Not only the explicit expression of the invasion fitness λ(q1, q2) and of the AD canonical Eq. (10) are reported, but we can also solve explicitly for the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\) and for the parameter combinations of the fold bifurcation at which they collide. Together with the expression for the CBB-basic-reproduction-number B0 (see Eq. (23)), these explicit solutions are used to plot Fig. 5, which shows how the (stable) equilibrium quality \(\bar {q}_{1}\) varies w.r.t. the three model parameters on which we mainly focus our discussion. The red curve is the transcritical bifurcation at which B0 = 1 and the black curve is the fold bifurcation involving the two singular strategies (in Eq. (A.6c), explicit expressions for the bifurcation curves are shown, defining thresholds for β, μ and h). The equilibrium quality \(\bar {q}_{1}\) is defined in the region B0 > 1 and delimited by the fold bifurcation. The two bifurcation curves establish thresholds for the persistence of the CBB and for the existence of the equilibrium quality \(\bar {q}_{1}\).

Fig. 5
figure 5

Regions of definition and values of the stable singular strategy \(\bar {q}_{1}\) (left/right column: consumers’ preference for low/high coffee quality, \(f_{1}\lessgtr 1\); other model parameters set as in the reference Table 1). The CBB-basic-reproduction-number B0 is larger than one on the left of the red curve. The black curve is the fold bifurcation between the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\)

3.3 From single-product to standard-special coffee markets

Once we have a stable singular strategy \(\bar {q}_{1}\), we can check the coexistence and disruptive conditions (14) and (15) at \(\bar {q}_{1}\), to see whether there are parameter settings for which the singular strategy is a BP. Because we have an explicit expression for \(\bar {q}_{1}\) in terms of the model parameters (see Appendix), we derived, as well, explicit expressions for the fitness second derivatives in Eqs. (14) and (15) at \(\bar {q}_{1}\) (handled by means of symbolic computation, but not reported in Appendix because excessively long). The contour plots of the obtained expressions are illustrated in Figs. 6 and 7.

Fig. 6
figure 6

Contour plot of the fitness second derivative in the coexistence condition (14) at \(\bar {q}_{1}\) (left/right column: consumers’ preference for low/high coffee quality, \(f_{1}\lessgtr 1\); other model parameters set as in the reference Table 1). As in Fig. 5, the CBB-basic-reproduction-number B0 is larger than one on the left of the red curve and the black curve is the fold bifurcation between the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\). The coexistence condition holds true (red-shaded region) in the whole region of definition and stability of the singular strategy \(\bar {q}_{1}\) (compare with Fig. 5)

Fig. 7
figure 7

Contour plot of the fitness second derivative in the divergence condition (15) at \(\bar {q}_{1}\) (left/right column: consumers’ preference for low/high coffee quality, \(f_{1}\lessgtr 1\); other model parameters set as in the reference Table 1). As in Fig. 5, the CBB-basic-reproduction-number B0 is larger than one on the left of the red curve and the black curve is the fold bifurcation between the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\). The divergence condition holds true (blue-shaded region) in the whole region of definition and stability of the singular strategy \(\bar {q}_{1}\) (compare with Fig. 5)

The major result here is that the coexistence and disruptive conditions (14) and (15) at \(\bar {q}_{1}\) are satisfied in the same regions of the model parameters in which the singular strategy is defined and stable, and this occurs in both the considered scenarios of consumers’ preference for low/high coffee quality (the result is evident in the (h,β)- and (h,μ)-planes, compare Figs. 6 and 7 with Fig. 5, but has been numerically checked for other parameter pairs). The shaded regions in Figs. 57 therefore correspond to parameter settings for which the singular strategy \(\bar {q}_{1}\) is a BP.

Results equivalent to those obtained in the (h,β)-plane were obtained (not reported) for the (h,𝜖)- and (h,ω)-planes, which indicates a close relationship between the CBB boring rate β, reproductive efficiency 𝜖, and maturation rate ω; it means that the control strategies affecting these parameters are to a certain extent substitutable. Similarly, results equivalent to those obtained in the (h,μ)-plane were obtained (not reported) in the (h,δ)-plane, which indicates as equally effective the control strategies targeting adult or immature CBB individuals.

Once branching develops at the BP \(\bar {q}_{1}\), the market gets diversified, with two established coffee types—standard and special—with qualities q1 and q2 and sold amounts \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\), respectively, representing the market equilibrium at (q1, q2) (see Eq. (18)). The quality attributes q1 and q2 are similar just after the establishment of the market share, but further innovations in the two types make them diverge in quality. The joint innovation dynamics of q1 and q2 is ruled by the two-dimensional canonical Eq. (21). In the next two subsections, we analyze the innovation dynamics before and after branching in the two considered scenarios of consumers’ preference for low/high coffee quality (low/high budget). Though mathematically irrelevant, we consider q2 < q1 in the first scenario and q2 > q1 in the second, i.e., q2 is the special coffee preferred by consumers.

3.4 Innovation dynamics under consumers’ preference for low quality

We now consider the low budget scenario in which consumers have preference for a low quality coffee (parameter f1 = 1/1.1 slightly lower than one, so that the asymmetry of the competition function Eq. (5) is in favor of the lower quality). Figure 8 shows in solid-black the numerical solution of standard coffee model (1a2a6) for two parameter setting: a reference one indicated in Table 2 for which the singular strategy \(\bar {q}_{1}\) is a BP and a perturbed one in which the CBB adult-mortality rate μ is decreased (from 0.6 to 0.3) to cross the fold bifurcation between the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\) (other parameters set as in the reference Table 1). The reduction of the CBB mortality illustrates the effect of a weaker pest control policy and is here considered to analyze the effect of the singular strategies disappearance on the dynamics after branching.

Fig. 8
figure 8

Agro-ecological and market dynamics under consumers’ preference for low quality (parameter f1 = 1/1.1). Two parameter setting are considered: a reference one indicated in Table 2 for which the singular strategy \(\bar {q}_{1}\) is a BP and a perturbed one in which the CBB adult-mortality rate μ is decreased (from 0.6 to 0.3) to cross the fold bifurcation between the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\) (the black curve in Figs. 57, panel C; other parameters set as in the reference Table 1). Lines 1 and 2: agro-ecological dynamics. Line 3, left-to-right: market penetration of a single coffee type (simulation of the standard coffee model (1a2a6) with q1 = 30 and N1(0) = 0.1); standard-special product substitution (green; simulation of the standard-special coffee model (1a2a4a) with q1 = 30, q2 = 0.97q1 = 29.1 (3% innovation toward lower quality) and \(N_{1}(0)=\bar {N}(q_{1})\), N2(0) = 0.1); standard-special product coexistence for the reference parameter setting (red; simulation of the standard-special coffee model (1a2a4a) with \(q_{1}=\bar {q}_{1}=24.81\), q2 = 0.97q1 = 24.07 and \(N_{1}(0)=\bar {N}(q_{1})\) and N2(0) = 0.1); standard-special product coexistence for the perturbed parameter setting (blue; simulation of the standard-special coffee model (1a2a4a) with \(q_{1}=\bar {q}_{1}^{(2)}=286.84\), \(q_{2}=\bar {q}_{2}^{(2)}=20.42\) and \(N_{1}(0)=\bar {N}_{1}(\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})=182.2967\) and N2(0) = 174.2238)

Table 2 Results summary of the simulations shown in Figs. 8 and 9. The thresholds βf, μf and hf are explicit in eqs. (A.6c)

The first 8 panels (first and second lines) show the daily-dynamics of the agro-ecological variables (for both the considered parameter settings), converging to the equilibrium Eq. (22) (for the numerical values, see Table 2). Panel 9 (first from left in third line) show the market penetration to the equilibrium \(\bar {N}(q_{1})\) of a single (standard) high-quality coffee (q1 = 30; initial low sales N1(0) = 0.1) in the reference case (μ = 0.6).

As long as the standard coffee dominates the market, the innovation dynamics of its quality attribute q1 is shown in solid-blak in Fig. 9a (panel b shows the evolution of the corresponding market equilibrium \(\bar {N}(q_{1})\)). It is the numerical solution of the one-dimensional AD canonical Eq. (10), decreasing from q1(0) = 30 because of the consumers’ preference for low quality and converging to the stable equilibrium \(\bar {q}_{1}\) in a few units of innovation time (recall the discussion of the timescales separation in Section 2.3, see Table 2 for the numerical values). Each little step of the quality attribute q1 is the result of a small innovation that replaces the previously established coffee type on the market timescale. Here winning innovations have lower quality (i.e., a higher proportion of bored coffee grains in production). Figure 8’s panel 10 shows the first product substitution that occurs at the initial value q1 = 30, obtained by simulating the standard-special coffee model (1a2a4a) for q2 slightly lower than q1 (3% innovation, q2 = 0.97q1), equilibrium initial sales for q1 (\(N_{1}(0)=\bar {N}(q_{1})\)), and low initial sales for q2 (N2(0) = 0.1).

Fig. 9
figure 9

Innovation dynamics under consumers’ preference for low quality (parameter settings as in Fig. 8). a Simulation of the one-dimensional canonical Eq. (10) for the reference parameter setting, starting from q1 = 30 (solid-blak); simulation of the two-dimensional canonical Eq. (21) for the reference parameter setting, starting from \(q_{1}=\bar {q}_{1}=24.81\) and q2 = 0.97q1 = 24.07 (solid and dashed red, respectively); simulation of the two-dimensional canonical Eq. (21) for the perturbed parameter setting, starting from \(q_{1}=\bar {q}_{1}^{(2)}=286.84\) and \(q_{2}=\bar {q}_{2}^{(2)}=20.42\) (solid and dashed blue, respectively). b Market equilibrium sales \(\bar {N}(q_{1})\) (solid-black) and \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\) (red and blue, solid and dashed, respectively) tracked along the innovation dynamics in (a)

Because \(\bar {q}_{1}\) is a BP (in the reference case), a small innovation q2 at q1 close to \(\bar {q}_{1}\) invades but does not replace the coffee type q1. This is shown in Fig. 8’s panel 11, again by simulating the standard-special coffee model (1a2a4a), where the sales of the two coexisting coffee types converge to the values \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\) of the coexistence equilibrium (18). Once the two-product market is established, with quality attributes q1 and q2 as in Fig. 8’s panel 11 and sales \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\), the innovation dynamics of the two-product market can be simulated with the two-dimensional AD canonical Eq. (21). The result is plotted in red in Fig. 9a (innovation time from 20 to 200; panel b shows the evolution of the corresponding market equilibrium sales \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\)) and shows that the joint innovation dynamics of q1 and q2 converge to a stable two-dimensional singular strategy (i.e., a stable equilibrium of the canonical Eq. (21); see Table 2 for the numerical values), that we name \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\).

We tested whether the singular strategy \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\) is a BP with respect to either q1 or q2. This is done by checking the second derivatives of the invasion fitness \({\Lambda }(q_{1},q_{2},q^{\prime })\) of the innovative quality \(q^{\prime }\) in the market set by (q1, q2) (see Eq. (20)) at \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\). Similarly to what done for the one-dimensional case, branching occurs in type i = 1 or 2, at the two-dimensional singular strategy \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\), if the mixed second-derivative (w.r.t. qi and \(q^{\prime }\) at \(q_{i}=q^{\prime }=\bar {q}_{i}^{(2)}\)) is negative (coexistence condition) and the pure second-derivative (twice w.r.t. \(q^{\prime }\) at \(q^{\prime }=\bar {q}_{i}^{(2)}\)) is positive (divergence condition). It turned out that the singular strategy is BP with respect to both q1 and q2, with fitness second derivatives that are however by-two-orders-of-magnitude stronger for the special type 2, i.e., the lower quality type preferred by consumers. Though technically branching can develop in both coffee types, it is much more likely to occur in the special type, since the establishment of the market coexistence and the further, innovation-driven, quality divergence is much faster than in the standard type (recall that the fitness is an exponential rate of market penetration).

Instead of analyzing the further diversification of the coffee market, as anticipated, we imagine that once the market is close to the two-dimensional singular strategy \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\), the CBB control policy is changed for a weaker one (CBB adult-mortality rate μ from 0.6 to 0.3). For the new parameter setting, \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\) is not anymore a singular strategy and the sales \(\bar {N}_{1}(\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})=182.2967\) and \(\bar {N}_{2}(\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})=174.2238\) obtained before the parameter perturbation (see Table 2), are not anymore of equilibrium for the standard-special coffee model (1a2a4a). Hence, the parameter perturbation first begets a market transient (shown in Fig. 8’s panel 12), during which the sales N1 and N2 converge to the new equilibrium \(\bar {N}_{1}(\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\) and \(\bar {N}_{2}(\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\) (given by Eq. (18) for the new parameter setting), then a new phase of innovation dynamics (blue in Fig. 9; innovation time from 200 to 350). Note that the whole transient appears as instantaneous on the innovation time axis in Fig. 9b (from the final values of \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\) in the red phase to their initial values in the blue phase).

Note that, after the parameter perturbation, the model has no one-dimensional singular strategies. Indeed, the point (h,μ) = (0.2,0.3) lies below the shaded region in panel C of Figs. 57. As we discussed in Section 3.2, in this situation the consumers’ preference dominate the innovation process in the single-product market and leads to a runaway to zero quality. Interestingly, this occurs also in the two-product market. While the two coffee types apparently share the market with similar sales (see the blue phase in Fig. 9b), both quality attributes q1 and q2 drop to zero. Hence, in the long-term, only one type of coffee with zero quality (100% made from bored grains) remains in the market. Mathematically speaking, there is likely to be a fold scenario in the two-dimensional canonical Eq. (21) as well, similar to the one found in the one-dimensional equation (10), i.e., the singular strategy \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\) present for μ = 0.6 seems not to be present for μ = 0.3. The detailed bifurcation analysis of the two-dimensional canonical equation is however outside the scope of the present paper. The conclusion is that a weak CBB control policy operates against market diversification, even if branching first develops under a stronger policy.

3.5 Innovation dynamics under consumers’ preference for high-quality

We now consider the high budget scenario, in which consumers have preference for a high quality coffee (parameter f1 = 1.1 slightly higher than one, so that the asymmetry of the competition function Eq. (5) is in favor of the higher quality). Analogously to what done in the previous section for the low-budget case, we analyze the agro-ecological, market, and innovation dynamics for two parameter setting: the reference one indicated in Table 3 for which the singular strategy \(\bar {q}_{1}\) is a BP and the perturbed one in which the CBB adult-mortality rate μ is increased (from 0.2 to 0.5) to cross the fold bifurcation between the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\) (other parameters set as in the reference Table 1). The increase of the CBB mortality illustrates the effect of a stronger pest control policy and is here considered to analyze the effect of the singular strategies disappearance on the dynamics after branching.

Table 3 Results summary of the simulations shown in Figs. 10 and 11. The thresholds βf, μf and hf are explicit in eqs. (A.6c)

Figures 10 and 11 present the agro-ecological and market dynamics and the innovation dynamics, respectively, similarly to what done in Figs. 8 and 9 for the low-budget case. Starting with a single low-quality coffee type (q1 = 1), the innovation dynamics (numerical solution of the one-dimensional AD canonical Eq. (10)) pushes up the quality attribute q1, driven by the consumers’ preference for high quality, up to convergence to the stable equilibrium \(\bar {q}_{1}\) (solid-blak in Fig. 11a; panel b shows the evolution of the corresponding market equilibrium \(\bar {N}(q_{1})\)). Here, winning innovations have higher quality (i.e., a higher proportion of healthy coffee grains in production). Figure 10’s panel 10 shows the first product substitution that occurs at the initial value q1 = 1, obtained by simulating the standard-special coffee model (1a2a4a) for q2 slightly higher than q1 (3% innovation, q2 = 1.03q1), equilibrium initial sales for q1 (\(N_{1}(0)=\bar {N}(q_{1})\)), and low initial sales for q2 (N2(0) = 0.1).

Fig. 10
figure 10

Agro-ecological and market dynamics under consumers’ preference for high quality (parameter f1 = 1.1). Two parameter setting are considered: a reference one indicated in Table 3 for which the singular strategy \(\bar {q}_{1}\) is a BP and a perturbed one in which the CBB adult-mortality rate μ is increased (from 0.2 to 0.5) to cross the fold bifurcation between the singular strategies \(\bar {q}_{1}\) and \(\bar {q}_{1}^{(u)}\) (the black curve in Figs. 57, panel d; other parameters set as in the reference Table 1). Lines 1 and 2: agro-ecological dynamics. Line 3, left-to-right: market penetration of a single coffee type (simulation of the standard coffee model (1a2a6) with q1 = 1 and N1(0) = 0.1); standard-special product substitution (green; simulation of the standard-special coffee model (1a2a4a) with q1 = 1, q2 = 1.03q1 = 1.03 (3% innovation toward higher quality) and \(N_{1}(0)=\bar {N}(q_{1})\), N2(0) = 0.1); standard-special product coexistence for the reference parameter setting (red; simulation of the standard-special coffee model (1a2a4a) with \(q_{1}=\bar {q}_{1}=4.88\), q2 = 1.03q1 = 5.04 and \(N_{1}(0)=\bar {N}(q_{1})\) and N2(0) = 0.1); standard-special product coexistence for the perturbed parameter setting (blue; simulation of the standard-special coffee model (1a2a4a) with \(q_{1}=\bar {q}_{1}^{(2)}=0.44\), \(q_{2}=\bar {q}_{2}^{(2)}=6.13\) and \(N_{1}(0)=\bar {N}_{1}(\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})=90.4880\) and N2(0) = 85.9428)

Fig. 11
figure 11

Innovation dynamics under consumers’ preference for high quality (parameter settings as in Fig. (10)). a Simulation of the one-dimensional canonical Eq. (10) for the reference parameter setting, starting from q1 = 1 (solid-blak); simulation of the two-dimensional canonical Eq. (21) for the reference parameter setting, starting from \(q_{1}=\bar {q}_{1}=4.88\) and q2 = 1.03q1 = 5.04 (solid and dashed red, respectively); simulation of the two-dimensional canonical Eq. (21) for the perturbed parameter setting, starting from \(q_{1}=\bar {q}_{1}^{(2)}=0.44\) and \(q_{2}=\bar {q}_{2}^{(2)}=6.13\) (solid and dashed blue, respectively). b Market equilibrium sales \(\bar {N}(q_{1})\) (solid-black) and \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\) (red and blue, solid and dashed, respectively) tracked along the innovation dynamics in (a)

Because \(\bar {q}_{1}\) is a BP (in the reference case), a two-product market is established by a small innovation q2 when q1 is close to \(\bar {q}_{1}\) (Fig. 10’s panel 11), and the further innovation dynamics is simulated with the two-dimensional AD canonical Eq. (21) (in red in Fig. 11a; panel b shows the evolution of the corresponding market equilibrium sales \(\bar {N}_{1}(q_{1},q_{2})\) and \(\bar {N}_{2}(q_{1},q_{2})\)). The joint innovation dynamics of q1 and q2 converge to a stable two-dimensional singular strategy \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\) (see Table 3 for the numerical values), which turned out to be a BP with respect to both q1 and q2. As in the case of low-quality consumers’ preference, the second derivatives of the invasion fitness Λ(q1, q2, q) at \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\) are by-two-orders-of-magnitude stronger for the lower quality type, though this time it is the standard type 1 (the one disfavored by consumers). This is perhaps due to a saturating effect of the mixing factor Q(q1) (the fraction of the harvest of healthy coffee to be used in production, see Eq. 3), for large q1, that flattens the fitness derivatives.

Imagining now to change to a stronger CBB control policy (CBB adult-mortality rate μ from 0.2 to 0.5) when the market is close to the singular strategy \((\bar {q}_{1}^{(2)},\bar {q}_{2}^{(2)})\), the induced transients in the market and innovation dynamics are shown in blue in Figs. 10’s panel 12 and Fig. 11, respectively. Similarly to what we found for the low-budget case, after the parameter perturbation the model has no one-dimensional singular strategies (point (h,μ) = (0.2,0.5) lies above the shaded region in panel D of Figs. 57), and the runaway to top quality occurs also in the two-product market. While the two coffee types apparently share the market with rather similar sales (see the blue phase in Fig. 11b), both quality attributes q1 and q2 diverge to infinity (checked numerically but not shown in the time-range of Fig. 11a). Hence, in the long-term, only one type of coffee with top quality (100% made from healthy grains) remains in the market.

4 Discussion and conclusions

A mathematical model (deterministic and finite-dimensional) has been presented and analyzed to describe the effect of a pest and its control policies on the agro-ecological, industrial, and economic dynamics of coffee. Specific reference is made to the Coffee Berry Borer (CBB), the main pest that affects coffee crops worldwide, causing major economic losses and diminishing beverage quality. Adult and immature stages of the pest populations are considered, to be able to selectively evaluate control policies targeting one or both stages. Harvested coffee is categorized by means of a quantitative quality attribute, related to the mix of healthy and bored coffee used in production of parchment coffee. Quality is considered to be a differentiating attribute between competing coffee types. Specifically, a parameter shaping the (Lotka-Volterra) competition function in the market compartment of the model, tunes the consumers’ preference toward low or high quality. This is also an indirect way to consider budget limitations and the role of coffee price.

The evolution of the quality attributes of the coffee types present in the market is modeled with the so-called canonical equation of Adaptive Dynamics (AD) (Dercole and Rinaldi 2008; Dieckmann and Law 1996; Geritz et al. 1997, 1998; Metz et al. 1996), a differential equation that (deterministically) describes the expected path resulting from small random innovations, introducing new coffee types similar to established ones, and market competition selecting the new set of established products. The AD framework has been developed in evolutionary biology, but then applied to economics and to innovation-competition processes in general (Dercole et al. 2008; Dercole et al. 2010; Landi and Dercole 2016; Toro-Zapata et al. 2018), due to the strong analogies with mutation-selection evolutionary processes. Interestingly, AD allows to derive conditions for the loss of outcompeted products, as well as for the emergence new of ones, i.e., innovations that coexist with the established types and that are subject to opposite market selection forces with respect to the similar type that sprouted the innovation. The special points in the space of quality attributes at which such disruptive selection forces act are the branching points (BP) of AD.

The analysis highlighted a complex interaction between pest control policies and the innovation-driven evolution of the coffee market structure. We found some rather trivial (and standard) results, which essentially validate our model. For example, the harvesting rate of the plantation must be lower than the natural growth rate of an unexploited plantation, in order to make the coffee industry sustainable; the pest basic-reproduction-number (Ripa and Larral 2008; Romero and Cortina Guerrero 2007; Ruiz Cárdenas and Baker 2010), of which we have an explicit expression in terms of the model parameters, must be larger than one to allow the pest persistence; increasing the harvesting and/or the pest mortality, as well as reducing the pest boring rate and/or reproductive efficiency, we can eventually eliminate the pest, though the threshold values of such parameters granting pest-extinction are likely to be unrealizable by any realistic control policy. Still, these thresholds set theoretical limits that can be extremely useful to farmers and policy-makers to set-up feasible control policies. Especially because each threshold depends on the value of the other parameters and, thanks to the simplifying assumptions behind our model, we have derived explicit mathematical expressions and we have used them to plot control charts (see Figs. 57, where the red curve represents the threshold combinations of the two parameters on the axes). For each given parameter setting, the control charts can be used to see which dynamics scenario is predicted by the model. On the other hand, by selecting a desired scenario, the charts can be used to set the parameter values to be targeted by the control policy.

Definitely non-trivial is the relation between the pest-control policy and the evolution of the market structure. For a given parameter setting, the sign of the invasion fitness of an innovation, for which, again, we have an explicit expression in terms of the model parameters, predicts, a priori, whether a certain coffee quality is able to invade the current market conditions or not. Close to a so-called singular strategy, where the fitness linearization cannot tell whether a higher or a lower quality does invade, is where branching can develop and make the market diversified. We have specifically analyzed the branching from a single-coffee market into a two-product market, in which a standard quality q1 coexists and co-evolve with a special quality q2 (lower/higher than q1 under consumers’ preference for low/high coffee quality, respectively). We have derived explicit conditions, based on the fitness second derivatives, for coexistence and disruptive selection to occur (illustrated in the control charts of Figs. 6 and 7), and it turned out that the parameter settings for which the stable singular strategy \(\bar {q}_{1}\) exists are the same for which it is a BP.

At the stable singular strategy, two opposite selection forces balance: the one exerted in production by the availabilities of healthy and bored coffee grains and the one exerted by consumers. When such an equilibrium quality does not exists, the innovation process is dominated by the consumers’ preference and the quality consistently runaways toward zero (worst quality: 100% use of bored grains) or infinity (top quality: 100% use of healthy grains). But even when the stable singular strategy \(\bar {q}_{1}\) is present, the runaway is possible if the initial quality of the single-coffee in the market is lower/higher than a threshold set by an unstable singular strategy \(\bar {q}_{1}^{(u)}\). The transition between the two scenarios, with and without singular strategies in the single-coffee market, is a so-called fold bifurcation in the space of the model parameters, a typical phenomenon of nonlinear systems that we could fully characterize (the black curve in Figs. 57).

When branching develops at the singular strategy \(\bar {q}_{1}\), the quality attributes q1 and q2 of the emerging standard and special coffee types initially diverge from \(\bar {q}_{1}\) in opposite direction (disruptive selection), the special quality q2 in the direction dictated by the consumers’ preference, but later the joint innovation process stabilizes at a two dimensional singular strategy. Interestingly, the fold phenomenon making the quality runaway unavoidable in the single-coffee market, seem to work as well in the two-product market (though the phenomenon has been only observed in numerical simulations of the two-product market).

The main insight emerging from our study is that a strong pest control, blindly aimed at pest eradication, might be a counterproductive and costly practice. Under consumers’ preference for low quality, a strong pest control (low CBB boring rate β and high adult-mortality rate μ) brings the CBB toward extinction (toward the red curve in Figs. 57, panels a,c), making bored coffee unavailable in production, contrary to the consumers’ preference. Under consumers’ preference for high quality, a strong pest control would cause the market runaway to top quality (triggered when crossing the black curve in Figs. 57, panels b,d) even before reaching the levels necessary to pest extinction. In both cases, the market would lose its diversity, hence preventing the sustainable development of small producers, who typically depend on the product and that sell it in small coffee shops and specialized chains. Especially in the case of the Colombian market, this reflects the importance of adequately defining the requirements demanded by the certifying agencies in terms of agricultural production standards. The fact that producers can achieve different degrees of quality depends on the coffee growers and the person responsible for quality control. Besides the economic value, promoting market diversification has hence a social value as well, as it provides benefits in the development and productivity of small farms, thus ultimately improving the wealth of thousands of local families. Note that market diversity can be lost also in the case of a weak pest control (high CBB boring rate β and low adult-mortality rate μ) under consumers’ preference for low quality, because of the runaway to zero quality (triggered when crossing the black curve in Figs. 57, panels a,c).

In conclusion, intermediate (mildly strong) control policies are suggested by our study, as those that keep the pest population at levels that allow coffees of different qualities to be produced, so to meet the consumers’ preference. These policies are well realizable through biological control by parasitoids and predators. In the case of the CBB, the most effective parasitoids are wasps, Cephalonomia stephanoderis and Prorops nasuta, but also Phymastichus coffea and Cephalonomia hyalinipennis (Jaramillo et al. 2009; Rodríguez et al. 2017). Predators are coleoptera, Leptophloeus and Cathartus quadricollis (Follett et al. 2016), lizards of the Anolis genus (Monagan et al. 2017), and ants that, depending on the species, can consume CBB in either adult or immature stages (Morris and Perfecto 2016). An additional type of biological control is the use of entomopathogens, in particular Beauveria bassiana, a fungus capable to attain high mortality rates but with a slow infection process, allowing the adult CBB to live long enough to bore into coffee beans (Infante 2018). Stronger policies can be implemented with chemical control, using a variety of insecticides used to kill adult insects (affecting both the boring rate or mortality), which however demonstrated ineffective on immature stages (Pardey 2006). Another interesting way to implement chemical-free mild control is through selective harvesting. As mentioned in the Introduction, CBB control through harvesting is a form of cultural control, defined by the National Federation of Coffee Growers of Colombia (FNC) as Re-Re (Recoger and Repasar, in Spanish), that refers to collecting ripe and overripe grains from the coffee plantation and a few days later checking and collecting again to prevent adult CBB insects from finding refuge (Alarcón et al. 2017; Pardey 2006). Institutions supporting coffee production in Colombia, such as the FNC, recommend a combination of the three strategies—biological, chemical, and cultural—known as the Integrated CBB Control (Constantino et al. 2017; Pardey 2006). In the light of the present study, mildly strong control policies could avoid chemical methods.

Our model is intentionally oversimplified. The pricing of coffee is not modeled and only indirectly taken into account; and we consider the proportion of healthy and bored coffee used in production to be the only differentiating factor in coffee quality. Nonetheless, the model is first validated by the fact that it produces a series of intuitive results that are confirmed in the field; second, the analysis highlights a complex interdependence between factors and process that pertains to the agro-ecological, industrial, and demand sides, and that operate on different timescales. Further studies could be performed to consider alternate forms of quality differentiation, such as the introduction of innovative agro-industrial processes that affect coffee washing, drying, roasting, or other crucial processes in coffee production, transformation, or commercialization. As well, specific pest control policies that integrate biological and cultural practices could be modeled more in detail.

These more quantitative studies would however require detailed data on the agro-industrial processes behind each coffee type and on standard quality indicators. Although the FNC periodically publishes statistical information on coffee production and marketing, this is limited to green coffee and some with industrial treatment such as decaffeinated green, roasted in beans, roasted and ground, and extract and soluble. These statistics do not include specialty coffees in any of their main denominations (origin, preparation, sustainability, etc.), so that, in the current situation, it is not possible to compare quantitative models with real data from the Colombian coffee market. And the situation is similar, to the best of our knowledge, for other coffee markets worldwide. Our final recommendation is to set up a system to systematically collect and disseminate accurate information on the production, processing, and sale of specialty coffees. This is extremely important in Colombia, considering that specialty coffees are the main source of income for most of small producers, who could reach a better income and welfare by seeing their high-quality products valued by consumers.