Kinetics

strengths.kinetics.compute_reaction_rates(system, reaction, position=0, state=None, units_system=<strengths.units.UnitsSystem object>)

Computes and returns the reaction forward and backward rates for a given reaction in a given position of a given system at a given state.

Parameters:
  • system (RDSystem) – system in which the reaction occurs.

  • reaction (Reaction, number or string) – reaction of interest. If a Reaction object is given, if will be used directly. if an index or a lable is given, the reaction will be retrived from the system’s network.

  • position (number, tuple or coord like) – position of the cell in which the rates should be computed

  • state (UnitArray or quantity units dimensions or None) – state of the system. If set to None, system.state is used instead.

  • units_system (UnitsSystem) – units_system in which the returned rates should be expressed.

Returns:

[forward rate, reverse rate]

Return type:

list

strengths.kinetics.compute_diffusion_rates(system, species, src_position, dst_position, state=None, units_system=<strengths.units.UnitsSystem object>)

Computes and returns the forward and backward diffusion rates for a given species of a given system at a given state from a given source cell to another destination cell. Those are computed from the diffusion coefficient and cell size according to the method presented by David Bernstein (Bernstein, 2015) [1], with some modification in the case of graph diffusion (with RDGraphSpace).

Parameters:
  • system (RDSystem) – system in which the reaction occurs.

  • species (Species, number or string) – species of interest.

  • src_position (number, tuple or coord like) – position of the diffusion source cell.

  • dst_position (number, tuple or coord like) – position of the diffusion destination cell.

  • state (UnitArray or quantity units dimensions or None) – state of the system. If set to None, system.state is used instead.

  • units_system (UnitsSystem) – units_system in which the returned rates should be expressed.

Returns:

[forward rate,reverse rate]

Return type:

list

references

strengths.kinetics.compute_dspeciesdt(system, species, position=0, state=None, apply_chemostats=True, units_system=<strengths.units.UnitsSystem object>)

Computes and returns time derivative of the system state for a given species at a given position.

Parameters:
  • system (RDSystem) – system in which the reaction occurs.

  • species (Species, number or string) – species of interest.

  • position (number, tuple or coord like) – position of the cell in which the rates should be computed

  • state (UnitArray or quantity units dimensions or None) – state of the system. If set to None, system.state is used instead.

  • units_system (UnitsSystem) – units_system in which the returned rates should be expressed.

Returns:

time derivative of the species quantity at the given position of the system.

Return type:

UnitValue with quantity per time unit dimensions

strengths.kinetics.compute_dstatedt(system, state=None, apply_chemostats=True, units_system=<strengths.units.UnitsSystem object>)

Computes and returns time derivative of the system state for all species at all poition. The returned UnitArray have the same organisation than state.

Parameters:
  • system (RDSystem) – system in which the reaction occurs.

  • state (UnitArray or quantity units dimensions or None) – state of the system. If set to None, system.state is used instead.

  • units_system (UnitsSystem) – units_system in which the returned rates should be expressed.

Returns:

[dxdt for x in state]

Return type:

UnitArray with quantity per time unit dimensions