File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,24 @@ c: CUSTOM ARG=d FUNC=pi*x*x PERIODIC=NO
162162PRINT ARG=c FILE=colvar
163163```
164164
165+ ## The PERIODIC keyword
166+
167+ If the function you have evaluated has a periodic codomain then you have to use the PERIODIC keyword to specify the codomain of the function.
168+ To see how to use this keyword consider the following input:
169+
170+ ```plumed
171+ d: DISTANCE ATOMS=1,2 COMPONENTS
172+ theta: CUSTOM ARG=d.x,d.y FUNC=atan2(y,x) PERIODIC=-pi,+pi
173+ PRINT ARG=theta FILE=colvar
174+ ```
175+
176+ The above input calculates the torsional angle between the vector connecting atoms 1 and 2 and positive $x$ direction around the $z$ axis.
177+ This quantity must lie between $-\pi$ and $\pi$ so we use the PERIODIC keyword to tell PLUMED this fact about the output quantity.
178+
179+ Notice that PLUMED cannot automatically detect if the codomain of the function is periodic. You thus always have to specifiy the
180+ periodicity of the codomain whenever you use the CUSTOM command. However, the codomain of most functions that people use are not periodic
181+ so you can normally just write `PERIODIC=NO`
182+
165183## The step function
166184
167185The `step` operation (that is the Heaviside function) from the table above allow you to use if clauses in CUSTOM actions.
You can’t perform that action at this time.
0 commit comments