Skip to content

Numerical Study of an SIR Epidemic Model with Vaccination: RK4 versus Adams–Bashforth–Moulton in Scilab

  • 12 slides
  • 15 viva questions
  • 5 modules
  • No code needed

@sir-vaccination-model-rk4-vs-abm-scilabUpdated Oct 2026

Equilibria and R0 in Maxima, stability by Jacobian, and a convergence and cost comparison of Euler, RK4 and ABM4 in Scilab

M.Sc, Mathematics · Sem 4 · Intermediate · 16 weeks · Solo

More info
Level
Intermediate · 16 weeks · Solo
Relevant for
Karnataka
Common at
Bangalore University, University of Madras
Syllabus
Bangalore University M.Sc Mathematics CBCS · Project Work · Semester 4
Tech stack
  • Scilab (ode, hand-coded RK4 and ABM4)
  • Maxima (symbolic equilibria, Jacobian, eigenvalues)
  • LaTeX (report)
  • Beamer (slides)
  • pgfplots or Scilab-exported figures
For educational purposes only

Unlock this project

Full PPT + speaker notes, the step-by-step method, READMEFIRST, instructions and all 15 viva answers.

One-time. No subscription, no auto-renew, no drama.

Project packs

Credits never expire and work on any project. Use one here, save the rest for your friend who “will pay you back”.

  1. Pinned

    1 min

    Overview

    This dissertation studies a classical SIR (Susceptible–Infected–Recovered) epidemic model extended with vaccination from two angles: the mathematics of the model and the numerics of solving it.

    On the analytical side, the model's equilibria, the vaccination-adjusted basic reproduction number and the local stability of the disease-free and endemic equilibria are derived symbolically in Maxima, the computer-algebra system taught in M106P. The Jacobian is computed and its eigenvalues are examined to obtain the threshold condition R_v < 1 and the critical vaccination rate.

    On the numerical side, the same system is solved in Scilab with three schemes coded by hand — explicit Euler, the classical fourth-order Runge–Kutta (RK4) method and the fourth-order Adams–Bashforth–Moulton (ABM4) predictor–corrector — and compared against a high-accuracy reference solution computed with Scilab's built-in ode solver at tight tolerances. For each method we measure global error against step size, estimate the observed order of convergence, count function evaluations as a measure of cost and look at stability for large steps. Finally, we study how the epidemic peak (its height and timing) responds to the vaccination rate.

    All parameter values are hypothetical and illustrative, chosen to be in a plausible range; the model is not fitted to real data. The dissertation is typeset in LaTeX and presented with Beamer (M404P), matching Bangalore University's Semester-4 Project Work.

    Syllabus alignment

    Bangalore University · M.Sc Mathematics CBCS

    Project Work · Semester 4 · 4 credits · 100 = 70 dissertation + 30 presentation/viva (internal + external)

    Subjects this project applies
    • Maxima practicals (M106P) — symbolic algebra and calculus
    • Scilab practicals (M206P/M306P) — numerical methods
    • LaTeX/Beamer (M404P) — report and presentation
    • Ordinary Differential Equations (existence, stability, linearisation)
    • Numerical Analysis (one-step and multistep methods, error analysis)
    How it is evaluated

    See your department's project guidelines.

    Also fits: University of Madras PG CBCS.

    1 min read · 15 viva questions

  2. 2 min

    Synopsis

    Abstract

    We analyse an SIR model with constant recruitment, natural death and vaccination of susceptibles. Using Maxima we derive the disease-free equilibrium (DFE), the endemic equilibrium and the reproduction number R_v = βμ / ((μ + ν)(γ + μ)), and we show via the Jacobian that the DFE is locally asymptotically stable when R_v < 1. We then compare three numerical schemes — Euler, RK4 and ABM4 — implemented in Scilab, measuring global error, observed order, computational cost and step-size stability against a reference solution. A parameter study shows how the vaccination rate ν shifts the height and timing of the infection peak.

    Introduction

    Compartmental models reduce an epidemic to a small system of nonlinear ordinary differential equations. They rarely have closed-form solutions, so numerical integration is essential, and the choice of method affects both accuracy and cost. The SIR model with vaccination is ideal for an M.Sc project: it is simple enough to analyse fully by hand and by computer algebra, yet rich enough to show real numerical behaviour such as error accumulation and step-size limits.

    Literature and gap

    Textbook treatments (Brauer and Castillo-Chavez; Murray) derive thresholds analytically but usually treat the numerical solution as a black box. Numerical-analysis texts (Burden and Faires; Atkinson) analyse RK and multistep methods on toy problems. This project connects the two: the epidemiological model is analysed rigorously and then used as the test problem for a careful, reproducible comparison of one-step and multistep methods.

    Objectives in brief

    Symbolic analysis in Maxima; implementation of three schemes in Scilab; convergence and cost study; sensitivity of the peak to ν; report in LaTeX and slides in Beamer.

    Feasibility

    Scilab, Maxima and a TeX distribution are free and already used in the M.Sc practicals. The computations run in seconds on a laptop. The work fits the 16-week, 8-hours-per-week self-study allotted to Project Work, and needs no data collection or ethics approval because all parameters are hypothetical.

  3. 1 min

    Problem statement

    Vaccination changes the dynamics of an infectious disease: it removes susceptibles directly and can push the reproduction number below one. For an SIR model with vaccination, the key mathematical questions are where the equilibria lie, under what condition the infection dies out and how strongly the vaccination rate changes the size and timing of an outbreak.

    These questions are answered partly analytically and partly by numerical simulation, and the numerical answer is only as trustworthy as the method used. Explicit Euler is easy but inaccurate; RK4 is accurate but needs four function evaluations per step; ABM4 needs only two per step but is less stable and needs starting values. A student who reports "the peak occurs on day 42" without an error estimate has not really answered the question.

    This project therefore (i) derives the equilibria, R_v and the stability conditions symbolically, and (ii) quantifies the accuracy, observed order, cost and stability of Euler, RK4 and ABM4 on this model against a high-accuracy reference, so that the conclusions about vaccination are supported by verified numerics.

  4. 1 min

    Objectives & scope

    1. 01Formulate an SIR model with recruitment, natural mortality and vaccination, and state its assumptions.
    2. 02Derive the disease-free and endemic equilibria and the reproduction number R_v symbolically in Maxima.
    3. 03Establish local stability of the equilibria through the Jacobian, its eigenvalues and the Routh–Hurwitz criteria.
    4. 04Implement explicit Euler, classical RK4 and ABM4 predictor–corrector schemes in Scilab.
    5. 05Measure global error against a tight-tolerance reference solution and estimate the observed order of convergence.
    6. 06Compare computational cost (function evaluations) and step-size stability of the three schemes.
    7. 07Study the sensitivity of the epidemic peak height and timing to the vaccination rate.
    8. 08Typeset the dissertation in LaTeX and prepare the presentation in Beamer.

    Scope

    In scope

    • A deterministic, homogeneous-mixing SIRV-type model in normalised form (total population constant and scaled to 1).
    • Symbolic analysis: equilibria, R_v, critical vaccination rate, Jacobian and local stability.
    • Three hand-coded schemes (Euler, RK4, ABM4 with RK4 start-up) plus Scilab's ode as reference.
    • Error-versus-step-size study, observed order, function-evaluation count, behaviour at large step sizes.
    • Parameter sensitivity of the infection peak to the vaccination rate ν, using hypothetical parameters.

    Out of scope

    • Fitting the model to real surveillance data or making forecasts for any real disease.
    • Stochastic, age-structured or spatial models.
    • Global stability proofs by Lyapunov functions (mentioned as future scope).
    • Adaptive step-size control beyond what the reference solver provides.
  5. 2 min

    Methodology

    Research design: analytical derivation followed by controlled numerical experiments (a computational study).

    Model (normalised, N = 1)

    dS/dt = μ − βSI − (μ + ν)S dI/dt = βSI − (γ + μ)I dR/dt = γI + νS − μR

    β: transmission rate, γ: recovery rate, μ: birth = death rate, ν: vaccination rate of susceptibles. Because S + I + R = 1 is invariant, R can be recovered from S and I, and stability analysis is done on the (S, I) subsystem.

    Analytical results to derive

    • DFE: E0 = (μ/(μ+ν), 0, ν/(μ+ν)).
    • Reproduction number: R_v = βμ / ((μ+ν)(γ+μ)); without vaccination R0 = β/(γ+μ).
    • Critical vaccination rate: R_v < 1 ⇔ ν > μ(R0 − 1).
    • Endemic equilibrium (exists when R_v > 1): S* = (γ+μ)/β, I* = (μ+ν)(R_v − 1)/β.

    Illustrative (hypothetical) parameters

    β = 0.5 per day, γ = 0.1 per day, μ = 1/(60 × 365) per day, ν ∈ {0, 0.0005, 0.001, 0.002, 0.005}, initial state S = 0.999, I = 0.001, R = 0, horizon 0–365 days. With these values R0 ≈ 5; they are chosen only to produce a visible outbreak and are not estimates for any real disease.

    Numerical experiments

    1. Reference solution: Scilab ode with rtol = atol = 1e−12 on a fine output grid.
    2. For h ∈ {2, 1, 0.5, 0.25, 0.125, 0.0625} days, run Euler, RK4 and ABM4; compute E(h) = max over grid of ‖y_h − y_ref‖∞.
    3. Observed order p ≈ log2(E(h)/E(h/2)); theory predicts p ≈ 1 (Euler) and p ≈ 4 (RK4, ABM4).
    4. Cost: total right-hand-side evaluations (Euler 1, RK4 4, ABM4-PECE 2 per step) vs error, plotted on log–log axes.
    5. Stability: increase h until each method's solution becomes negative or oscillates; relate to the linearised eigenvalues.
    6. Peak study: for each ν, record I_max and t_peak with RK4 at a verified step size.

    Timeline (16 weeks, individual)

    WeeksWork
    1–2Literature, model formulation, supervisor approval
    3–5Maxima derivations: equilibria, R_v, Jacobian, eigenvalues
    6–8Scilab implementation and verification of the three schemes
    9–11Error, order, cost and stability experiments
    12Peak sensitivity to ν
    13–15LaTeX dissertation, figures, proofreading
    16Beamer slides, rehearsal, submission
  6. 2 min

    Architecture & tech stack

    • Scilab (ode, hand-coded RK4 and ABM4)
    • Maxima (symbolic equilibria, Jacobian, eigenvalues)
    • LaTeX (report)
    • Beamer (slides)
    • pgfplots or Scilab-exported figures

    The study has two connected tracks — symbolic and numerical — that meet in the results chapter.

    flowchart TD
      A["Model formulation: SIR with vaccination"] --> B["Maxima: solve for equilibria"]
      B --> C["Maxima: R_v and critical vaccination rate"]
      C --> D["Maxima: Jacobian and eigenvalues at equilibria"]
      A --> E["Scilab: right-hand side function"]
      E --> F["Reference solution: ode with tolerance 1e-12"]
      E --> G["Hand-coded Euler, RK4 and ABM4"]
      F --> H["Error, observed order and cost tables"]
      G --> H
      G --> I["Peak height and timing versus vaccination rate"]
      D --> J["Check: simulations agree with stability predictions"]
      I --> J
      H --> K["LaTeX dissertation and Beamer slides"]
      J --> K

    Maxima session (M106P)

    f1 : mu - b*S*I - (mu+nu)*S$
    f2 : b*S*I - (g+mu)*I$
    eqs : solve([f1, f2], [S, I]);
    J   : jacobian([f1, f2], [S, I]);
    J0  : ratsimp(subst([S = mu/(mu+nu), I = 0], J));
    eigenvalues(J0);
    Rv  : ratsimp(b*mu/((mu+nu)*(g+mu)));
    

    Note: beta and gamma are built-in function names in both Maxima and Scilab, so the code uses b/g (Maxima) and bet/gam (Scilab).

    Scilab: model and RK4 (M206P/M306P)

    function dy = sirv(t, y)
      S = y(1); I = y(2); R = y(3);
      dy = [mu - bet*S*I - (mu+nu)*S; bet*S*I - (gam+mu)*I; gam*I + nu*S - mu*R];
    endfunction
    
    function Y = rk4(f, t, y0)
      n = length(t); Y = zeros(length(y0), n); Y(:,1) = y0;
      for k = 1:n-1
        h = t(k+1) - t(k);
        k1 = f(t(k), Y(:,k));          k2 = f(t(k)+h/2, Y(:,k)+h/2*k1);
        k3 = f(t(k)+h/2, Y(:,k)+h/2*k2); k4 = f(t(k)+h, Y(:,k)+h*k3);
        Y(:,k+1) = Y(:,k) + h/6*(k1 + 2*k2 + 2*k3 + k4);
      end
    endfunction
    
    yref = ode(y0, 0, t, 1d-12, 1d-12, sirv);   // reference solution
    

    ABM4 (PECE) step

    Predictor (Adams–Bashforth 4): y_p = y_n + h/24 (55 f_n − 59 f_{n−1} + 37 f_{n−2} − 9 f_{n−3}). Corrector (Adams–Moulton): y_{n+1} = y_n + h/24 (9 f(t_{n+1}, y_p) + 19 f_n − 5 f_{n−1} + f_{n−2}). The first three steps are generated with RK4 so that start-up error does not spoil fourth-order accuracy.

    Results tables to fill from your runs

    h (days)E_Eulerp_EulerE_RK4p_RK4E_ABM4p_ABM4
    2…—…—…—
    1………………
    0.5………………
    νR_vI_maxt_peak (days)
    0………
    0.001………
  7. 5 modules

    Modules

    • Module 1 — Model formulation and assumptions

      States the compartments, parameters and assumptions (homogeneous mixing, constant population, vaccination of susceptibles only), proves that the feasible region S, I, R ≥ 0 with S + I + R = 1 is positively invariant, and reduces the system to two equations.

    • Module 2 — Symbolic analysis in Maxima

      Derives both equilibria, the reproduction number R_v and the critical vaccination rate, computes the Jacobian and its eigenvalues at the disease-free equilibrium, and applies trace–determinant (Routh–Hurwitz) conditions at the endemic equilibrium.

    • Module 3 — Numerical schemes in Scilab

      Implements explicit Euler, classical RK4 and the ABM4 predictor–corrector with RK4 start-up as reusable Scilab functions, verifies them on dy/dt = −y with a known exact solution, and computes the tight-tolerance reference solution with ode.

    • Module 4 — Convergence, cost and stability study

      Runs every scheme over a ladder of step sizes, tabulates maximum global error and observed order, plots error against function evaluations on log–log axes and finds the largest stable step for each method, relating it to the eigenvalues.

    • Module 5 — Vaccination sensitivity and documentation

      Records peak infection level and timing for several vaccination rates, checks the results against the analytical threshold, and assembles the LaTeX dissertation (M404P) with figures, tables and appendices plus the Beamer presentation.

  8. Locked

    Presentation

    12 slides with speaker notes. The outline below is free; the bullets, notes and the generated .pptx unlock with the project.

    1. SIR Model with Vaccination: RK4 versus ABM
    2. Motivation
    3. The model
    4. Equilibria and R_v (Maxima)
    5. Local stability
    6. Numerical schemes
    7. Verification and reference solution
    8. Convergence results
    9. Cost and stability
    10. Effect of vaccination on the peak
    11. Tools used
    12. Conclusions and future work

    Bullets, speaker notes and the .pptx download unlock with the project.

    Presentation is locked: 12 slides, Speaker notes, .pptx download.

  9. 1 min

    Future scope

    • Global stability of the equilibria using Lyapunov functions and LaSalle's invariance principle.
    • Extending to SEIR, SIRS or age-structured models and comparing their reproduction numbers.
    • Optimal control of the vaccination rate using Pontryagin's maximum principle, solved by a forward–backward sweep in Scilab.
    • Comparing explicit schemes with implicit and adaptive methods on a deliberately stiff parameter set.
    • Parameter estimation by least squares from an openly available, properly cited dataset.
  10. 8 sources

    References

    1. Fred Brauer & Carlos Castillo-Chavez, Mathematical Models in Population Biology and Epidemiology, 2nd ed., Springer, 2012
    2. J. D. Murray, Mathematical Biology I: An Introduction, 3rd ed., Springer
    3. Richard L. Burden & J. Douglas Faires, Numerical Analysis, Cengage Learning
    4. Kendall E. Atkinson, An Introduction to Numerical Analysis, 2nd ed., Wiley
    5. J. C. Butcher, Numerical Methods for Ordinary Differential Equations, Wiley
    6. Scilab — official website and documentation
    7. Maxima — a computer algebra system (official website)
    8. The LaTeX Project — documentation

    Cite this bundle

    OnlyProjects. (2026). Numerical Study of an SIR Epidemic Model with Vaccination: RK4 versus Adams–Bashforth–Moulton in Scilab: M.Sc Mathematics project bundle [Educational resource]. https://onlyprojects.online/projects/msc-maths-sir-vaccination-model-rk4-vs-abm-scilab

Slides, diagrams & files

12 slides. Titles are free; bullets, speaker notes and the .pptx unlock with the project.

  1. SLIDE 1

    SIR Model with Vaccination: RK4 versus ABM

  2. SLIDE 2

    Motivation

  3. SLIDE 3

    The model

  4. SLIDE 4

    Equilibria and R_v (Maxima)

  5. SLIDE 5

    Local stability

  6. SLIDE 6

    Numerical schemes

  7. SLIDE 7

    Verification and reference solution

  8. SLIDE 8

    Convergence results

  9. SLIDE 9

    Cost and stability

  10. SLIDE 10

    Effect of vaccination on the peak

  11. SLIDE 11

    Tools used

  12. SLIDE 12

    Conclusions and future work

Architecture diagram

1
flowchart TD
  A["Model formulation: SIR with vaccination"] --> B["Maxima: solve for equilibria"]
  B --> C["Maxima: R_v and critical vaccination rate"]
  C --> D["Maxima: Jacobian and eigenvalues at equilibria"]
  A --> E["Scilab: right-hand side function"]
  E --> F["Reference solution: ode with tolerance 1e-12"]
  E --> G["Hand-coded Euler, RK4 and ABM4"]
  F --> H["Error, observed order and cost tables"]
  G --> H
  G --> I["Peak height and timing versus vaccination rate"]
  D --> J["Check: simulations agree with stability predictions"]
  I --> J
  H --> K["LaTeX dissertation and Beamer slides"]
  J --> K

Files

Viva questions & answers

3 of 15 questions free. Explain each answer in your own words before you move on.

  1. Concept

    Derive the basic reproduction number for your model.

    At the disease-free equilibrium S0 = μ/(μ+ν). The infected equation linearised there is I' = (βS0 − (γ+μ))I, so infection grows when βS0 exceeds γ+μ. The ratio βS0/(γ+μ) = βμ/((μ+ν)(γ+μ)) is R_v, the average number of secondary infections by one case in the vaccinated population.

  2. Concept

    What is the critical vaccination rate and how did you obtain it?

    Setting R_v < 1 gives βμ < (μ+ν)(γ+μ), which rearranges to ν > βμ/(γ+μ) − μ = μ(R0 − 1), where R0 = β/(γ+μ) is the reproduction number without vaccination. Above this rate the disease-free equilibrium is locally stable.

  3. Concept

    Why can you drop the R equation in the stability analysis?

    Adding the three equations gives d(S+I+R)/dt = μ − μ(S+I+R), so with S+I+R = 1 initially the total stays 1. R = 1 − S − I is then determined by S and I, and R does not appear in the S or I equations, so stability of the (S, I) subsystem decides everything.

+12 more questions

They and the answers unlock with the project. Try answering the ones above yourself first. Your examiner will.

For educational purposes only. Use this bundle to understand how the project works, then build and write your own. Submitting it verbatim is between you, your conscience and your external examiner.