Example #1
0
    def test_1(self):
        # 2-D system
        # A -> B

        # Test negative conentrations
        Cf0 = sp.array([-1., 0])

        stoich_mat = sp.array([[-1.], [1]])

        with pytest.raises(Exception):
            stoich_S_1D(Cf0, stoich_mat)
Example #2
0
    def test_2(self):
        # 2-D system
        # A -> B

        # Test negative zero
        Cf0 = sp.array([1., -0.0])

        stoich_mat = sp.array([[-1.], [1]])

        assert stoich_S_1D(Cf0, stoich_mat)
Example #3
0
    def test_6(self):
        # A -> B

        # binary system
        Cf0 = sp.array([1., 0])

        stoich_mat = sp.array([[-1., 1]]).T

        Cs, Es = stoich_S_1D(Cf0, stoich_mat)

        Cs_ref = sp.array([[1., 0], [0, 1]])

        Es_ref = sp.array([[0., 1]]).T

        assert (sameRows(Cs, Cs_ref))
        assert (sameRows(Es, Es_ref))
Example #4
0
    def test_1(self):
        # A + B -> C

        # 0-D array feed
        Cf0 = sp.array([1., 1, 0])

        # column vector stoich matrix
        stoich_mat = sp.array([[-1., -1, 1]]).T

        Cs, Es = stoich_S_1D(Cf0, stoich_mat)

        Cs_ref = sp.array([[1., 1, 0], [0, 0, 1]])

        Es_ref = sp.array([[0., 1]]).T

        assert (sameRows(Cs, Cs_ref))
        assert (sameRows(Es, Es_ref))