sme.SimulationResult.species_dcdt
- property SimulationResult.species_dcdt
the species concentration rate of change at this timepoint
for each species, the rate of change of concentration is provided as a 3d array, where
species_dcdt['A'][z][y][x]
is the rate of change of the concentration of species “A” at the point (x,y,z)Note
The rate of change of species concentrations is only provided for the last timepoint of a simulation, and only when using the Pixel simulator. Otherwise
species_dcdt
is an empty dict.Examples
do a short Pixel simulation and get the rate of change of species concentrations from the last timepoint:
>>> import sme >>> model = sme.open_example_model() >>> results = model.simulate(10, 1) >>> species_dcdt = results[-1].species_dcdt
this is a dict with an entry for each species:
>>> type(species_dcdt) <class 'dict'> >>> species_dcdt.keys() dict_keys(['B_out', 'A_cell', 'B_cell', 'A_nucl', 'B_nucl'])
the rate of change of concentration is a 2d ndarray of doubles, one for each pixel in the geometry image:
>>> b_cell = species_dcdt['B_cell'] >>> type(b_cell) <class 'numpy.ndarray'> >>> b_cell.dtype dtype('float64') >>> b_cell.shape (1, 100, 100)
the rate of change of concentration can be displayed using matplotlib:
>>> import matplotlib.pyplot as plt >>> imgplot = plt.imshow(b_cell[0])
- Type:
Dict[str, numpy.ndarray]