Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

CompartmentalModeling

Guides

  • Compartmental Modeling

Tech Notes

  • Vertical Transmission Models

Symbols

  • DynamicTransmissionModel
  • ForceOfInfection
  • Incidence
  • NextGenerationMatrix
  • CollectModel
  • CompartmentalModelGraph
  • CompetitiveInhibitorKinetics
  • DefinePropensityFunction
  • DeriveTransitions
  • DynamicTransmissionModel
  • EnzymeReaction
  • EpidemiologyModelData
  • EpidemiologyModel
  • ExpandModel
  • ForceOfInfection
  • HillKinetics
  • Incidence
  • KineticCompartmentalModel
  • KineticReactionNetworkModel
  • MichaelisMentenKinetics
  • NextGenerationMatrix
  • NoncompetitiveInhibitorKinetics
  • NullCompartment
  • ResolveCompartmentalModel
  • StochasticSolve
  • StoichiometryTable
  • StratifyModel
  • Transition
  • UncompetitiveInhibitorKinetics
  • VitalDemographicsModel
  • $C
  • $CompartmentalModelingVersion
  • $EpidemiologyColor
  • $EpidemiologyModelingVersion
  • $R
  • $SystemsBiologyModelingVersion
RobertNachbar`EpidemiologyModeling`
NextGenerationMatrix
​
NextGenerationMatrix
[eqns,vars,t,forceOfInfection,infectedCompartments]
returns the next generation matrix for the system of differential equations
eqns
with independent variables
vars
in terms of
t
with specified
forceOfInfection
and
infectedCompartments
.
​
​
NextGenerationMatrix
[modelDataAssociation,infectedCompartments]
takes the equations, variables, time variable, and force of infection from the Association
modelData
.
​
​
NextGenerationMatrix
[…,
All
]
returns an association with the next generation matrix and intermediate vectors and matrices.
​
Details and Options

Examples  
(10)
Basic Examples  
(2)
Compute the next generation matrix for an SIR with vital demographics model:
In[1]:=
NextGenerationMatrix
[​​{
′

[t]Λ-μ[t]-β[t]λ[t],​​
′
ℰ
[t]β[t]λ[t]-ζℰ[t],​​
′
ℐ
[t]-γℐ[t]-μℐ[t]+ζℰ[t],​​
′
ℛ
[t]γℐ[t]-μℛ[t]},​​{,ℰ,ℐ,ℛ},​​t,​​{λ[t]ℐ[t]},​​{ℰ,ℐ}​​]
Out[1]=

βζΛ
μ(γζ+ζμ)
,
βζΛ
μ(γζ+ζμ)
,{0,0}
​
Use
All
to obtain the next generation matrix and the intermediate vectors and matrices:
In[1]:=
result=
NextGenerationMatrix
[​​{
′

[t]Λ-μ[t]-β[t]λ[t],​​
′
ℰ
[t]β[t]λ[t]-ζℰ[t],​​
′
ℐ
[t]-γℐ[t]-μℐ[t]+ζℰ[t],​​
′
ℛ
[t]γℐ[t]-μℛ[t]},​​{,ℰ,ℐ,ℛ},​​t,​​{λ[t]ℐ[t]},​​{ℰ,ℐ},​​All];
The next generation matrix is:
In[2]:=
MatrixForm@result["NextGenerationMatrix"]
Out[2]//MatrixForm=
βζΛ
μ(γζ+ζμ)
βζΛ
μ(γζ+ζμ)
0
0
The intermediate matrices are:
In[3]:=
MatrixForm/@Most@result//Normal//Column
Out[3]=
InfectedVariables
ℰ[t]
ℐ[t]
TransmissionTerms
βℐ[t][t]
0
TransferTerms
ζℰ[t]
-ζℰ[t]+(γ+μ)ℐ[t]
DiseaseFreeEquilibrium
[t]
Λ
μ
ℰ[t]0
ℐ[t]0
ℛ[t]0
TransmissionJacobianMatrix
0
βΛ
μ
0
0
TransferJacobianMatrix
ζ
0
-ζ
γ+μ
Scope  
(1)

Options  
(4)

Applications  
(2)

Neat Examples  
(1)

SeeAlso
Solve
 
▪
DynamicTransmissionModel
 
▪
ForceOfInfection
RelatedGuides
▪
Compartmental Modeling
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com