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

EpidemiologicalModeling

Guides

  • Epidemiological modeling

Tech Notes

  • SEI2HR-Econ model with quarantine and supplies scenarios
  • SEI2HR model with quarantine scenarios

Symbols

  • AddModelIdentifier
  • AddTermsToEquations
  • AggregateForCellIDs
  • ApproximateField
  • AssignInitialConditions
  • AssignRateRules
  • CoerceAnnotatedSymbols
  • ConvertSolutions
  • EconomicsStockPlots
  • EpidemiologicalFullModelQ
  • EpidemiologicalModelQ
  • EpidemiologyFullModelQ
  • EpidemiologyModelQ
  • EquationPosition
  • EvaluateSolutionsByModelIDs
  • EvaluateSolutionsOverGraph
  • EvaluateSolutionsOverGraphVertexes
  • GetPopulations
  • GetPopulationSymbols
  • GetRates
  • GetRateSymbols
  • GetStocks
  • GetStockSymbols
  • GridObjectQ
  • JoinModels
  • MakeAgeGroupMixingTerms
  • MakeAgeGroupMortalityTerms
  • MakeCoreMultiSiteModel
  • MakeHexagonGrid
  • MakeMigrationTerms
  • MakePolygonGrid
  • MakeVertexShapeFunction
  • MalariaModel
  • ModelGridTableForm
  • ModelNDSolveEquations
  • ModelNDSolve
  • MultiSiteModelStocksPlot
  • PopulationStockPlots
  • PrefixGroupsSolutionsListPlot
  • SEI2HREconModel
  • SEI2HRModel
  • SEI2RModel
  • SEI4RModel
  • SEIRModel
  • SetInitialConditions
  • SetRateRules
  • SI2RModel
  • SIRModel
  • SiteIndexSolutionsPlot
  • ToAssociation
  • ToGraph
  • ToPrefixGroupsSolutions
  • ToSiteCompartmentsModel
  • ToTimeSeries
AntonAntonov`EpidemiologicalModeling`
MalariaModel
​
MalariaModel
[var,con]
generates malaria model stocks, rates, and equations using the time variable
var
with symbols in the context
con
.
​
Examples  
(1)
Basic Examples  
(1)
Make a Malaria model:
In[1]:=
m=
MalariaModel
[t,"InitialConditions"True,"RateRules"True,"Ross"False];
Tabulate the model:
In[2]:=
ModelGridTableForm
[m]
Out[2]=
Stocks
#
Symbol
Description
1
HP[t]
Human Population
2
MP[t]
Mosquito Population
3
SHP[t]
Susceptible Human Population
4
SMP[t]
Susceptible Mosquito Population
5
IHP[t]
Infected Human Population
6
IMP[t]
Infected Mosquito Population
,Rates
#
Symbol
Description
1
a
Number of bites per mosquito and time unit
2
b
Probability that a bite generates a human infection
3
c
Probability that a mosquito becomes infected
4
aip
Average human infectious period
5
mls
Mosquito life span
,Equations
#
Equation
1
′
SHP
[t]-
a
b
(HP[0]-
IHP[t]
)
IMP[t]
HP[0]
2
′
IHP
[t]-
IHP[t]
aip
+
a
b
(HP[0]-
IHP[t]
)
IMP[t]
HP[0]
3
′
SMP
[t]-
a
c
IHP[t]
(MP[0]-
IMP[t]
)
MP[0]
4
′
IMP
[t]
a
c
IHP[t]
(MP[0]-
IMP[t]
)
MP[0]
-
IMP[t]
mls
,RateRules
#
Symbol
Value
1
HP[0]
100000
2
MP[0]
1000000
3
a
0.5
4
b
0.35
5
c
0.5
6
aip
20
7
mls
20
,InitialConditions
#
Equation
1
SHP[0]99999
2
IHP[0]1
3
SMP[0]999999
4
IMP[0]1

Here are model's equations:
In[3]:=
ModelNDSolveEquations
[m]
Out[3]=

′
SHP
[t]-1.75×
-6
10
(100000-IHP[t])IMP[t],
′
IHP
[t]-
IHP[t]
20
+1.75×
-6
10
(100000-IHP[t])IMP[t],
′
SMP
[t]-2.5×
-7
10
IHP[t](1000000-IMP[t]),
′
IMP
[t]2.5×
-7
10
IHP[t](1000000-IMP[t])-
IMP[t]
20
,SHP[0]99999,IHP[0]1,SMP[0]999999,IMP[0]1
Simulate the model for 20 days:
In[4]:=
aSol=Association@First@
ModelNDSolve
[m,{t,0,20}]
Out[4]=
HPHP,MPMP,SHPInterpolatingFunction
Domain: {{0.,20.}}
Output: scalar
,SMPInterpolatingFunction
Domain: {{0.,20.}}
Output: scalar
,IHPInterpolatingFunction
Domain: {{0.,20.}}
Output: scalar
,IMPInterpolatingFunction
Domain: {{0.,20.}}
Output: scalar

Plot the solutions:
In[5]:=
Association@KeyValueMap[#1Plot[Evaluate[#2[t]],{t,0,365},PlotLabel#1]&,aSol]
Out[5]=
HP
,MP
,SHP
,SMP
,IHP
,IMP

SeeAlso
"XXXX"
RelatedGuides
▪
Epidemiological modeling
""

© 2025 Wolfram. All rights reserved.

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