# Table of Contents

# Com

EpiJS module for representing communities

Import it with:

       const com = require('@epispot/epijs').com

# Virus

Class representing a virus, which can infect a community.

# Parameters

# Examples

let covid = new Virus(5.7, 2.1/100)

# Community

Class representing a community, which can be infected with a disease, and compared to other communities.

# Parameters

# Examples

let NewYorkCity = new Community(8419000, 300, 8418700)

# sir

SIR model for the community

# Parameters

# Examples

let NewYorkCity = new Community(8419000, 300, 8418700)
let covid = new Virus(5.7, 2.1/100, 1/8, 1/100)

outbreak = NewYorkCity.sir(covid, 100, false)

# seir

SEIR model for the community

# Parameters

# Examples

let NewYorkCity = new Community(8419000, 300, 8418700)
let covid = new Virus(5.7, 2.1/100, 1/8, 1/100)

outbreak = NewYorkCity.seir(covid, 100, false)

# seird

SEIRD model for the community

# Parameters

# Examples

let NewYorkCity = new Community(8419000, 300, 8418700)
let covid = new Virus(5.7, 2.1/100, 1/8, 1/100)

outbreak = NewYorkCity.seird(covid, 100, false)

# custom

Custom model for the community

# Parameters

  • compartments Array (opens new window) The compartments for the model. Pass in as an array with sub arrays of the form [compartment, name in key]. Note that the 'name in key' is a string with the same value that is stored in your extra key, otherwise it should be the same name that we store it as. You can find these names below.

    • Susceptible - stored as 'S'
    • Infected - stored as 'I'
    • Recovered - stored as 'R'

Make sure that you use the same names that are stored in the key in the equations for the compartments. These values are found from parameters passed into the virus class and the community class.

  • time Number (opens new window) The time to predict for.
  • virus The virus class to infect the community with.
  • extrakey Object (opens new window) Optional, any extra parameters for the compartments equations. We already have the following parameters:
    • Population - stored as 'p' in our key.
    • Susceptible Population - stored as 'S' in our key.
    • R-naught - stored as 'rn' in our key.
    • Recovery rate - stored as 'u' in our key.
    • Recovered - stored as 'R' in our key.
    • Infected - stored as 'I' in our key.
    • Death Rate - stored as 'd' in our key.
    • Incubation Period - stored as 'a' in our key.

# Examples

let susceptible = new Idiom("S-(B*S*I/p)");
let infected = new Idiom("I+(B*S*I/p)-(u*I)");
let recovered = new Idiom("R+(u*I)");

let NewYorkCity = new Community(8419000, 300, 8418700)
let covid = new Virus(5.7, 2.1/100, 1/8, 1/100)

outbreak = NewYorkCity.custom([[susceptible, 'S'], [infected, 'I'], [recovered, 'R']], 100, covid, {B: covid.rnaught*covid.u})

# compare

Compare's two different outbreaks, communities, or anything else.

# Parameters

# Examples

let NewYorkCity = new Community(8419000, 300, 8418700)
let covid = new Virus(5.7, 2.1/100)
let covid_variant = new Virus(5, 4/100)

let chart = document.getElementById('model')

covid_outbreak = NewYorkCity.sir(covid, 100)
variant_outbreak = NewYorkCity.sir(covid_variant, 100)

compare(chart, covid_outbreak, variant_outbreak, "COVID-19", "COVID-19 Variant", 100) // We chose 100 as the amount of days, but it could be 50 or 25, not the lenght of the prediction that was in the model.