Commit 0c0b1069 authored by julient31's avatar julient31
Browse files

Commit2 JT 051519

- started doc pair_spin_dipole.txt
- renamed all pair/spin/dipole
- created and tested example pair/spin/dipole/cut
parent 31789ad0
Loading
Loading
Loading
Loading
+16 −28
Original line number Diff line number Diff line
@@ -12,48 +12,36 @@ pair_style spin/dipole/long/qsymp command :h3

[Syntax:]

pair_style lj/cut/dipole/cut cutoff (cutoff2)
pair_style lj/sf/dipole/sf cutoff (cutoff2)
pair_style lj/cut/dipole/long cutoff (cutoff2)
pair_style lj/long/dipole/long flag_lj flag_coul cutoff (cutoff2) :pre

cutoff = global cutoff LJ (and Coulombic if only 1 arg) (distance units) :ulb,l
cutoff2 = global cutoff for Coulombic and dipole (optional) (distance units) :l
flag_lj = {long} or {cut} or {off} :l
  {long} = use long-range damping on dispersion 1/r^6 term
  {cut} = use a cutoff on dispersion 1/r^6 term
  {off} = omit disperion 1/r^6 term entirely :pre
flag_coul = {long} or {off} :l
  {long} = use long-range damping on Coulombic 1/r and point-dipole terms
  {off} = omit Coulombic and point-dipole terms entirely :pre
pair_style spin/dipole/cut cutoff 
pair_style spin/dipole/long cutoff
pair_style spin/dipole/long/qsymp cutoff :pre

cutoff = global cutoff for Magnetic dipole energy and forces
(optional) (distance units) :ulb,l
:ule

[Examples:]

pair_style lj/cut/dipole/cut 10.0
pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre
pair_style spin/dipole/cut 10.0
pair_coeff * * 10.0 
pair_coeff 2 3 8.0 :pre

pair_style lj/sf/dipole/sf 9.0
pair_style spin/dipole/long 9.0
pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0 scale 0.5
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre

pair_style lj/cut/dipole/long 10.0
pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre

pair_style lj/long/dipole/long long long 3.5 10.0
pair_style spin/dipole/long/qsymp 10.0
pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre

[Description:]

Style {lj/cut/dipole/cut} computes interactions between pairs of particles
that each have a charge and/or a point dipole moment.  In addition to
the usual Lennard-Jones interaction between the particles (Elj) the
charge-charge (Eqq), charge-dipole (Eqp), and dipole-dipole (Epp)
interactions are computed by these formulas for the energy (E), force
Style {spin/dipole/cut} computes a short-range dipole-dipole
interactions between pairs of magnetic particles that each 
have a magnetic spin. 
The magnetic dipole-dipole interactions are computed by the
following formulas for the energy (E), force
(F), and torque (T) between particles I and J.

:c,image(Eqs/pair_dipole.jpg)
+15009 −0

File added.

Preview size limit exceeded, changes collapsed.

+5 −0
Original line number Diff line number Diff line
2.4824 0.01948336
2.8665 0.01109
4.0538 -0.0002176
4.753 -0.001714
4.965 -0.001986
+32 −0
Original line number Diff line number Diff line
#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_bcc_iron.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")
+19 −0
Original line number Diff line number Diff line
            6            8
 Optimal parameter set
            1    4.100199340884814       F
            2    1.565647547483517       F
            1   0.9332056681088162       T    3.000000000000000     
            2   -1.162558782567700       T    2.866666666666670     
            3  -0.3502026949249225       T    2.733333333333330     
            4   0.4287820835430028       T    2.600000000000000     
            5    4.907925057809273       T    2.400000000000000     
            6   -5.307049068415304       T    2.300000000000000     
            1  -0.1960674387419232       F    4.100000000000000     
            2   0.3687525935422963       F    3.800000000000000     
            3   -1.505333614924853       F    3.500000000000000     
            4    4.948907078156191       T    3.200000000000000     
            5   -4.894613262753399       T    2.900000000000000     
            6    3.468897724782442       T    2.600000000000000     
            7   -1.792218099820337       T    2.400000000000000     
            8    80.22069592246987       T    2.300000000000000     
Loading