Module sir_ddft

Python bindings for the SIR DDFT library.

For a detailed documentation please consult the documentation of the Rust implementation. This document is only meant to document the nature of the Python bindings.

Classes

class Grid1D (...)

Grid in 1D

Methods

def new_equidistant(xlo, xhi, n)

Create an equidistant grid of n points in 1D ranging from xlo to xhi (inclusive)

class Grid2D (...)

Grid in 2D

Methods

def new_equidistant(xlo, xhi, ylo, yhi, nx, ny)

Create an equidistant grid of nx and ny points in 2D ranging from xlo to xhi (inclusive) and ylo to yhi (inclusive) in x and y respectively

class SIRDDFT1DSolver (sir_parameters, diffusion_parameters, ddft_parameters, state_1d, num_threads)

Solver for the 1D SIR DDFT model

Methods

def add_time(time)

Add time to the total integration time

def get_result()

Get result of integration

def integrate()

Integrate to the current integration time

class SIRDDFT2DSolver (sir_parameters, diffusion_parameters, ddft_parameters, state_2d, num_threads)

Solver for the 2D SIR DDFT model

Methods

def add_time(time)

Add time to the total integration time

def get_result()

Get result of integration

def integrate()

Integrate to the current integration time

class SIRDDFTParameters (mobility_S, mobility_I, mobility_R, social_distancing_amplitude, social_distancing_range, self_isolation_amplitude, self_isolation_range)

Parameters of the SIR DDFT model

Instance variables

var mobility_I

Return an attribute of instance, which is of type owner.

var mobility_R

Return an attribute of instance, which is of type owner.

var mobility_S

Return an attribute of instance, which is of type owner.

class SIRDiffusion1DSolver (sir_parameters, diffusion_parameters, state_1d)

Solver for the 1D SIR model with diffusion

Methods

def add_time(time)

Add time to the total integration time

def get_result()

Get result of integration

def integrate()

Integrate to the current integration time

class SIRDiffusion2DSolver (sir_parameters, diffusion_parameters, state_2d)

Solver for the 2D SIR model with diffusion

Methods

def add_time(time)

Add time to the total integration time

def get_result()

Get result of integration

def integrate()

Integrate to the current integration time

class SIRDiffusionParameters (diffusivity_S, diffusivity_I, diffusivity_R)

Parameters of all SIR models with diffusion

Instance variables

var diffusivity_I

Return an attribute of instance, which is of type owner.

var diffusivity_R

Return an attribute of instance, which is of type owner.

var diffusivity_S

Return an attribute of instance, which is of type owner.

class SIRParameters (infection_parameter, recovery_rate)

Parameters of all SIR models

Instance variables

var infection_parameter

Return an attribute of instance, which is of type owner.

var recovery_rate

Return an attribute of instance, which is of type owner.

class SIRSolver (params, state)

Solver for the SIR model

Methods

def add_time(time)

Add time to the total integration time

def get_result()

Get result of integration

def integrate()

Integrate to the current integration time

class SIRState (...)

State vector of the SIR model

Instance variables

var I

Infected population

var R

Recovered population

var S

Susceptible population

class SIRStateSpatial1D (grid, initfunc)

State vector for spatial SIR models in 1D

To create the initial state, a Grid1D as well as an initializer function initfunc are required. The initializer function takes the grid position x as its sole argument and must return an array of three floats (!) representing the value of the S, I and R fields at this point respectively

Instance variables

var I

State vector of infected population

var R

State vector of recovered population

var S

State vector of susceptible population

class SIRStateSpatial2D (grid, initfunc)

State vector for spatial SIR models in 2D

To create the initial state, a Grid2D as well as an initializer function initfunc are required. The initializer function takes the grid position x and y as its arguments and must return an array of three floats (!) representing the value of the S, I and R fields at this point respectively

Instance variables

var I

State vector of infected population (note: this is 1D, so you might want to reshape this before plotting)

var R

State vector of recovered population (note: this is 1D, so you might want to reshape this before plotting)

var S

State vector of susceptible population (note: this is 1D, so you might want to reshape this before plotting)