Esempio n. 1
0
    def test_pt(self, verbose=False):
        spnames = 'N2,O2,C2H4,H2,CO,CO2,H2O'.split(',')
        ceq = pyeq.EqCalculator(spnames)
        Ms = ceq.M
        ceaYs0 = array([0.75,  0.2, 0.05, 0.0, 0.0, 0.0, 0.0])
        ceaXst = {
            'CO': 1.2624e-2,
            'CO2': 8.9029e-2,
            'H2': 2.2749e-3,
            'H2O': 9.9379e-2,
            'N2': 7.6349e-1,
            'O2': 3.3208e-2
        }
        Xst = zeros(len(spnames))
        for k,v in ceaXst.items(): Xst[spnames.index(k)] = v

        Xs0 = molef_from_massf(ceaYs0, Ms)

        T = 2500.0
        p = 2.0*101.325e3

        verbosity = 0
        if verbose:
            print("Computing")
            verbosity=2
        Xs1 = ceq.pt(p, T, Xs0, verbosity)

        if verbose:
            print("Done")
            print("Name  Init      Target    Computed")
            for s,k in enumerate(spnames):
                print('{:>4}: {:1.6f}  {:1.6f}  {:1.6f}'.format(k, Xs0[s], Xst[s], Xs1[s]))
        assert_array_almost_equal(Xs1, Xst, decimal=5)
        return
Esempio n. 2
0
    def test_ps(self):
        spnames = ['N2', 'O2', 'N', 'O', 'NO', 'NO+', 'e-']
        T = 9000.0
        p = 0.1 * 101.35e3
        Xs0 = array(
            [1.2680e-3, 0.0, 7.7128e-1, 2.2490e-1, 2.8465e-5, 1.3e-3, 1.0e-3])
        Xs0 /= (Xs0.sum())
        Xst = array([
            1.2680e-3, 0.0, 7.7128e-1, 2.2490e-1, 2.8465e-5, 1.2625e-3,
            1.2625e-3
        ])
        ceq = pyeq.EqCalculator(spnames)

        Mt = sum(Xst * ceq.M)
        Rt = Ru / Mt
        rhot = p / Rt / T
        nt = 1.0 / Mt
        cst = Xst * rhot / Mt
        nst = Xst / Mt  # also cs/rhot
        nt2 = nst.sum()

        s0 = ceq.get_s0(Xst, T)
        st = ceq.get_s(Xst, T, p)
        pt = p

        Xs1, Teq = ceq.ps(pt, st, Xs0, 0)
        assert_array_almost_equal(Xs1, Xst, decimal=4)
        self.assertAlmostEqual(Teq, T, 0)
Esempio n. 3
0
    def test_ps(self):
        spnames = ['N2', 'O2', 'N', 'O', 'NO']
        T = 2500.0
        p = 0.1 * 101.35e3
        Xs0 = array([0.76, 0.23, 0.0, 0.0, 0.0])
        Xst = array([
            7.48543073e-01, 2.08366049e-01, 7.93468988e-07, 2.07645979e-02,
            2.23254866e-02
        ])
        ceq = pyeq.EqCalculator(spnames)

        Mt = sum(Xst * ceq.M)
        Rt = Ru / Mt
        rhot = p / Rt / T
        nt = 1.0 / Mt
        cst = Xst * rhot / Mt
        nst = Xst / Mt  # also cs/rhot
        nt2 = nst.sum()

        st = ceq.get_s(Xst, T, p)
        pt = p

        Xs1, Teq = ceq.ps(pt, st, Xs0, 0)
        Ys0 = ceq.XtoY(Xs0)
        Ys1 = ceq.XtoY(Xs1)
        Yst = ceq.XtoY(Xst)
        assert_array_almost_equal(Ys1, Yst, decimal=6)
        self.assertAlmostEqual(Teq, T, 4)
Esempio n. 4
0
def stnp(p1, T1, vi, Ys1, pe, pp_on_pe):
    spnames = list(Ys1.keys())
    Y1 = array(list(Ys1.values()))
    print(spnames)

    ceq = pyeq.EqCalculator(spnames)

    Mmix = (Y1 / ceq.M).sum()
    Mmix = Mmix**-1
    X0 = Y1 * Mmix / ceq.M
    print(X0)

    # Shock tube fill condition in incident shock frame (ISF)
    s1_isf = GasState(p=p1, T=T1, v=vi, X0=X0, ceq=ceq)
    print("s1\n", s1_isf, '\n')

    # Compute state 2 in incident shock frame
    start = guess(s1_isf)
    sinfo = root(F, start, args=(s1_isf, ))
    p, T, v = sinfo.x
    s2_isf = GasState(p=p, T=T, v=v, X0=X0, ceq=ceq)
    print("s2_isf\n", s2_isf, '\n')

    # Transform s2 into lab frame
    s2 = copy(s2_isf)
    s2 = s2_isf.new_from_pTv(s2.p, s2.T, s1_isf.v - s2_isf.v)
    print("s2\n", s2, '\n')

    # Compute reflected shock state
    print("s2.M", s2.M)
    start2 = guess(s2)  # Sketchy guess that ignores the reflected velocity
    print('start2 guess', start2)
    sinfo = root(F2, start2, args=(s2, ))
    p, T, v = sinfo.x
    print("F2 pTv", p, T, v)
    s5_dash = GasState(p=p, T=T, v=v, X0=X0, ceq=ceq)

    s5 = copy(s5_dash)
    s5.v = 0.0
    print("s5\n", s5, '\n')

    # Compute relaxed stagnation state
    s5s_X, s5s_T = ceq.ps(pe, s5.s, X0)
    s5s = GasState(pe, s5s_T, 0.0, s5s_X, ceq=ceq)
    print("s5s\n", s5s, '\n')

    # Compute nozzle throat state
    expand_to_M1 = lambda p: (s5s.expand_isentropically_to_p(p)).M - 1.0
    p6 = newton(expand_to_M1, s5s.p / 2.0)
    s6 = s5s.expand_isentropically_to_p(p6)
    print("s6\n", s6, '\n')

    # Compute nozzle exit state
    expand_to_pp_on_pe = lambda p: (s5s.expand_isentropically_to_p(p)
                                    ).pitot_pressure() / s5s.p - pp_on_pe
    p7 = newton(expand_to_pp_on_pe, s5s.p * 0.01)
    s7 = s5s.expand_isentropically_to_p(p7)
    print("s7\n", s7, '\n')
    return [s1_isf, s2, s5, s5s, s6, s7]
Esempio n. 5
0
    def test_thermo(self, verbose=False):
        p = 1.0132 * 1e5
        T = 3698.04
        spnames = ['CO2', 'CO', 'O2']
        Xs0 = array([1.0, 0.0, 0.0])
        ceq = pyeq.EqCalculator(spnames)
        Xs1 = ceq.pt(p, T, Xs0)

        ceaoutput = """
        THERMODYNAMIC PROPERTIES

        P, BAR            1.0132
        T, K             3698.04
        RHO, KG/CU M   1.0265e-1
        H, KJ/KG          576.89
        U, KJ/KG         -410.21
        G, KJ/KG        -35107.3
        S, KJ/(KG)(K)     9.6495

        M, (1/n)          31.149
        (dLV/dLP)t      -1.02399
        (dLV/dLT)p        1.4203
        Cp, KJ/(KG)(K)    3.3065
        GAMMAs            1.1612
        SON VEL,M/SEC     1070.6

        MOLE FRACTIONS

        *CO            5.8443e-1
        *CO2           1.2336e-1
        *O2            2.9221e-1
        """
        ceadata = [i.strip().split('  ') for i in ceaoutput.splitlines()]
        ceadata = dict([(i[0], float(i[-1])) for i in ceadata if len(i) > 2])
        ceaXs1 = array([ceadata['*CO2'], ceadata['*CO'], ceadata['*O2']])
        ceqdata = {}
        ceqdata['h'] = ceq.get_h(Xs1, T)
        ceqdata['u'] = ceq.get_u(Xs1, T)
        ceqdata['s'] = ceq.get_s(Xs1, T, p)

        self.assertAlmostEqual(ceqdata['h'] / 1000.0, ceadata['H, KJ/KG'], 1)
        self.assertAlmostEqual(ceqdata['u'] / 1000.0, ceadata['U, KJ/KG'], 1)
        self.assertAlmostEqual(ceqdata['s'] / 1000.0, ceadata['S, KJ/(KG)(K)'],
                               4)

        if verbose:
            print("          ceq    |   cea")
            print("XCO2:   {:8f} |   {:8f} ".format(Xs1[0], ceaXs1[0]))
            print("XCO:    {:8f} |   {:8f} ".format(Xs1[1], ceaXs1[1]))
            print("XO2:    {:8f} |   {:8f} ".format(Xs1[2], ceaXs1[2]))
            print("h:    {:8f} | {:8f}  (kJ/kg)".format(
                ceqdata['h'] / 1000.0, ceadata['H, KJ/KG']))
            print("u:   {:8f} |{:8f}  (kJ/kg)".format(ceqdata['u'] / 1000.0,
                                                      ceadata['U, KJ/KG']))
            print("s:      {:8f} |   {:8f}  (kJ/kg/K)".format(
                ceqdata['s'] / 1000.0, ceadata['S, KJ/(KG)(K)']))
Esempio n. 6
0
    def test_pt(self, verbose=False):
        spnames = ['CO2', 'CO', 'O2']
        p = 0.1 * 101.35e3
        T = 2500.0
        Xs0 = array([1.0, 0.0, 0.0])

        ceq = pyeq.EqCalculator(spnames)
        Xcea1 = get_cea_test(p, T, spnames)
        Xs1 = ceq.pt(p, T, Xs0)
        assert_array_almost_equal(Xs1, Xcea1, decimal=4)
Esempio n. 7
0
    def test_pt(self):
        spnames = ['CO2', 'CO', 'O2']
        T = 2500.0
        p = 0.1*101.35e3
        Xs0 = array([1.0, 0.0, 0.0])
        Xst = array([0.66010397,  0.22659735,  0.11329868])
        #Xst = array([0.66108962603325838,0.22594024931116111,0.11297012465558055])
        ceq = pyeq.EqCalculator(spnames)

        Xs1 = ceq.pt(p, T, Xs0, 0)
        assert_array_almost_equal(Xs1, Xst, decimal=8)
        return
Esempio n. 8
0
    def test_pt(self, verbose=False):
        spnames = 'N2,O2,C2H4,H2,CO,CO2,H2O'.split(',')

        T = 1002.331078
        p = 103646.317525
        Xs0 = zeros(len(spnames))
        Xs0[0] = 7.365595e-01
        Xs0[1] = 1.974860e-01
        Xs0[2] = 6.524246e-02
        Xs0[3] = 1.929575e-04
        Xs0[4] = 2.052274e-04
        Xs0[5] = 3.009164e-04
        Xs0[6] = 1.292129e-05

        Xst = zeros(len(spnames))
        Xst[0] = 7.3671e-1
        Xst[1] = 1.5598e-3
        Xst[2] = 0.0
        Xst[3] = 0.0
        Xst[4] = 0.0
        Xst[5] = 1.3102e-1
        Xst[6] = 1.3072e-1

        ceq = pyeq.EqCalculator(spnames)

        a = ceq.a
        M = ceq.M
        nel = ceq.nel
        nsp = ceq.nsp

        aij = a.reshape(nel, nsp).copy()
        Mmix = sum(Xs0 * M)
        n0 = sum(Xs0 / Mmix)
        ns0 = Xs0 / Mmix
        bi0 = (aij * ns0).sum(axis=1)

        verbosity = 0
        if verbose: verbosity = 2
        Xs1 = ceq.pt(p, T, Xs0, verbosity)

        if verbose:
            print("Name  Init       Target     Computed   Diff")
            for s, k in enumerate(spnames):
                print('{:>4}: {:1.6f}   {:1.6f}   {:1.6f}   {:1.6e}'.format(
                    k, Xs0[s], Xst[s], Xs1[s], abs(Xs1[s] - Xst[s])))

        assert_array_almost_equal(Xs1, Xst, decimal=5)
        Mmix = sum(Xs1 * M)
        n1 = sum(Xs1 / Mmix)
        ns1 = Xs1 / Mmix
        bi1 = (aij * ns1).sum(axis=1)
        assert_array_almost_equal(bi0, bi1, decimal=8)
        return
Esempio n. 9
0
    def test_pt(self, verbose=False):
        spnames = 'N2,O2,C2H4,H2,CO,CO2,H2O'.split(',')
        T = 1024.278824
        p = 147514.463716
        Xs0 = zeros(len(spnames))
        Xs0[0] = 0.711202
        Xs0[1] = 0.033864
        Xs0[2] = 0.000046
        Xs0[3] = 0.010316
        Xs0[4] = 0.057133
        Xs0[5] = 0.070316
        Xs0[6] = 0.117124

        Xst = zeros(len(spnames))
        Xst[0] = 7.3602e-1
        Xst[1] = 0.0
        Xst[2] = 0.0
        Xst[3] = 0.0
        Xst[4] = 0.0
        Xst[5] = 1.3199e-1
        Xst[6] = 1.3198e-1

        ceq = pyeq.EqCalculator(spnames)

        a = ceq.a
        M = ceq.M
        nel = ceq.nel
        nsp = ceq.nsp

        aij = a.reshape(nel, nsp).copy()
        Mmix = sum(Xs0 * M)
        n0 = sum(Xs0 / Mmix)
        ns0 = Xs0 / Mmix
        bi0 = (aij * ns0).sum(axis=1)

        verbosity = 0
        if verbose: verbosity = 1
        Xs1 = ceq.pt(p, T, Xs0, verbosity)

        if verbose:
            print("Done (Fixed conditions @ p={:1.6f} T={:1.6f})".format(p, T))
            print("Name  Init       Computed   Diff")
            for s, k in enumerate(spnames):
                print('{:>4}: {:1.6f}   {:1.6f}   {:1.6e}'.format(
                    k, Xs0[s], Xs1[s], abs(Xs1[s] - Xs0[s])))

        assert_array_almost_equal(Xs1, Xst, decimal=4)
        Mmix = sum(Xs1 * M)
        n1 = sum(Xs1 / Mmix)
        ns1 = Xs1 / Mmix
        bi1 = (aij * ns1).sum(axis=1)
        assert_array_almost_equal(bi0, bi1, decimal=8)
        return
Esempio n. 10
0
    def test_pt(self, verbose=False):
        spnames = 'N2,O2,C2H4,H2,CO,CO2,H2O'.split(',')

        T = 300.0
        p = 100000.0
        Xs0 = zeros(len(spnames))
        Xs0[0] = 0.79
        Xs0[1] = 0.21
        Xs0[2] = 0.0
        Xs0[3] = 0.0
        Xs0[4] = 0.0
        Xs0[5] = 0.0
        Xs0[6] = 0.0

        Xst = zeros(len(spnames))
        Xst[0] = 0.79
        Xst[1] = 0.21
        Xst[2] = 0.0
        Xst[3] = 0.0
        Xst[4] = 0.0
        Xst[5] = 0.0
        Xst[6] = 0.0
        ceq = pyeq.EqCalculator(spnames)

        a = ceq.a
        M = ceq.M
        nel = ceq.nel
        nsp = ceq.nsp

        aij = a.reshape(nel, nsp).copy()
        Mmix = sum(Xs0 * M)
        n0 = sum(Xs0 / Mmix)
        ns0 = Xs0 / Mmix
        bi0 = (aij * ns0).sum(axis=1)

        verbosity = 0
        if verbose: verbosity = 2
        Xs1 = ceq.pt(p, T, Xs0, verbosity)

        if verbose:
            print("Name  Init       Target     Computed   Diff")
            for s, k in enumerate(spnames):
                print('{:>4}: {:1.6f}   {:1.6f}   {:1.6f}   {:1.6e}'.format(
                    k, Xs0[s], Xst[s], Xs1[s], abs(Xs1[s] - Xst[s])))

        assert_array_almost_equal(Xs1, Xst, decimal=5)
        Mmix = sum(Xs1 * M)
        n1 = sum(Xs1 / Mmix)
        ns1 = Xs1 / Mmix
        bi1 = (aij * ns1).sum(axis=1)
        assert_array_almost_equal(bi0, bi1, decimal=8)
        return
Esempio n. 11
0
    def test_rhot(self):
        spnames = ['CO2', 'CO', 'O2']
        T = 2500.0
        p = 0.1*101.35e3
        Xs0 = array([1.0, 0.0, 0.0])
        Xst = array([0.66010397,  0.22659735,  0.11329868])
        ceq = pyeq.EqCalculator(spnames)

        Mt = sum(Xst*ceq.M)
        Rt = Ru/Mt
        rhot = p/Rt/T

        Xs1 = ceq.rhot(rhot, T, Xs0, 0)
        assert_array_almost_equal(Xs1, Xst, decimal=7) # Seven?
        return
Esempio n. 12
0
    def test_pt(self):
        spnames = ['N2', 'O2', 'N', 'O', 'NO', 'NO+', 'e-']
        T = 9000.0
        p = 0.1 * 101.35e3
        Xs0 = array(
            [1.2680e-3, 0.0, 7.7128e-1, 2.2490e-1, 2.8465e-5, 1.3e-3, 1.0e-3])
        Xs0 /= (Xs0.sum())
        Xst = array([
            1.2680e-3, 0.0, 7.7128e-1, 2.2490e-1, 2.8465e-5, 1.2625e-3,
            1.2625e-3
        ])
        ceq = pyeq.EqCalculator(spnames)

        Xs1 = ceq.pt(p, T, Xs0, 0)
        assert_array_almost_equal(Xs1, Xst, decimal=4)
        return
Esempio n. 13
0
    def test_u(self):
        spnames = ['CO2', 'CO', 'O2']
        ceq = pyeq.EqCalculator(spnames)

        T = array([2500.0, 2200.0])
        Xs0 = array([[0.7, 0.2, 0.1],
                     [0.7, 0.2, 0.1]])
        ut = zeros(T.shape)
        np,ns = Xs0.shape

        for i in range(np):
            Xs0i = Xs0[i].copy()
            Ti = T[i]
            ut[i] = ceq.get_u(Xs0i, Ti)

        u = ceq.batch_u(Xs0, T)
        assert_array_almost_equal(u, ut)
        return
Esempio n. 14
0
    def test_11_sp(self):
        spnames = [
            'N2', 'N2+', 'NO', 'NO+', 'O2', 'O2+', 'N', 'N+', 'O', 'O+', 'e-'
        ]
        T = 9000.0
        p = 0.1 * 101.35e3
        Xs0 = array([0.77, 0.0, 0.0, 0.0, 0.23, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])
        Xs0 /= (Xs0.sum())
        ceq = pyeq.EqCalculator(spnames)
        Xst = array([
            1.12808714e-03, 1.66990829e-05, 2.62323131e-05, 5.67521824e-05,
            3.98415990e-07, 1.05942060e-07, 7.27382202e-01, 2.12663187e-02,
            2.19710628e-01, 4.53634979e-03, 2.58762257e-02
        ])

        Xs1 = ceq.pt(p, T, Xs0, 0)
        print("Ys1: ", ceq.XtoY(Xs1))
        print("Xs1: ", dict(zip(spnames, Xs1)))
        assert_array_almost_equal(Xs1, Xst, decimal=8)
Esempio n. 15
0
    def test_pt(self, verbose=False):
        spnames = 'N2,O2,C2H4,H2,CO,CO2,H2O'.split(',')
        T = 1253.579055
        p = 154800.574538
        Xs0 = zeros(len(spnames))
        Xs0[0] = 7.882249e-01
        Xs0[1] = 2.114530e-01
        Xs0[2] = 1.683690e-10
        Xs0[3] = 5.046495e-12
        Xs0[4] = 5.081258e-12
        Xs0[5] = 3.220202e-04
        Xs0[6] = 4.257038e-14

        ceq = pyeq.EqCalculator(spnames)
        a = ceq.a
        M = ceq.M
        nel = ceq.nel
        nsp = ceq.nsp

        aij = a.reshape(nel, nsp).copy()
        Mmix = sum(Xs0 * M)
        n0 = sum(Xs0 / Mmix)
        ns0 = Xs0 / Mmix
        bi0 = (aij * ns0).sum(axis=1)

        verbosity = 0
        if verbose: verbosity = 2
        Xs1 = ceq.pt(p, T, Xs0, verbosity)

        if verbose:
            print("Name  Init       Computed   Diff")
            for s, k in enumerate(spnames):
                print('{:>4}: {:1.6f}   {:1.6f}   {:1.6e}'.format(
                    k, Xs0[s], Xs1[s], abs(Xs1[s] - Xs0[s])))

        assert_array_almost_equal(Xs1, Xs0, decimal=6)
        Mmix = sum(Xs1 * M)
        n1 = sum(Xs1 / Mmix)
        ns1 = Xs1 / Mmix
        bi1 = (aij * ns1).sum(axis=1)
        assert_array_almost_equal(bi0, bi1, decimal=6)
        return
Esempio n. 16
0
    def test_pt(self):
        spnames = ['N2', 'O2', 'N', 'O', 'NO']
        T = 2500.0
        p = 0.1 * 101.35e3
        Xs0 = array([0.76, 0.23, 0.0, 0.0, 0.0])
        Xst = array([
            7.48543073e-01, 2.08366049e-01, 7.93468988e-07, 2.07645979e-02,
            2.23254866e-02
        ])

        ceq = pyeq.EqCalculator(spnames)

        Xs1 = ceq.pt(p, T, Xs0, 0)
        Ys0 = ceq.XtoY(Xs0)
        Ys1 = ceq.XtoY(Xs1)
        Yst = ceq.XtoY(Xst)
        assert_array_almost_equal(Ys1, Yst, decimal=6)
        #print("Done Y:   ", Ys1)
        #print("Target Y: ", Yst)
        return
Esempio n. 17
0
    def test_pt(self):
        spnames = ['CO2', 'CO', 'O2']
        ceq = pyeq.EqCalculator(spnames)

        T = array([2500.0, 2000.0])
        p = array([0.1*101.35e3, 1.0*101.35e3])
        Xs0 = array([[1.0, 0.0, 0.0],
                     [1.0, 0.0, 0.0]])
        Xst = zeros(Xs0.shape)
        np,ns = Xs0.shape

        for i in range(np):
            Xs0i = Xs0[i].copy()
            Ti = T[i]
            pi = p[i]
            Xs1i = ceq.pt(pi, Ti, Xs0i)
            Xst[i,:] = Xs1i[:]

        Xs1 = ceq.batch_pt(p, T, Xs0, 0)
        assert_array_almost_equal(Xs1, Xst)
        return
Esempio n. 18
0
    def test_rhou(self):
        spnames = ['CO2', 'CO', 'O2']
        T = 2500.0
        p = 0.1*101.35e3
        Xs0 = array([1.0, 0.0, 0.0])
        Xst = array([0.66010397,  0.22659735,  0.11329868])
        ceq = pyeq.EqCalculator(spnames)

        Mt = sum(Xst*ceq.M)
        Rt = Ru/Mt
        rhot = p/Rt/T
        nt = 1/Mt
        cst = Xst*rhot/Mt
        nst = Xst/Mt # also cs/rhot 
        nt2 = nst.sum()

        ut = ceq.get_u(Xst, T)

        Xs1, Teq = ceq.rhou(rhot, ut, Xs0, 0)
        assert_array_almost_equal(Xs1, Xst, decimal=8)
        self.assertAlmostEqual(Teq, T, 4)
        return
Esempio n. 19
0
    def test_rhou(self):
        spnames = ['CO2', 'CO', 'O2']
        ceq = pyeq.EqCalculator(spnames)

        u  = array([-5e6, -4.5e6])
        rho= array([0.019, 0.025])
        Xs0 = array([[1.0, 0.0, 0.0],
                     [1.0, 0.0, 0.0]])
        Xst = zeros(Xs0.shape)
        Tt = zeros(rho.shape)
        np,ns = Xs0.shape

        for i in range(np):
            Xs0i = Xs0[i].copy()
            ui = u[i]
            rhoi = rho[i]
            Xs1i, Ti = ceq.rhou(rhoi, ui, Xs0i)
            Xst[i,:] = Xs1i[:]
            Tt[i] = Ti

        Xs1, T = ceq.batch_rhou(rho, u, Xs0, 0)
        assert_array_almost_equal(Xs1, Xst)
        assert_array_almost_equal(T, Tt)
        return
Esempio n. 20
0
        numbers = ' | '.join('{:.6e} {:.6e}'.format(*i) for i in zip(X1i, X2i))
        start = '{:7.2f} K : '.format(Ti)
        line = start + numbers
        print(line)

    print(" ")
    return


if __name__ == '__main__':
    ps = [0.1 * 101.35e3, 1.0 * 101.35e3]
    Ts = linspace(301.0, 4000.0, 50)
    spnames = ['CO2', 'CO', 'O2']
    Xs0 = array([1.0, 0.0, 0.0])

    ceq = pyeq.EqCalculator(spnames)
    linecolours = ['red', 'blue', 'black']
    linestyles = ['-', '--']
    markers = ['o', 'v']
    lines = []

    for i, p in enumerate(ps):
        print("p", p)
        pi = zeros(Ts.shape)
        pi[:] = p
        Xs0i = zeros((Ts.size, Xs0.size))
        Xs0i[:, :] = Xs0
        Xs1i = ceq.batch_pt(pi, Ts, Xs0i)

        icea = list(range(0, 50, int(50 / 3) - 1))
        Tcea = Ts[icea]