Skip to content
Snippets Groups Projects
Commit 1392064c authored by Simon Sebastian Humpohl's avatar Simon Sebastian Humpohl
Browse files

Split notebook in genmeration and analysis

parent e1d20b83
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:b115b402-4588-49a0-b984-e8983488aebc tags:
# Data analysis
%% Cell type:code id:3df6f25e-a136-4524-8081-96524ed88848 tags:
``` python
import xarray as xr
lj_data = xr.load_dataset('lj_data.ndf')
emt_data = xr.load_dataset('emt_data.ndf')
all_data = xr.concat([lj_data, emt_data], xr.Variable('Method', ['LennardJones', 'EMT']))
```
%% Cell type:code id:d9a52cce-24aa-4286-9732-6c772389425a tags:
``` python
all_data
```
%% Cell type:code id:c5c696be-1713-4cd0-8cdf-bf890af3156b tags:
``` python
lj_data['Energy'].loc[..., 'Al', :].plot.line(x='lattice_constant')
```
%% Cell type:code id:4a51b954-c2ed-4f94-a7a6-35a45254f8c3 tags:
``` python
```
%% Cell type:markdown id:136f209c-91a7-4a11-8386-ef5535eeba9a tags:
%% Cell type:markdown id:524f1ba2-39ab-40a9-9cab-dd170c39bf16 tags:
# Data generation
Create a virtual environment with the correct
%% Cell type:code id:e18e2f2d-e0da-43eb-b378-2b617dbb73fa tags:
``` python
import simulation
import numpy as np
materials = ['Au', 'Ag', 'Al', 'Cu', 'Ni']
lattice_constants = np.linspace(3.0, 4.5, 100)
```
%% Cell type:code id:eaa1b986-1329-491d-850f-4d5edefe5b14 tags:
``` python
emt_data = simulation.simulate_multi(
materials = materials,
lattice_constants = lattice_constants, # Ångstroms
calculator='EMT',
pool_size=None,
)
emt_data.to_netcdf('emt_data.ndf')
emt_df = emt_data.to_dataframe()
emt_df.to_csv('emt_data.csv')
```
%% Cell type:code id:36aac675-21f5-4c7b-b225-416c3681b0b8 tags:
``` python
lj_data = simulation.simulate_multi(
materials = materials,
lattice_constants = lattice_constants, # Ångstroms
calculator='LennardJones',
)
lj_data.to_netcdf('lj_data.ndf')
lj_df = lj_data.to_dataframe()
lj_df.to_csv('lj_data.csv')
```
%% Cell type:markdown id:f7a5a554-26ce-4695-aa37-c787df57268d tags:
# Data analysis
%% Cell type:code id:941fe208-519d-4c9f-ab6d-1d973181c66f tags:
``` python
```
%% Cell type:code id:028e3710-8ab2-44c6-809b-f7b1ae1a3e98 tags:
%% Cell type:code id:54f57a76-f131-459f-98d0-f16b5b59b297 tags:
``` python
```
......
numpy==1.25
ase==3.22.1
xarray==2024.2.0
ipympl==0.9.3
h5netcdf==1.3.0
\ No newline at end of file
......@@ -7,12 +7,14 @@ import xarray as xr
from ase.build import bulk
from ase.calculators.emt import EMT
from ase.calculators.lj import LennardJones
from ase.calculators.eam import EAM
CALCULATORS = {
# Effective Medium Theory
'EMT': EMT,
# LennardJones potential
'LennardJones': LennardJones,
'EAM': EAM,
}
def simulate_properties(material, lattice_constant, calculator: Literal['EMT', 'EAM']):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment