This notebook presents the analysis of the four models proposed in the manuscript. The models begin with the same essential structure: energy from the environment is assimilated at a rate Q into a “bin”of energy E. This energy bin is the ultimate source of energy for all metabolic processes, including immune system proliferation and pathogen replica- tion.Themodelsdifferinstructure“downstream”oftheE-bin.Weproposefourmodels: 1) Energy from the E-bin is allocated to two downstream energy bins, EIand EN , that serve as the energy sources for the immune system and pathogens, respectively. We call this model the independent energy model because the immunesystemandpathogenshaveseparateresourcesthatdo notinteractinanyway. 2) Energy from the E-bin is allocated to a downstream EI-bin used by the immune system, but the pathogen uses energy directly from the E-bin. We call this model the pathogen priority model because the pathogen is able to supercedeimmuneallocation. 3) Energy from the E-bin is allocated to a downstream EN-bin used by pathogens, but the immune system uses energy directlyfromtheE-bin.Wecallthismodeltheimmuneprioritymodel,asitistheoppositeofpathogenprioritymodel. 4) Immune proliferation and pathogen replication both require energy from the E-bin. We call this model the energy antagonismmodelbecausetheimmunesystemandpathogensarecompetingforthesameresource. Below we analyze each model, focusing on how equilibrium pathogen load and number of immune cells change with increasingtheenergyassimilationrateQ. Independentenergymodel In the independent energy model, the E-bin is used to fuel non-epidemiological processes at a per-capita rate r and flows to two downstream energy bins, EIand EN , used by the immune system and pathogen, respectively, at rates rI and rN . The host is assumed to use the energy in the EN-bin for its own metabolic purposes at a per-capita rate a. All otherepidemiologicalprocessesoccurasintheenergyantagonismmodel,withEI andEN binsreplacingtheEbin. dEdt = Q - r E - rI E - rN E; dEIdt = rI E - aB EI - aI fI EI I N; dENdt = rN E - a EN - fN EN N; dIdt = aB EI + aI fi EI I N eI - m I; dNdt = fN EN N eN - fI I N - d N; It is easier for the analysis to use a nondimensionalized version of this model. Nondimensionalize by letting t=rt, e = aI E eN , ei = aI EI eN , en = aI EN eN , i = aI eI I eN , and n = aI N and q = aI Q r eN , ri = rI r, rn = rN r, ai = aB r, an = a r, f= fI eN aI r eI , s= fN aI r , m=m r,andd=d r. dedt = q - e - ri e - rn e; deidt = ri e - ai ei - f ei i n; didt = ai ei + f ei i n - m i; dendt = rn e - an en - s en n; dndt = s en n - f i n - d n; Theequilibriaofthissystemare: PrintedbyMathematicaforStudentsequils = Solve@8dedt 0, deidt 0, didt 0, dendt 0, dndt 0<, 8e, ei, i, en, n, :e fi q 1 + ri + rn , ei fi q ri ai H1 + ri + rnL , i fi q ri m H1 + ri + rnL , en fi q rn an H1 + ri + rnL , n fi 0>> We will again analyze the response of the equilibrium immune abundance i and pathogen load n to changes in energy assimilation q (that is, i’(q) and n’(q)). It is actually quite straightforward to show that both equilibrium immune abundanceandequilibriumpathogenloadarestrictlyincreasingfunctionsofq. iequil = equilsP1, 3, 2T; nequil = equilsP1, 5, 2T; D@iequil, qD Simplify@D@nequil, qDD ri m H1 + ri + rnL d m2 rn H1 + ri + rnL Hd m H1 + ri + rnL + q ri fL2 Pathogenprioritymodel In the pathogen priority model, the E-bin fuels non-epidemiological processes at a per-capita rate r. Energy flows to a downstream bin EI at a per-capita rate rI. Energy in the EI-bin is used by the immune system to fuel immune prolifera- tion. The pathogen steals energy directly from the E-bin. All other epidemiological processes occur as in the energy antagonismmodel,withEI replacingEintheimmuneequations. dEdt = Q - r E - rI E - fN E N; dEIdt = rI E - aB EI - aI fI EI I N; dIdt = aB EI + aI fI EI I N eI - m I; dNdt = fN E N eN - fI I N - d N; It is easier for the analysis to use a nondimensionalized version of this model. Nondimensionalize by letting t=rt, e = aI E eN , ei = aI EI eN , i = aI eI I eN , and n = aI N and q = aI Q r eN , ri = rI r, ai = aB r, f = fI eN aI r eI , s = fN aI r , m = m r, and d =d r. 2 Analysis_of_four_model_variants.nb PrintedbyMathematicaforStudentsIt is easier for the analysis to use a nondimensionalized version of this model. Nondimensionalize by letting t=rt, e = aI E eN , ei = aI EI eN , i = aI eI I eN , and n = aI N and q = aI Q r eN , ri = rI r, ai = aB r, f = fI eN aI r eI , s = fN aI r , m = m r, and d =d r. dedt = q - e - ri e - s e n; deidt = ri e - ai ei - f ei i n; didt = ai ei + f ei i n - m i; dndt = s e n - f i n - d n; Theequilibriaofthissystemare: equils = Solve@8dedt 0, deidt 0, didt 0, dndt 0<, 8e, ei, i, n, :e fi q 1 + ri , ei fi q ri ai H1 + riL , i fi q ri m H1 + riL , n fi 0>> Thesignsofi’(q)andn’(q)aregivenby thederivatives: iequil = equilsP1, 3, 2T; nequil = equilsP1, 4, 2T; D@iequil, qD D@nequil, qD 0 m s - ri f d m s Clearly, equilibrium immune abundance i is independent of q. This can be seen by writing the immune equilibrium intermsofeonly,andnotingthattheequilibriumeisindependentofq. Solve@dndt 0, iD ::i fi -d + e s f >> To determine whether the pathogen load increases or decreases, we need to know the sign of m s - ri f. The pathogen can only successfully colonize the host when the pathogen-free equilibrium is unstable, that is, when -d + q s 1+ri - q ri f m H1+riL > 0. Eigenvalues@88D@dedt, eD, D@dedt, eiD, D@dedt, iD, D@dedt, nD<, 8D@deidt, eD, D@deidt, eiD, D@deidt, iD, D@deidt, nD<, 8D@didt, eD, D@didt, eiD, D@didt, iD, D@didt, nD<, 8D@dndt, eD, D@dndt, eiD, D@dndt, iD, D@dndt, nD<< . equilsP2TD :-ai, -m, -1 - ri, -d + q s 1 + ri - q ri f m H1 + riL > But this condition implies that q s 1+ri - q ri f m H1+riL > 0 sm - ri f > 0. Thus we know that equilibrium pathogen load n is a strictly increasing function of q. This makes sense: pathogen energy theft preempts energy allocation to the immune bin, so increasing energy assimilation only benefits the pathogen - the extra energy is essentially completed usedup by thepathogen. Analysis_of_four_model_variants.nb 3 PrintedbyMathematicaforStudentsImmuneprioritymodel In the immune priority model, the E-bin fuels non-epidemiological processes at a per-capita rate r. Energy flows to a downstream bin EN at a per-capita rate rN . Energy in the EN-bin is used by the host at a per-capita rate a and is stolen by the pathogen at the per-pathogen rate fN . Immune proliferation is fuelled with energy from the E-bin. All other epidemiologicalprocessesoccurasintheenergyantagonismmodel,withEN replacingEinthepathogenequations. dEdt = Q - r E - aB E - aI fI E I N - rN E; dENdt = rN E - a EN - fN EN N; dIdt = aB E + aI fI E I N eI - m I; dNdt = fN EN N eN - fI I N - d N; Solve@dENdt 0, ND ::N fi -a EN + rn E EN fn >> Solve@dENdt 0, END ::EN fi rn E a + fn N >> Solve@dEdt 0, ID ::I fi -ab E - r E - rn E + Q ai fi E N >> It is easier for the analysis to use a nondimensionalized version of this model. Nondimensionalize by letting t=rt, e = aI E eN , ei = aI EI eN , en = aI EN eN , i = aI eI I eN , and n = aI N and q = aI Q r eN , ri = rI r, rn = rN r, ai = aB r, an = a r, f = fI eN aI r eI , s = fN aI r , m = m r, and d = d r. We make the implicit dependence of the state variables on q explicithere. dedt = q - e@qD - rn e@qD - ai e@qD - f e@qD i@qD n@qD; dendt = rn e@qD - an en@qD - s en@qD n@qD; didt = ai e@qD + f e@qD i@qD n@qD - m i@qD; percapdndt = s en@qD - f i@qD - d; Solve@didt 0, n@qDD ::n@qD fi -ai e@qD + m i@qD f e@qD i@qD >> We then set each equation equal to zero and implicitly differentiate to get implicit equation for the derivatives of the statevariablesasafunctionofenergyassimilationq. ImplicitDerivs = FullSimplify@ Solve@Simplify@D@8dedt 0, dendt 0, didt 0, percapdndt 0<, qDD, 8e¢@qD, en¢@qD, i¢@qD, n¢@qD 0, wewillhaveproventhatthederivativeispositive. H-e n H1 + rnL f + m H1 + ai + rn + i n fLL H1 + rnL Hm - f e nL + ai m + i n m f Simplify True We can prove this inequality by noting that, at equilibrium, ai e + f e i n = m i (from solving di/dt=0). This implies that m i > f e i n m - f e n > 0. So we have shown that the equilibrium immune abundance is a strictly increasing functionofenergyassimilationq. Determiningtheresponseofpathogenloadtochangesinq Turning our attention to n’(q), we begin by noting the the denominator of n’(q) is identical to the denominator of i’(q). Since we have already shown that the denominator of i’(q) was positive, we can focus our attention on the numerator only. nprime = ImplicitDerivsP1, 4, 2T . 8e@qD fi e, i@qD fi i, n@qD fi n, en@qD fi en<; Denominator@iprimeD == Denominator@nprimeD Expand@Numerator@nprimeDD True m rn s - ai an f - n ai s f - e n rn s f - i n an f2 - i n2 s f2 The numerator has a single positive term, followed by several negative terms that involve the state variables. I have already shown that equilibrium immune abundance i is an increasing function of q. It is straightforward to show that equilibrium energy level is also a strictly increasing function of q by noting that the denominators of e’(q) and i’(q) are identical and that the only expression in the numerator that involves a negative sign Hm - f e nL has already been shown abovetoalwaysbepositive. eprime = ImplicitDerivsP1, 1, 2T . 8e@qD fi e, i@qD fi i, n@qD fi n, en@qD fi en<; Denominator@eprimeD Denominator@iprimeD Numerator@eprimeD True e i Han + n sL f2 + en s2 Hm - e n fL This analysis suggests that n’(q) likely becomes negative as q increases (a fixed positive term minus several increasing negative terms). I can show that n’(q) is positive for small values of q by considering the value at the point where the pathogenisjustabletocolonizethehost-thatis,calculatethevalueofn’(q)atthepathogen-freeequilibrium. pathfreeequil = Solve@8dedt 0, dendt 0, didt 0< . 8n@qD fi 0<, 8e@qD, en@qD, i@qD m rn s - ai an f q m rn s2 an + ai q 2 f Hm rn s+an H1+rnL fL m H1+ai+rnL2 The sign of n’(q) is determined by the sign of mrn s - ai an f. However, for the pathogen to be able to invade, its per- capita growth rate, when the host is its the pathogen-free equilibrium, must be positive. In order for this to be true, m rn s - ai an fmustbepositive,ascanbeseenbelow. Analysis_of_four_model_variants.nb 5 PrintedbyMathematicaforStudentsThe sign of n’(q) is determined by the sign of mrn s - ai an f. However, for the pathogen to be able to invade, its per- capita growth rate, when the host is its the pathogen-free equilibrium, must be positive. In order for this to be true, m rn s - ai an fmustbepositive,ascanbeseenbelow. Hpercapdndt . 8e@qD fi e, en@qD fi en, i@qD fi i< . pathfreeequilL q Hm rn s - ai an fL an m H1 + ai + rnL - d Simplify True So n’(q) is positive at the lower boundary of pathogen persistence. This only strengthens the conviction that n’(q) must become negative at some point, because if it were to remain positive, the sign determining expression would be a single positive term minus several terms, all of which are increasing in magnitude. The only way this would be possibleisifthestatevariablesonlyincreasedtosomeasymptotethatwasmuch smallerthanm rn s. We will prove that n’(q) must become negative by contradiction. That is, we will assume that n’(q) is strictly increasingandthenshowthatleadstoalogicalfallacy. Wedo thisby usingimplicitdifferentiationtocalculatethesecondderivativei’’(q). ImplicitSecondDerivs = FullSimplify@ Solve@Simplify@D@8dedt 0, dendt 0, didt 0, percapdndt 0<, 8q, 2, :e fi 1 2 s Hm s + fL I2 d m s - m s2 + d f + ai s f + q s f - ,I-4 d s Hm s + fL Hd m - m s + q fL + Hd H2 m s + fL + s H-m s + Hai + qL fLL2MM, i fi - 1 2 f Hm s + fL Im s2 + d f - ai s f - q s f + ,I-4 d s Hm s + fL Hd m - m s + q fL + Hd H2 m s + fL + s H-m s + Hai + qL fLL2MM, n fi Id m2 s2 - d2 m f + 2 d m s f + ai d m s f + d q m s f - q m s2 f - d q f2 + ai q s f2 + q2 s f2 + d m ,I-4 d s Hm s + fL Hd m - m s + q fL + Hd H2 m s + fL + s H-m s + Hai + qL fLL2M + q f ,I-4 d s Hm s + fL Hd m - m s + q fL + Hd H2 m s + fL + s H-m s + Hai + qL fLL2MM H2 d s f Hd m - m s + q fLL>, :e fi 1 2 s Hm s + fL I2 d m s - m s2 + d f + ai s f + q s f +,I-4 d s Hm s + fL Hd m - m s + q fL + Hd H2 m s + fL + s H-m s + Hai + qL fLL2MM, i fi 1 2 f Hm s + fL I-m s2 - d f + ai s f + q s f + ,I-4 d s Hm s + fL Hd m - m s + q fL + Hd H2 m s + fL + s H-m s + Hai + qL fLL2MM, n fi Id m2 s2 - d2 m f + 2 d m s f + ai d m s f + d q m s f - q m s2 f - d q f2 + ai q s f2 + q2 s f2 - d m ,I-4 d s Hm s + fL Hd m - m s + q fL + Hd H2 m s + fL + s H-m s + Hai + qL fLL2M - q f ,I-4 d s Hm s + fL Hd m - m s + q fL + Hd H2 m s + fL + s H-m s + Hai + qL fLL2MM H2 d s f Hd m - m s + q fLL>> The first equilibrium is the pathogen-extinction equilibrium. The second and third are conjugates of one another, but only the third is feasible - the second gives rise to negative values for immune abundance. This can be seen by rewrit- ingtheimmuneequilibriuminthefollowingway: Analysis_of_four_model_variants.nb 7 PrintedbyMathematicaforStudentsThe first equilibrium is the pathogen-extinction equilibrium. The second and third are conjugates of one another, but only the third is feasible - the second gives rise to negative values for immune abundance. This can be seen by rewrit- ingtheimmuneequilibriuminthefollowingway: equilsP2, 2, 2T == - 1 2 f Hm s + fL m s2 + d f - ai s f - q s f + Im s2 + d f - ai s f - q s fM2 + 4 ai d s f Hm s + fL Simplify True If m s2 + d f - ai s f - q s f > 0, then the entire term in parentheses is obviously positive, and thus the equilibrium is negative. If m s2 + d f - ai s f - q s f < 0, the square root term is still positive and is guaranteed to be larger than m s2 + d f - ai s f - q s f, so the entire term in parentheses is positive, and thus the equilibrium is negative. A similarargumentcanbeusedtoshowthatthethirdimmuneequilibriumisguaranteedtobepositive. We therefore focus on the third equilibrium only in the subsequent analysis. In particular, we analyze how equilibrium immune abundance and pathogen load change as the energy assimilation rate q is increased. We show that equilib- rium immune abundance is a strictly increasing function of q, whereas equilibrium pathogen load peaks at an intermediatevalueofq. eequil = equilsP3, 1, 2T; iequil = equilsP3, 2, 2T; nequil = equilsP3, 3, 2T; Determiningtheresponseofimmuneabundancetochangesinq Thederivativeoftheiequilibriumwithrespecttoqcanbewrittenas: Simplify@D@iequil, qDD s 2 Hm s + fL 1 + -m s2 - Hd - Hai + qL sL f I-m s2 - Hd - Hai + qL sL fM2 + 4 ai d s f Hm s + fL Simplify True If -m s2 - Hd - Hai + qL sL f > 0, then the entire derivative is obviously positive. If -m s2 - Hd - Hai + qL sL f < 0, the term in the denominator will still have greater magnitude, so the entire fraction will be less than 1, and the terminparenthesesisthusguaranteedpositive.Therefore,theiequilibriumisa strictlyincreasingfunctionofq. Determiningtheresponseofpathogenloadtochangesinq Itissimpletoshowthatthereisaqvaluethatcausesapeakinthepathogenload. 8 Analysis_of_four_model_variants.nb PrintedbyMathematicaforStudentsSolve@D@nequil, qD 0, qD ::q fi 1 -m s2 f2 + ai s f3 I-m2 s3 f - d m s f2 - ai d m s f2 + ai m s2 f2 - ,Iai d2 m3 s3 f3 - 2 ai d m3 s4 f3 + ai m3 s5 f3 + 2 ai d2 m2 s2 f4 - 2 ai d m2 s3 f4 + 2 ai2 d m2 s3 f4 - 2 ai2 m2 s4 f4 + ai d2 m s f5 + 2 ai2 d m s2 f5 + ai3 m s3 f5MM>, :q fi 1 -m s2 f2 + ai s f3 I-m2 s3 f - d m s f2 - ai d m s f2 + ai m s2 f2 + ,Iai d2 m3 s3 f3 - 2 ai d m3 s4 f3 + ai m3 s5 f3 + 2 ai d2 m2 s2 f4 - 2 ai d m2 s3 f4 + 2 ai2 d m2 s3 f4 - 2 ai2 m2 s4 f4 + ai d2 m s f5 + 2 ai2 d m s2 f5 + ai3 m s3 f5MM>> However, proving that one of these two q values is both positive and large enough to permit the pathogen to colonize the host is somewhat trickier. We take a slightly roundabout approach the problem. We begin by rewriting the equilib- riumpathogenloadintermsofn only. nequil2 = Solve@Hdidt . Solve@dndt 0, iDP1TL 0, nD ::n fi -d m + e m s - e ai f e H-d + e sL f >> Recognizing that the equilibrium n and e are both implicit function of q, we can implicitly differentiate the equilibrium conditiontocalculaten’(q): Simplify@D@nequil2 . 8n fi n@qD, e fi e@qD<, qDD ::n¢@qD fi I-d2 m + 2 d m s e@qD + s H-m s + ai fL e@qD2M e¢@qD f e@qD2 Hd - s e@qDL2 >> The derivative of e with respect to q is guaranteed to be positive. This can be seen by noting that e’(q) is a constant positivemultipleofi’(q): D@eequil, qD D@iequil, qD f s Based on this analysis, it is clear that the sign and zeros of n’(q) can be determined by looking at the sign and zeros of n’(e). That is, because e is a function of q, any value of e that satisfies n’(e) = 0 implies the existence of a q value that satisfies n’(q) = 0 - an intermediate peak. Moreover, it is clear that such an e will make the term in parentheses in the numeratorequaltozero.Therearetwopossibleevaluesthatgiverisetointermediatepeaksinn: epeak = SolveA-d2 m + 2 d m s e@qD + s H-m s + ai fL e@qD2 0, e@qDE ::e@qD fi -d m s - ai d m s f -m s2 + ai s f >, :e@qD fi -d m s + ai d m s f -m s2 + ai s f >> Only one of these is actually feasible, however. To understand why, it is necessary to consider the conditions required for the pathogen to actually be able to persist. Mathematically, this corresponds to the conditions for instability of the pathogen-freeequilibrium. Analysis_of_four_model_variants.nb 9 PrintedbyMathematicaforStudentsequilsP1T H* the pathogen-free equilibrium *L Eigenvalues@ 88D@dedt, eD, D@dedt, iD, D@dedt, nD<, 8D@didt, eD, D@didt, iD, D@didt, nD<, 8D@dndt, eD, D@dndt, iD, D@dndt, nD<< . equilsP1TD :e fi q 1 + ai , i fi ai q m + ai m , n fi 0> :-1 - ai, -m, -d + q s 1 + ai - ai q f m + ai m > Because the first two eigenvalues are negative, the pathogen - free equilibrium will be unstable if q s 1+ai - d - ai q f m+ai m > 0. This condition can be understood intuitively as the per-capita growth rate of the pathogen when the host’s energy and immune abundance are at their pathogen-free equilibria. This condition can be rewritten as s e - d - f i > 0, or equivalently, as s e - d - f ai e m > 0. So, for pathogen invasion to occur, e > d m m s-ai f . We can showthatthefirstcandidatepeakesatisfiesthiscondition,buttheseconddoesnot. SimplifyBepeakP1, 1, 2T > d m m s - ai f F SimplifyBepeakP2, 1, 2T > d m m s - ai f F ai d m s f H-m s + ai fL < 0 ai d m s f H-m s + ai fL > 0 The term (-m s+ai f) is negative (because q s 1+ai - d - ai q f m+ai m > 0 q s m 1+ai - ai q f 1+ai > 0 q s m - ai q f > 0 s m- ai f>0),sothesecondcandidatepeakedoesnotsatisfythenecessaryinequality. We can show that the first candidate e leads to a peak, rather than a trough, by looking at the sign of the second derivative n’’(e) evaluated at the candidate e value. Because this second derivative is negative, this e corresponds to a peak. Simplify@D@nequil2P1, 1, 2T, 8e, 2