d1: DISTANCE ATOMS=1,2
d2: DISTANCE ATOMS=2,3
d3: DISTANCE ATOMS=3,4
d4: DISTANCE ATOMS=4,5

s:  SORT ARG=d1,d2,d3,d4

# two equivalent calculations:
sum1: COMBINE ARG=s.* PERIODIC=NO
sum2: COMBINE ARG=d1,d2,d3,d4 PERIODIC=NO

RESTRAINT ARG=s.1 AT=5.0 KAPPA=1.0

d5: DISTANCE ATOMS=10,11

a: CONSTANT VALUES=1.25,1.33
j: SORT ARG=a.v-0,d5,a.v-1

RESTRAINT ARG=j.2 SLOPE=1.0 AT=0.0

PRINT ...
  STRIDE=1
  ARG=s.1,s.2,s.3,s.4,sum1,sum2,j.2
  FILE=COLVAR FMT=%6.3f
... PRINT

ENDPLUMED
