g1: GROUP ATOMS=1-10
g2: GROUP ATOMS=30-40,5
c1: COM   ATOMS=g1
c2: COM   ATOMS=g2 NOPBC

d1: DISTANCE ATOMS=1,10
d2: DISTANCE ATOMS=c1,50
d3: DISTANCE ATOMS=50,c2

RESTRAINT ...
  ARG=d2
  KAPPA=10.0
  AT=2.6
...

PRINT ...
  STRIDE=10
  ARG=d1,d2,d3
  FILE=COLVAR FMT=%6.3f
... PRINT

ENDPLUMED

