Пример #1
0
                          T_high=3500.,
                          model=H2_statmech)
# Compare the statistical mechanical model to the empirical model
f3, ax3 = H2_nasa.plot_statmech_and_empirical(Cp_units='J/mol/K',
                                              H_units='kJ/mol',
                                              S_units='J/mol/K',
                                              G_units='kJ/mol')
f3.set_size_inches(6, 8)
f3.set_dpi(150)
plt.show()

# In[7]:

from pmutt.empirical.shomate import Shomate

H2_shomate = Shomate.from_model(model=H2_nasa)

# Compare the statistical mechanical model to the empirical model
f3, ax3 = H2_shomate.plot_statmech_and_empirical(Cp_units='J/mol/K',
                                                 H_units='kJ/mol',
                                                 S_units='J/mol/K',
                                                 G_units='kJ/mol')
f3.set_size_inches(6, 8)
f3.set_dpi(150)
plt.show()

# The ``Shomate`` is a simpler polynomial than the ``Nasa`` polynomial so it does not capture the features as well for the large T range. It is always a good idea to check your fit.

# <a id='section_5'></a>

# # 5. Input/Output
    def setUp(self):
        unittest.TestCase.setUp(self)
        self.Shomate_direct = Shomate(name='H2O',
                                      elements={
                                          'H': 2,
                                          'O': 1
                                      },
                                      a=np.array([
                                          30.09200, 6.832514, 6.793435,
                                          -2.534480, 0.082139, -250.8810,
                                          223.3967, -241.8264
                                      ]),
                                      T_low=500.,
                                      T_high=1700.)

        self.Shomate_direct_dict = {
            'class':
            "<class 'pmutt.empirical.shomate.Shomate'>",
            'name':
            'H2O',
            'phase':
            None,
            'elements': {
                'H': 2,
                'O': 1
            },
            'a': [
                30.09200, 6.832514, 6.793435, -2.534480, 0.082139, -250.8810,
                223.3967, -241.8264
            ],
            'T_low':
            500.,
            'T_high':
            1700.,
            'notes':
            None,
            'model':
            None,
            'misc_models':
            None,
            'smiles':
            None,
            'type':
            'shomate',
            'units':
            'J/mol/K'
        }

        self.Shomate_data = Shomate.from_data(
            name='H2O',
            elements={
                'H': 2,
                'O': 1
            },
            phase='g',
            T=np.array([
                500., 525., 550., 575., 600., 625., 650., 675., 700., 725.,
                750., 775., 800., 825., 850., 875., 900., 925., 950., 975.,
                1000., 1025., 1050., 1075., 1100., 1125., 1150., 1175., 1200.,
                1225., 1250., 1275., 1300., 1325., 1350., 1375., 1400., 1425.,
                1450., 1475., 1500., 1525., 1550., 1575., 1600., 1625., 1650.,
                1675., 1700.
            ]),
            CpoR=np.array([
                4.235796744, 4.267598139, 4.300310233, 4.333821197,
                4.368036178, 4.402873306, 4.438260758, 4.474134568,
                4.510436977, 4.547115164, 4.584120285, 4.621406707,
                4.658931423, 4.696653576, 4.734534089, 4.772535363,
                4.810621034, 4.848755777, 4.886905141, 4.925035419,
                4.963113539, 5.001106966, 5.038983636, 5.07671188, 5.114260381,
                5.151598119, 5.18869434, 5.225518516, 5.262040323, 5.298229611,
                5.334056387, 5.369490794, 5.404503098, 5.439063673, 5.47314299,
                5.506711603, 5.539740144, 5.572199316, 5.604059881,
                5.635292657, 5.665868512, 5.695758359, 5.724933152,
                5.753363882, 5.781021572, 5.807877279, 5.833902083,
                5.859067093, 5.883343439
            ]),
            T_ref=298.,
            HoRT_ref=-97.55170383,
            SoR_ref=22.71163786)

        self.Shomate_statmech = Shomate.from_model(
            name='H2O',
            elements={
                'H': 2,
                'O': 1
            },
            phase='g',
            model=StatMech,
            trans_model=trans.FreeTrans,
            n_degrees=3,
            vib_model=vib.HarmonicVib,
            elec_model=elec.GroundStateElec,
            rot_model=rot.RigidRotor,
            potentialenergy=-14.2209,
            atoms=molecule('H2O'),
            symmetrynumber=2,
            spin=0,
            vib_wavenumbers=np.array([0.47462, 0.46033, 0.19633]),
            T_low=500.,
            T_high=1700.)
        self.mw = get_molecular_weight({'H': 2, 'O': 1})  # g/mol