Commit JT 010318 (before APS)

This commit is contained in:
julient31
2018-03-01 09:03:20 -07:00
parent 7990826ca2
commit e4c6c46b4c
10 changed files with 6143 additions and 24 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
#Program fitting the exchange interaction
#Model curve: Bethe-Slater function
import numpy as np, pylab, tkinter
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from decimal import *
print("Loop begin")
#Definition of the Bethe-Slater function
def func(x,a,b,c):
return 4*a*((x/c)**2)*(1-b*(x/c)**2)*np.exp(-(x/c)**2)
#Exchange coeff table (data to fit)
rdata, Jdata = np.loadtxt('exchange_hcp_co.dat', usecols=(0,1), unpack=True)
plt.plot(rdata, Jdata, 'b-', label='data')
#Perform the fit
popt, pcov = curve_fit(func, rdata, Jdata, bounds=(0, [500.,5.,5.]))
plt.plot(rdata, func(rdata, *popt), 'r--', label='fit')
#Print the fitted params
print("Parameters: a={:.10} (in meV), b={:.10} (adim), c={:.10} (in Ang)".format(*popt))
#Ploting the result
plt.xlabel('r_ij')
pylab.xlim([0,6.5])
plt.ylabel('J_ij')
plt.legend()
plt.show()
print("Loop end")

View File

@ -0,0 +1,9 @@
2.25569176882662 73.37931034482759
2.3817863397548162 47.99999999999999
2.4518388791593697 34.39080459770115
2.507880910683012 31.816091954022987
2.5359019264448337 28.137931034482747
2.5779334500875657 25.011494252873554
2.6339754816112086 19.126436781609186
2.760070052539404 13.241379310344826
3.5446584938704033 6.068965517241367

View File

@ -0,0 +1,60 @@
# fcc cobalt in a 3d periodic box
clear
units metal
atom_style spin
dimension 3
boundary p p p
# check why?
atom_modify map array
#lattice hcp 2.5071 2.5071 4.0695
lattice hcp 2.5071
region box block 0.0 5.0 0.0 5.0 0.0 5.0
create_box 1 box
create_atoms 1 box
# setting mass, mag. moments, and interactions for cobalt
mass 1 58.93
set group all spin/random 31 1.72
velocity all create 100 4928459 rot yes dist gaussian
#pair_style hybrid/overlay eam/alloy pair/spin/exchange 4.0 pair/spin/soc/neel 4.0
pair_style hybrid/overlay eam/alloy pair/spin/exchange 4.0
pair_coeff * * eam/alloy ../examples/SPIN/cobalt_hcp/Co_PurjaPun_2012.eam.alloy Co
pair_coeff * * pair/spin/exchange exchange 4.0 0.3593 1.135028015e-05 1.064568567
#pair_coeff * * pair/spin/soc/neel neel 4.0 0.0048 0.234 1.168 2.6905 0.705 0.652
neighbor 0.1 bin
neigh_modify every 10 check yes delay 20
fix 1 all force/spin zeeman 0.01 0.0 0.0 1.0
fix 2 all langevin/spin 0.0 0.0 21
fix 3 all integration/spin lattice yes
timestep 0.0001
compute out_mag all compute/spin
compute out_pe all pe
compute out_ke all ke
compute out_temp all temp
variable magz equal c_out_mag[3]
variable magnorm equal c_out_mag[4]
variable emag equal c_out_mag[5]
variable tmag equal c_out_mag[6]
variable mag_force equal f_1
thermo_style custom step time v_magnorm v_emag temp etotal
thermo 10
dump 1 all custom 50 dump_cobalt.lammpstrj type x y z spx spy spz
run 1000