Exemplo n.º 1
0
    def eos_fit(self, eos_name="murnaghan"):
        """
        Fit E(V)
        For the list of available models, see EOS.MODELS

        TODO: which default? all should return a list of fits
        """
        # Read volumes and energies from the GSR files.
        energies, volumes = [], []
        for label, gsr in self:
            energies.append(gsr.energy)
            volumes.append(gsr.structure.volume)

        # Note that eos.fit expects lengths in Angstrom, and energies in eV.
        if eos_name != "all":
            return EOS(eos_name=eos_name).fit(volumes, energies)
        else:
            # Use all the available models.
            fits, rows = [], []
            for eos_name in EOS.MODELS:
                fit = EOS(eos_name=eos_name).fit(volumes, energies)
                fits.append(fit)
                rows.append(fit.results)

            frame = pd.DataFrame(rows,
                                 index=EOS.MODELS,
                                 columns=rows[0].keys())
            return fits, frame
Exemplo n.º 2
0
    def OnFitButton(self, event):
        model = self.model_choice.GetStringSelection()

        try:
            eos = EOS(eos_name=model)
            fit = eos.fit(self.volumes, self.energies, vol_unit=self.vol_unit, ene_unit=self.ene_unit)
            print(fit)
            fit.plot()

        except:
            awx.showErrorMessage(self)
Exemplo n.º 3
0
Arquivo: eos.py Projeto: gmrigna/abipy
    def OnFitButton(self, event):
        model = self.model_choice.GetStringSelection()

        try:
            eos = EOS(eos_name=model)
            fit = eos.fit(self.volumes, self.energies, vol_unit=self.vol_unit, ene_unit=self.ene_unit)
            print(fit)
            fit.plot()

        except:
            awx.showErrorMessage(self)
Exemplo n.º 4
0
 def analyze_eos_flow(flow, **kwargs):
     work = flow[0]
     etotals = work.read_etotals(unit="eV")
     eos_fit = EOS.Birch_Murnaghan().fit(flow.volumes, etotals)
     return eos_fit.plot(**kwargs)
Exemplo n.º 5
0
 def test_fit(self):
     """Test EOS fit"""
     for eos_name in EOS.MODELS:
         eos = EOS(eos_name=eos_name)
         fit = eos.fit(self.volumes, self.energies)
         print(fit)
Exemplo n.º 6
0
 def test_fit(self):
     "Test EOS fit"
     for eos_name in EOS.functions:
         eos = EOS(eos_name=eos_name)
         fit = eos.fit(self.volumes, self.energies)
         print(fit)
Exemplo n.º 7
0
 def test_fit(self):
     """Test EOS fit"""
     for eos_name in EOS.MODELS:
         eos = EOS(eos_name=eos_name)
         fit = eos.fit(self.volumes, self.energies)
         print(fit)
Exemplo n.º 8
0
 def test_fit(self):
     "Test EOS fit"
     for eos_name in EOS.functions:
         eos = EOS(eos_name=eos_name)
         fit = eos.fit(self.volumes, self.energies)
         print(fit)