pyRate is a Python program that reads in a set of chemical reactions and integrates those equations to solve the time evolution of chemical abundances. The rates can be given in the UMIST99 or in the new UMIST06 format. As the original UMIST programs, pyRate writes a separate routine for the calculation of the time derivatives of the abundances. By default this is a normal python subroutine. However, if one has installed gcc compiler and pyrex packages, pyRate will write a c-subroutine that will be compiled and called via a pyrex wrapper. The resulting program will be much faster than the pure python one. The set of equations is solved using the ODE solver included in the scipy package. Apart from scipy, pyRate requires the numpy and, for plotting, the matplotlib libraries. These are all included in the repositories of major Linux distributions.
The program is a single Python script and requires no special installation. All necessary file (apart from the rate-file) should be contained in the following zip-package. Note: the program included in the zip is quite old. For any serious use, please contact the author for a more up to date version.
One can instruct the program to write and use c-subroutine (see above) by setting
USE_PYREX = True at the beginning of the script
pyRate.py. Hopefully, with the help of the
setup.py and the header file
c_ydot.h, all included in the zip, the program is able to compile the rate equations into a shared library. This has been tested only on Linux and only with the gcc compiler. If pyRate creates a library
libc_ydot.so but does not appear to be able to use it, you may have to add the current working directory to the search path for libraries (e.g., "
setenv LD_LIBRARY_PATH ./").
The simplest usage is '
python pyRate.py rates.dat', where
rates.dat is a file containing reactions and their rate coefficients in the UMIST format. Usually one would rather use an ini-file that specifies the rate file together with the values of some other parameters. Here is an example of the contents of a possible ini-file:
The keywords are not case sensitive but they should be written out as shown, without abbreviating. All keywords apart from
rates are optional and have some default value. It is preferable to prepare a rate file that includes only the reactions one wants to use and only the species one needs. However, using
blacklist one can drop selected equations. The file (in the example
blacklist.dat) lists numbers of unwanted equations (as given in the first column of the rate file), one number per line. With
species one can specify a set of species that are to be included in the calculation. All other species and all reactions involving other species are dropped. With
abundances one specifies initial abundances. The associated file contains lines with the name of a species followed by the initial relative abundance. For all species not included in the file, the abundance is set to zero. If the keyword
abundances is not used, default abundances are set for elements (see code, looking for variable
EL_ABU). They should be equal to what would be set with
default.abundances containing the following data.
Finally, a valuable quote from the program source
There is not guarantee, apart from the testing you make yourself, that the program does what you think it should do.