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
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)
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)
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)
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)