예제 #1
0
    def __init__(self, method, left_hand_side_descriptors, right_hand_side, parameters):
        """
        :param method: a string describing the method used to generate the problem.
        Currently, 'MEA' and 'LNA' are supported"
        :param left_hand_side_descriptors: the left hand side of equations as a list of
            :class:`~means.core.descriptors.Descriptor` objects (such as :class:`~means.core.descriptors.Moment`)
        :param right_hand_side: the right hand side of equations
        :param parameters: the parameters of the model
        """

        self.__left_hand_side_descriptors = left_hand_side_descriptors
        self.__left_hand_side = to_sympy_column_matrix(to_sympy_matrix(
                    [plhs.symbol for plhs in left_hand_side_descriptors])
                    )
        self.__right_hand_side = to_sympy_column_matrix(right_hand_side)
        self.__parameters = to_list_of_symbols(parameters)
        self.__method = method
예제 #2
0
파일: model.py 프로젝트: lukauskas/means
    def __init__(self, species, parameters, propensities, stoichiometry_matrix):
        r"""
        Creates a `Model` object that stores the model of reactions we want to analyse
        :param species: variables of the model, as `sympy.Symbol`s, i.e. species
        :param parameters: parameters of the model, as `sympy` symbols
        :param propensities: a matrix of propensities for each of the reaction in the model.
        :param stoichiometry_matrix: stoichiometry matrix for the model
        """
        self.__parameters = to_list_of_symbols(parameters)
        self.__species = to_list_of_symbols(species)
        self.__propensities = to_sympy_column_matrix(to_sympy_matrix(propensities))
        self.__stoichiometry_matrix = to_sympy_matrix(stoichiometry_matrix)

        self.validate()
예제 #3
0
    def __init__(self, species, parameters, propensities,
                 stoichiometry_matrix):
        r"""
        Creates a `Model` object that stores the model of reactions we want to analyse
        :param species: variables of the model, as `sympy.Symbol`s, i.e. species
        :param parameters: parameters of the model, as `sympy` symbols
        :param propensities: a matrix of propensities for each of the reaction in the model.
        :param stoichiometry_matrix: stoichiometry matrix for the model
        """
        self.__parameters = to_list_of_symbols(parameters)
        self.__species = to_list_of_symbols(species)
        self.__propensities = to_sympy_column_matrix(
            to_sympy_matrix(propensities))
        self.__stoichiometry_matrix = to_sympy_matrix(stoichiometry_matrix)

        self.validate()