1
$\begingroup$

I am working on an epidemiological model and I would like to know how to plot contour plots of R0 (basic reproduction number) against two given parameters using Mathematica. An example contour plot is given below.

enter image description here

The values of the parameters (except beta and gamma) of my model and the formula for R0 are given below.

c = 0.01
theta = 0.2778
p = 0.05
phi = 0.95
epsilon = 0.084
delta = 0.011
mu = 0.000027

R0 = (epsilon*c*beta*theta*(mu+(1-phi)*p))/(mu*(mu+p)*(mu+epsilon)*(mu+gamma+delta))

I wish to draw the contour plot of R0 against the two parameters beta and gamma which could both vary between 0 and 1. Any help would be greatly appreciated. Thanks a lot in advance!

$\endgroup$
1
  • 1
    $\begingroup$ Try: ContourPlot[R0, {gamma, 0, 1}, {beta, 0, 1}] $\endgroup$ Commented Dec 31, 2022 at 17:05

1 Answer 1

3
$\begingroup$
Clear["Global`*"]

c = 0.01;
theta = 0.2778;
p = 0.05;
phi = 0.95;
epsilon = 0.084;
delta = 0.011;
mu = 0.000027;

R0 = (epsilon*c*beta*
     theta*(mu + (1 - phi)*p))/(mu*(mu + p)*(mu + epsilon)*(mu + 
       gamma + delta));

ContourPlot[R0, {beta, 0, 1}, {gamma, 0, 1},
 FrameLabel -> (Style[#, 14] & /@ {β, γ}),
 PlotLegends -> BarLegend[Automatic,
   LegendLabel -> Placed[HoldForm[R0], Bottom]]]

enter image description here

Compared with the example shown in the question, R0 has much larger values.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.