def odes(self):
"""Return a list of differential equations describing the
evolution of the species concentrations in time."""
t = sp.Symbol('t', real = True)
x = [sp.Function(s) for s in self.species]
derivs = self.equations()
return [sp.Eq(sp.Derivative(x[j](t), t),
derivs[j].subs([(sp.Symbol(self.species[i]), x[i](t)) for i in range(self.n_species)]))
for j in range(self.n_species)]
评论列表
文章目录