tenua.simulator
Class ReactionBlock

java.lang.Object
  extended by tenua.simulator.ReactionBlock

public class ReactionBlock
extends java.lang.Object

Analyzes a set of reactions. The reactions are defined by the right hand and left hand sides, each of which is a List, with the even numbered elements the stoichiometry and the odd elements a Symbol that represents the concentration of the species


Constructor Summary
ReactionBlock(java.util.List lhs, java.util.List rhs, SymbolTable st)
          creates a ReactionBlock
 
Method Summary
 Expression reactionRate(int i)
          Creates an Expression for calculating a reaction rate.
 Expression speciesRate(java.lang.String name)
          Creates an Expression for calculating the rate of concentration increase for a chemical species.
 Expression totalRates()
          Creates an Expression that calculates the total rate of each reaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReactionBlock

public ReactionBlock(java.util.List lhs,
                     java.util.List rhs,
                     SymbolTable st)
creates a ReactionBlock

Method Detail

reactionRate

public Expression reactionRate(int i)
Creates an Expression for calculating a reaction rate. Calculated as
    rate(i)=k(i) * product_over_all_species_s (concentration[s]^stoichiometry[s])
  
where stoichiometry is the stoichiometry of that species in that reaction in the appropriate direction.

Parameters:
i - the number of the reaction. use positive i for the forward reaction, negative i for the backward reaction. Note that reactions are numbered from 1.
Returns:
the Expression created
Throws:
java.lang.IllegalArgumentException - if no such reaction exists

totalRates

public Expression totalRates()
Creates an Expression that calculates the total rate of each reaction. Calculated as
    totalRate(r) = rate(+r)-rate(-r)
  

Returns:
the Expression created

speciesRate

public Expression speciesRate(java.lang.String name)
Creates an Expression for calculating the rate of concentration increase for a chemical species. Calculated as
    rate(name) = sum_over_all_reactions_r ((backward_stoich[r] -forward_stoich[r])*totalRate(r))
  
If the species is not mentioned in any of the reactions, the rate is zero

Parameters:
name - the name of the species
Returns:
the Expression created