1.. index:: pair_style cosine/squared
2
3pair_style cosine/squared command
4=================================
5
6Syntax
7""""""
8
9.. code-block:: LAMMPS
10
11   pair_style cosine/squared cutoff
12
13* cutoff = global cutoff for cosine-squared interactions (distance units)
14
15.. code-block:: LAMMPS
16
17   pair_coeff i j eps sigma
18   pair_coeff i j eps sigma cutoff
19   pair_coeff i j eps sigma wca
20   pair_coeff i j eps sigma cutoff wca
21
22* i,j = a particle type
23* eps = interaction strength, i.e. the depth of the potential minimum (energy units)
24* sigma = distance of the potential minimum from 0
25* cutoff = the cutoff distance for this pair type, if different from global (distance units)
26* wca = if specified a Weeks-Chandler-Andersen potential (with eps strength and minimum at sigma) is added, otherwise not
27
28Examples
29""""""""
30
31.. code-block:: LAMMPS
32
33   pair_style cosine/squared 3.0
34   pair_coeff * * 1.0 1.3
35   pair_coeff 1 3 1.0 1.3 2.0
36   pair_coeff 1 3 1.0 1.3 wca
37   pair_coeff 1 3 1.0 1.3 2.0 wca
38
39Description
40"""""""""""
41
42Style *cosine/squared* computes a potential of the form
43
44.. math::
45
46   E =
47   \begin{cases}
48   -\epsilon& \quad r < \sigma \\
49   -\epsilon\cos\left(\frac{\pi\left(r - \sigma\right)}{2\left(r_c - \sigma\right)}\right)^2&\quad \sigma \leq r < r_c \\
50   0& \quad r \geq r_c
51   \end{cases}
52
53between two point particles, where (:math:`\sigma, -\epsilon`) is the
54location of the (rightmost) minimum of the potential, as explained in
55the syntax section above.
56
57This potential was first used in :ref:`(Cooke) <CKD>` for a coarse-grained lipid
58membrane model.  It is generally very useful as a non-specific
59interaction potential because it is fully adjustable in depth and width
60while joining the minimum at (sigma, -epsilon) and zero at (cutoff, 0)
61smoothly, requiring no shifting and causing no related artifacts, tail
62energy calculations etc. This evidently requires *cutoff* to be larger
63than *sigma*\ .
64
65If the *wca* option is used then a Weeks-Chandler-Andersen potential
66:ref:`(Weeks) <WCA>` is added to the above specified cosine-squared potential,
67specifically the following:
68
69.. math::
70
71 E = \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} -
72                       2\left(\frac{\sigma}{r}\right)^6 + 1\right]
73                       , \quad r < \sigma
74
75In this case, and this case only, the :math:`\sigma` parameter can be equal to
76*cutoff* (:math:`\sigma =` cutoff) which will result in ONLY the WCA potential
77being used (and print a warning), so the minimum will be attained at
78(sigma, 0). This is a convenience feature that enables a purely
79repulsive potential to be used without a need to define an additional
80pair style and use the hybrid styles.
81
82The energy and force of this pair style for parameters epsilon = 1.0,
83sigma = 1.0, cutoff = 2.5, with and without the WCA potential, are shown
84in the graphs below:
85
86.. image:: JPG/pair_cosine_squared_graphs.jpg
87   :align: center
88
89----------
90
91Mixing, shift, table, tail correction, restart, rRESPA info
92"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
93
94Mixing is not supported for this style.
95
96The *shift*, *table* and *tail* options are not relevant for this style.
97
98This pair style writes its information to :doc:`binary restart files <restart>`, so pair_style and pair_coeff commands do not need
99to be specified in an input script that reads a restart file.
100
101These pair styles can only be used via the *pair* keyword of the
102:doc:`run_style respa <run_style>` command.  They do not support the
103*inner*, *middle*, *outer* keywords.
104
105----------
106
107Restrictions
108""""""""""""
109
110The *cosine/squared* style is part of the EXTRA-PAIR package. It is only
111enabled if LAMMPS is build with that package.  See the :doc:`Build package <Build_package>` page for more info.
112
113Related commands
114""""""""""""""""
115
116:doc:`pair_coeff <pair_coeff>`,
117:doc:`pair_style lj/cut <pair_lj>`
118
119Default
120"""""""
121
122none
123
124.. _CKD:
125
126**(Cooke)** "Cooke, Kremer and Deserno, Phys. Rev. E, 72, 011506 (2005)"
127
128.. _WCA:
129
130**(Weeks)** "Weeks, Chandler and Andersen, J. Chem. Phys., 54, 5237 (1971)"
131