g1: GROUP ATOMS=1-10
c1: CENTER   ATOMS=g1

t1: TORSION ATOMS=1,6,10,15
t2: TORSION VECTOR1=6,1 AXIS=6,10 VECTOR2=10,15
t3: TORSION VECTOR1=6,1 AXIS=20,7 VECTOR2=10,c1

cc1: COMBINE ARG=t1,t2,t3 POWERS=2.0,1.0,0.0 PERIODIC=NO
cc2: COMBINE ARG=t1,t2,t3 COEFFICIENTS=0.0,0.0,0.0 POWERS=3.0,3.0,3.0 PERIODIC=NO
cc3: COMBINE ARG=t1,t2 POWERS=2.0,2.0 PERIODIC=NO

all: COMBINE ARG=t1,t2,t3,cc1,cc2,cc3 NORMALIZE PERIODIC=NO

RESTRAINT ARG=all AT=0 SLOPE=1.0

PRINT ...
  STRIDE=2
  ARG=t1,t2,t3,cc1,cc2,cc3,all
  FILE=COLVAR FMT=%6.5f
... PRINT

ENDPLUMED

