Skip to content

Kinetics

Kinetics shared by the chemistry packages.

They are reactors and reactions that a reactor and the sites of a field run.

BrusselatorReactionElement(label, *, u=1.0, v=1.0, a=1.0, b=3.0, space=None)

Bases: Element

Reactor of the Brusselator, the concentrations u and v of its intermediates.

The reactions A -> U, B + U -> V + D, 2U + V -> 3U, and U -> E change the concentrations, with the buffered reactants A and B held at the supplies a and b, which the reactions read as modifiers. The well-mixed BrusselatorODESystem runs them in one reactor and the reaction-diffusion BrusselatorSystem at every site of a field.

Parameters:

Name Type Description Default
label str

The label of the reactor.

required
u Annotated[object, closed_open(0, oo)]

The initial concentration of the autocatalytic intermediate.

1.0
v Annotated[object, closed_open(0, oo)]

The initial concentration of the second intermediate.

1.0
a Annotated[float, closed_open(0, oo)]

The constant supply of the first reactant.

1.0
b Annotated[float, closed_open(0, oo)]

The constant supply of the second reactant.

3.0
space BaseSpace | None

The lattice of the sites of a field, or None for one reactor.

None

Examples:

>>> from skcomplex.systems.chemistry.common.kinetics import BrusselatorReactionElement
>>> BrusselatorReactionElement('reactor').b
3.0
Source code in src/skcomplex/systems/chemistry/common/kinetics/_brusselator.py
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
def __init__(
    self,
    label: str,
    *,
    u: Annotated[object, RealSet.closed_open(0, oo)] = 1.0,
    v: Annotated[object, RealSet.closed_open(0, oo)] = 1.0,
    a: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
    b: Annotated[float, RealSet.closed_open(0, oo)] = 3.0,
    space: BaseSpace | None = None,
) -> None:
    super().__init__(label, space=space)
    self.u = u
    self.v = v
    self.a = a
    self.b = b

CubicAutocatalysisInteraction(label, *, target, substrate='u', autocatalyst='v', k=1.0, mode='rate')

Bases: ReactionInteraction

Cubic autocatalysis A + 2B -> 3B at the mass-action rate k a b^2.

It runs between two states of the target.

The autocatalyst B converts the substrate A into itself. The reaction is the autocatalytic step of the Gray-Scott system, with the substrate u and the autocatalyst v, and of the Brusselator and the Schnakenberg system, 2U + V -> 3U, with the substrate v and the autocatalyst u. A target that is a field reacts at every site.

Parameters:

Name Type Description Default
label str

The label of the reaction.

required
target Role

The path of the reactor, or of the field whose every site reacts.

required
substrate str

The name of the state of the substrate.

'u'
autocatalyst str

The name of the state of the autocatalyst.

'v'
k Annotated[float, closed_open(0, oo)]

The rate constant.

1.0
mode str

The form of the laws, 'rate', 'jump', or 'langevin'.

'rate'

Raises:

Type Description
ValidationError

The mode is unknown, or a state name is not an identifier.

Examples:

>>> from skcomplex.core.systems import System
>>> from skcomplex.systems.chemistry.common.kinetics import CubicAutocatalysisInteraction
>>> from skcomplex.systems.chemistry.kinetics import CubicAutocatalysisElement
>>> reaction = CubicAutocatalysisInteraction('autocatalysis', target='reactor', substrate='a', autocatalyst='b')
>>> reactor = CubicAutocatalysisElement('reactor', a=1.0, b=0.5)
>>> states = System(elements=[reactor], interactions=[reaction]).prepare().simulate(until=10, dt=1.0).states
>>> round(float(states[-1].sum()), 6)
1.5
Source code in src/skcomplex/systems/chemistry/common/kinetics/_cubic_autocatalysis.py
63
64
65
66
67
68
69
70
71
72
73
74
75
def __init__(
    self,
    label: str,
    *,
    target: Role,
    substrate: str = 'u',
    autocatalyst: str = 'v',
    k: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
    mode: str = 'rate',
) -> None:
    super().__init__(label, target=target, k=k, mode=mode)
    self.substrate = substrate
    self.autocatalyst = autocatalyst