chemreac.core

In chemreac.core you will find ReactionDiffusion which is the class describing the system of ODEs.

class chemreac.core.ReactionDiffusion[source]

Object representing the numerical model, with callbacks for evaluating derivatives and jacobian.

The instance provides methods:

  • f(t, y, fout)
  • dense_jac_rmaj(t, y, jout)
  • dense_jac_cmaj(t, y, jout)
  • banded_jac_cmaj(t, y, jout)
  • banded_packed_jac_cmaj(t, y, jout)

some of which are used by chemreac.integrate.integrate_scipy

Additional convenience attributes (not used by underlying C++ class):

  • substance_names
  • substance_tex_names
Parameters:

n: integer

number of species

stoich_active: list of lists of integer indices

reactant index lists per reaction.

stoich_prod: list of lists of integer indices

product index lists per reaction.

k: 1-dimensional array

reaction rate coefficients

N: integer

number of compartments (default: 1 if x==None else len(x)-1)

D: sequence of floats

diffusion coefficients (of length n)

z_chg: sequence of integers

1-dimensional array ion charges

mobility: sequence of floats

mobility of ions

x: sequence of floats or pair of flats or float, optional

compartment boundaries (of length N+1), default: linspace(0, 1, N+1) if x is a pair of floats it is expanded into linspace(x[0], x[1], N+1). if x is a float it is expanded into linspace(0, x, N+1)

stoich_inactv: list of lists of integer indices

list of inactive reactant index lists per reaction.n, default: []

geom: integer

any of (FLAT, SPHERICAL, CYLINDRICAL)

logy: bool

f and *_jac_* routines operate on log(concentration)

logt: bool

f and *_jac_* routines operate on log(time)

logx: bool

f and *_jac_* routines operate on log(space)

nstencil: integer

number of points used in finite difference scheme

lrefl: bool

reflective left boundary (default: True)

rrefl: bool

reflective right boundary (default: True)

auto_efield: bool

calculate electric field from concentrations (default: False)

surf_chg: pair of floats

total charge of surface (defaut: (0.0, 0.0))

eps_rel: float

relative permitivity of medium (dielectric constant)

g_values: sequence of sequences of floats

per specie yields (amount / energy) per field type

g_value_parents: sequence of integers (optional)

indices of parents for each g_value. -1 denotes no concentration dependence of g_values. default: [-1]*len(g_values)

fields: sequence of sequence of floats

per bin field strength (energy / (volume time)) per field type. May be calculated as product between density and doserate

modulated_rxns: sequence of integers

Indicies of reactions subject to per bin modulation

modulation: sequence of sequences of floats

Per bin modulation vectors for each index in modulated_rxns

units: dict (optional)

default: None, see chemreac.units.SI_base for an example.

Attributes

units: dict