Exemple #1
0
def test_degrees_of_freedom(model):
    """
    Show degrees of freedom of the S-Matrix.

    This test will return the degrees of freedom, i.e. "free variables" of the
    S-Matrix.

    This test is not scored, as the degrees of freedom depends on S-Matrix
    constructed, which is system-specific.
    """
    ann = test_degrees_of_freedom.annotation
    ann["data"] = matrix.degrees_of_freedom(model)
    ann["message"] = wrapper.fill(
        """The degrees of freedom of the S-Matrix is {}.""".format(
            ann["data"]))
Exemple #2
0
def test_degrees_of_freedom(model):
    """
    Show the degrees of freedom of the stoichiometric matrix.

    The degrees of freedom of the stoichiometric matrix, i.e., the number
    of 'free variables' is system specific and corresponds to the dimension
    of the (right) null space of the matrix.

    Implementation:
    Compose the stoichiometric matrix, then calculate the dimensionality of the
    null space using the rank-nullity theorem outlined by
    Alama, J. The Rank+Nullity Theorem. Formalized Mathematics 15, (2007).

    """
    ann = test_degrees_of_freedom.annotation
    ann["data"] = matrix.degrees_of_freedom(model)
    # Report the degrees of freedom scaled by the number of reactions.
    ann["metric"] = ann["data"] / len(model.reactions)
    ann["message"] = wrapper.fill(
        """The degrees of freedom of the S-Matrix are {}.""".format(
            ann["data"]))
Exemple #3
0
def test_degrees_of_freedom(model, num):
    assert matrix.degrees_of_freedom(model) == num