Пример #1
0
 def constants(self):
     """Replacing the constantVarValues attribute of scrn.Network instances,
     as it is buggy and does not update upon changing p in certain ways.
     """
     return Series([var.value for var in self.constantVars],
                   self.constantVars.keys(),
                   dtype=np.float)
Пример #2
0
def get_dxdt(net):
    """Get the velocities of species dynamics, dx/dt. 
    (Another way of getting it is N*v.)
    """
    if not hasattr(net, 'res_function'):
        net.compile()
    # assume it is an autonomous dynamical system
    # (time-invariant, hence t=0 here)
    dxdt = net.res_function(0, net.x, np.zeros(net.xdim), net.constants)
    return Series(dxdt, index=net.xids)
Пример #3
0
 def v(self):
     return Series(OD([(rxn.id, self.evaluate_expr(rxn.kineticLaw)) 
                       for rxn in self.reactions]), 
                   dtype=np.float)
Пример #4
0
 def asgrules(self):
     return Series(OD(self.assignmentRules.items()), dtype=object)
Пример #5
0
 def ratelaws(self):
     return Series(OD([(rxn.id, rxn.kineticLaw) for rxn in self.reactions]),
                   dtype=object)
Пример #6
0
 def rxns(self):
     return Series(OD([(rxn.id, rxn) for rxn in self.reactions]), 
                   dtype=object)
Пример #7
0
 def varvals(self):
     return Series(OD([(var.id, var.value) for var in self.variables]), 
                   dtype=np.float)
Пример #8
0
 def vars(self):
     return Series(OD(self.variables.items()), dtype=object)
Пример #9
0
 def c(self):
     return Series(OD([(sp.id, sp.value) for sp in self.species 
                       if sp.is_constant]), 
                   dtype=np.float)
Пример #10
0
 def x(self):
     return Series([var.value for var in self.dynamicVars], 
                   self.xids, dtype=np.float)
Пример #11
0
 def p0(self):
     return Series([var.initialValue for var in self.optimizableVars], 
                   self.pids, dtype=np.float)    
Пример #12
0
def get_J(net, *args, **kwargs):
    """Get steady-state flux.
    """
    set_ss(net, *args, **kwargs)
    return Series(net.v.values, net.Jids)