diff --git a/doc/Section_commands.html b/doc/Section_commands.html
index 3671b787b1..17be7419e2 100644
--- a/doc/Section_commands.html
+++ b/doc/Section_commands.html
@@ -342,10 +342,11 @@ of each style or click on the style itself for a full description:
 <TR ALIGN="center"><TD ><A HREF = "fix_langevin.html">langevin</A></TD><TD ><A HREF = "fix_lineforce.html">lineforce</A></TD><TD ><A HREF = "fix_momentum.html">momentum</A></TD><TD ><A HREF = "fix_move.html">move</A></TD><TD ><A HREF = "fix_msst.html">msst</A></TD><TD ><A HREF = "fix_neb.html">neb</A></TD><TD ><A HREF = "fix_nh.html">nph</A></TD><TD ><A HREF = "fix_nph_asphere.html">nph/asphere</A></TD></TR>
 <TR ALIGN="center"><TD ><A HREF = "fix_nph_sphere.html">nph/sphere</A></TD><TD ><A HREF = "fix_nh.html">npt</A></TD><TD ><A HREF = "fix_npt_asphere.html">npt/asphere</A></TD><TD ><A HREF = "fix_npt_sphere.html">npt/sphere</A></TD><TD ><A HREF = "fix_nve.html">nve</A></TD><TD ><A HREF = "fix_nve_asphere.html">nve/asphere</A></TD><TD ><A HREF = "fix_nve_limit.html">nve/limit</A></TD><TD ><A HREF = "fix_nve_noforce.html">nve/noforce</A></TD></TR>
 <TR ALIGN="center"><TD ><A HREF = "fix_nve_sphere.html">nve/sphere</A></TD><TD ><A HREF = "fix_nh.html">nvt</A></TD><TD ><A HREF = "fix_nvt_asphere.html">nvt/asphere</A></TD><TD ><A HREF = "fix_nvt_sllod.html">nvt/sllod</A></TD><TD ><A HREF = "fix_nvt_sphere.html">nvt/sphere</A></TD><TD ><A HREF = "fix_orient_fcc.html">orient/fcc</A></TD><TD ><A HREF = "fix_planeforce.html">planeforce</A></TD><TD ><A HREF = "fix_poems.html">poems</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "fix_pour.html">pour</A></TD><TD ><A HREF = "fix_press_berendsen.html">press/berendsen</A></TD><TD ><A HREF = "fix_print.html">print</A></TD><TD ><A HREF = "fix_qeq_comb.html">qeq/comb</A></TD><TD ><A HREF = "fix_reax_bonds.html">reax/bonds</A></TD><TD ><A HREF = "fix_recenter.html">recenter</A></TD><TD ><A HREF = "fix_rigid.html">rigid</A></TD><TD ><A HREF = "fix_rigid.html">rigid/nve</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "fix_rigid.html">rigid/nvt</A></TD><TD ><A HREF = "fix_setforce.html">setforce</A></TD><TD ><A HREF = "fix_shake.html">shake</A></TD><TD ><A HREF = "fix_spring.html">spring</A></TD><TD ><A HREF = "fix_spring_rg.html">spring/rg</A></TD><TD ><A HREF = "fix_spring_self.html">spring/self</A></TD><TD ><A HREF = "fix_srd.html">srd</A></TD><TD ><A HREF = "fix_store_force.html">store/force</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "fix_store_state.html">store/state</A></TD><TD ><A HREF = "fix_temp_berendsen.html">temp/berendsen</A></TD><TD ><A HREF = "fix_temp_rescale.html">temp/rescale</A></TD><TD ><A HREF = "fix_thermal_conductivity.html">thermal/conductivity</A></TD><TD ><A HREF = "fix_tmd.html">tmd</A></TD><TD ><A HREF = "fix_ttm.html">ttm</A></TD><TD ><A HREF = "fix_viscosity.html">viscosity</A></TD><TD ><A HREF = "fix_viscous.html">viscous</A></TD></TR>
-<TR ALIGN="center"><TD ><A HREF = "fix_wall.html">wall/colloid</A></TD><TD ><A HREF = "fix_wall_gran.html">wall/gran</A></TD><TD ><A HREF = "fix_wall.html">wall/harmonic</A></TD><TD ><A HREF = "fix_wall.html">wall/lj126</A></TD><TD ><A HREF = "fix_wall.html">wall/lj93</A></TD><TD ><A HREF = "fix_wall_reflect.html">wall/reflect</A></TD><TD ><A HREF = "fix_wall_region.html">wall/region</A></TD><TD ><A HREF = "fix_wall_srd.html">wall/srd</A> 
+<TR ALIGN="center"><TD ><A HREF = "fix_pour.html">pour</A></TD><TD ><A HREF = "fix_press_berendsen.html">press/berendsen</A></TD><TD ><A HREF = "fix_print.html">print</A></TD><TD ><A HREF = "fix_qeq_comb.html">qeq/comb</A></TD><TD ><A HREF = "fix_reax_bonds.html">reax/bonds</A></TD><TD ><A HREF = "fix_recenter.html">recenter</A></TD><TD ><A HREF = "fix_restrain.html">restrain</A></TD><TD ><A HREF = "fix_rigid.html">rigid</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "fix_rigid.html">rigid/nve</A></TD><TD ><A HREF = "fix_rigid.html">rigid/nvt</A></TD><TD ><A HREF = "fix_setforce.html">setforce</A></TD><TD ><A HREF = "fix_shake.html">shake</A></TD><TD ><A HREF = "fix_spring.html">spring</A></TD><TD ><A HREF = "fix_spring_rg.html">spring/rg</A></TD><TD ><A HREF = "fix_spring_self.html">spring/self</A></TD><TD ><A HREF = "fix_srd.html">srd</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "fix_store_force.html">store/force</A></TD><TD ><A HREF = "fix_store_state.html">store/state</A></TD><TD ><A HREF = "fix_temp_berendsen.html">temp/berendsen</A></TD><TD ><A HREF = "fix_temp_rescale.html">temp/rescale</A></TD><TD ><A HREF = "fix_thermal_conductivity.html">thermal/conductivity</A></TD><TD ><A HREF = "fix_tmd.html">tmd</A></TD><TD ><A HREF = "fix_ttm.html">ttm</A></TD><TD ><A HREF = "fix_viscosity.html">viscosity</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "fix_viscous.html">viscous</A></TD><TD ><A HREF = "fix_wall.html">wall/colloid</A></TD><TD ><A HREF = "fix_wall_gran.html">wall/gran</A></TD><TD ><A HREF = "fix_wall.html">wall/harmonic</A></TD><TD ><A HREF = "fix_wall.html">wall/lj126</A></TD><TD ><A HREF = "fix_wall.html">wall/lj93</A></TD><TD ><A HREF = "fix_wall_reflect.html">wall/reflect</A></TD><TD ><A HREF = "fix_wall_region.html">wall/region</A></TD></TR>
+<TR ALIGN="center"><TD ><A HREF = "fix_wall_srd.html">wall/srd</A> 
 </TD></TR></TABLE></DIV>
 
 <P>These are fix styles contributed by users, which can be used if
diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt
index 8bc22c3a49..2637513cc1 100644
--- a/doc/Section_commands.txt
+++ b/doc/Section_commands.txt
@@ -451,6 +451,7 @@ of each style or click on the style itself for a full description:
 "qeq/comb"_fix_qeq_comb.html,
 "reax/bonds"_fix_reax_bonds.html,
 "recenter"_fix_recenter.html,
+"restrain"_fix_restrain.html,
 "rigid"_fix_rigid.html,
 "rigid/nve"_fix_rigid.html,
 "rigid/nvt"_fix_rigid.html,
diff --git a/doc/fix.html b/doc/fix.html
index 51d33fc88c..bd47e95a4d 100644
--- a/doc/fix.html
+++ b/doc/fix.html
@@ -211,6 +211,7 @@ list of fix styles available in LAMMPS:
 <LI><A HREF = "fix_press_berendsen.html">press/berendsen</A> - pressure control by      Berendsen barostat
 <LI><A HREF = "fix_print.html">print</A> - print text and variables during a simulation
 <LI><A HREF = "fix_reax_bonds.html">reax/bonds</A> - write out ReaxFF bond information <A HREF = "fix_recenter.html">recenter</A> - constrain the center-of-mass position   of a group of atoms
+<LI><A HREF = "fix_restrain.html">restrain</A> - constrain a bond, angle, dihedral
 <LI><A HREF = "fix_rigid.html">rigid</A> - constrain one or more clusters of atoms to      move as a rigid body with NVE integration
 <LI><A HREF = "fix_rigid.html">rigid/nve</A> - constrain one or more clusters of atoms to      move as a rigid body with alternate NVE integration
 <LI><A HREF = "fix_rigid.html">rigid/nvt</A> - constrain one or more clusters of atoms to      move as a rigid body with NVT integration
diff --git a/doc/fix.txt b/doc/fix.txt
index 4ab287ea7a..749bef0353 100644
--- a/doc/fix.txt
+++ b/doc/fix.txt
@@ -210,6 +210,7 @@ list of fix styles available in LAMMPS:
 "reax/bonds"_fix_reax_bonds.html - write out ReaxFF bond information \
 "recenter"_fix_recenter.html - constrain the center-of-mass position \
   of a group of atoms
+"restrain"_fix_restrain.html - constrain a bond, angle, dihedral
 "rigid"_fix_rigid.html - constrain one or more clusters of atoms to \
      move as a rigid body with NVE integration
 "rigid/nve"_fix_rigid.html - constrain one or more clusters of atoms to \
diff --git a/doc/fix_restrain.html b/doc/fix_restrain.html
new file mode 100644
index 0000000000..606cad177d
--- /dev/null
+++ b/doc/fix_restrain.html
@@ -0,0 +1,150 @@
+<HTML>
+<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A> 
+</CENTER>
+
+
+
+
+
+
+<HR>
+
+<H3>fix restrain command 
+</H3>
+<P><B>Syntax:</B>
+</P>
+<PRE>fix ID group-ID restrain Kstart Kstop keyword value(s) 
+</PRE>
+<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command 
+
+<LI>restrain = style name of this fix command 
+
+<LI>Kstart, Kstop = restraint coefficient at start/end of run (energy
+units) 
+
+<LI>one keyword with one or more sets of parameter values may be appended to args 
+
+<LI>keyword = <I>dihedral</I>  
+
+<PRE>  <I>dihedral</I> value = atom1 atom2 atom3 atom4 target
+    atom1,atom2,atom3,atom4 = IDs of 4 atoms in restrained dihedral
+    target = target value for specified dihedral angle (degrees) 
+</PRE>
+
+</UL>
+<P><B>Examples:</B>
+</P>
+<PRE>fix holdem all restrain 2000.0 2000.0 dihedral 1 2 3 4 120.0
+fix texas_holdem all restrain 0.0 2000.0 dihedral 1 2 3 4 120.0 1 2 3 5 -120.0 1 2 3 6 0.0 
+</PRE>
+<P><B>Description:</B>
+</P>
+<P>Restrain the motion of the specified atoms by making them part of a
+bond or angle or dihedral interaction whose strength can vary over
+time during a simulation.  This is functionally equivalent to creating
+a bond or angle or dihedral for the atoms in a data file, as specified
+by the <A HREF = "read_data.html">read_data</A> command, albeit with a time-varying
+pre-factor coefficient.  For the purpose of forcefield
+parameter-fitting or mapping a molecular potential energy surface,
+this fix reduces the hassle and risk associated with modifying data
+files.  In other words, use this fix to temporarily force a molecule
+to adopt a particular conformation. To form a permanent bond or angle
+or dihedral, modify the data file.
+</P>
+<P>The first example above applies a restraint to hold the dihedral angle
+formed by atoms 1, 2, 3, and 4 near 120 degrees using a constant
+restraint coefficient.  The second example applies similar restraints
+to multiple dihedral angles using a restraint coefficient that
+increases from 0.0 to 2000.0 over the course of the run.
+</P>
+<P>IMPORTANT NOTE: Adding a force to atoms implies a change in their
+potential energy as they move due to the applied force field.  For
+dynamics via the <A HREF = "run.html">run</A> command, this energy can be added to
+the system's potential energy for thermodynamic output (see below).
+For energy minimization via the <A HREF = "minimize.html">minimize</A> command, this
+energy must be added to the system's potential energy to formulate a
+self-consistent minimization problem (see below).
+</P>
+<P>In order for a restraint to be effective, the restraint force must
+typically be significantly larger than the forces associated with
+conventional forcefield terms. If the restraint is applied during a
+dynamics run (as opposed to during an energy minimization), a large
+restraint coefficient can significantly reduce the stable timestep
+size, especially if the atoms are initially far from the preferred
+conformation.  You may need to experiment to determine what value of K
+works best for a given application.
+</P>
+<P>For the case of finding a minimum energy structure for a single
+molecule with particular restratins (e.g. for fitting forcefield
+parameters or constructing a potential energy surface), commands such
+as the following might be useful:
+</P>
+<PRE># minimize molecule energy with restraints
+velocity all create 600.0 8675309 mom yes rot yes dist gaussian
+fix NVE all nve
+fix TFIX all langevin 600.0 0.0 100 24601
+fix REST all restrain 0.0 5000.0 dihedral 2 1 3 8 $<I>angle1</I> 3 1 2 9 $<I>angle2</I>
+fix_modify REST energy yes
+run 10000
+fix TFIX all langevin 0.0 0.0 100 24601
+fix REST all restrain 5000.0 5000.0 dihedral 2 1 3 8 $<I>angle1</I> 3 1 2 9 $<I>angle2</I>
+fix_modify REST energy yes
+run 10000
+# sanity check for convergence
+minimize 1e-6 1e-9 1000 100000
+# report unrestrained energies
+unfix REST
+run 0 
+</PRE>
+<HR>
+
+<P>The <I>dihedral</I> keyword applies a dihedral restraint to the specified
+atoms using a simplified form of the function used in <A HREF = "dihedral_charmm.html">dihedral_style
+charmm</A>. Specifically, the potential associated
+with the restraint is
+</P>
+<CENTER><IMG SRC = "Eqs/dihedral_charmm.jpg">
+</CENTER>
+<P>with the following coefficients:
+</P>
+<UL><LI>K (energy) = K (specified above)
+<LI>n = 1
+<LI>d (degrees) = 180.0 + target (specified above) 
+</UL>
+<HR>
+
+<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
+</P>
+<P>No information about this fix is written to <A HREF = "restart.html">binary restart
+files</A>.
+</P>
+<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>energy</I> option is supported by this
+fix to add the potential energy associated with this fix to the
+system's potential energy as part of <A HREF = "thermo_style.html">thermodynamic
+output</A>.
+</P>
+<P>IMPORTANT NOTE: If you want the fictitious potential energy associated
+with the added forces to be included in the total potential energy of
+the system (the quantity being minimized), you MUST enable the
+<A HREF = "fix_modify.html">fix_modify</A> <I>energy</I> option for this fix.
+</P>
+<P>This fix computes a global scalar, which can be accessed by various
+<A HREF = "Section_howto.html#4_15">output commands</A>.  The scalar is the
+potential energy discussed above. The scalar value calculated by this
+fix is "extensive".
+</P>
+<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
+the <A HREF = "run.html">run</A> command.
+</P>
+<P><B>Restrictions:</B>
+</P>
+<P>The group-ID specified by this fix is ignored.
+</P>
+<P>Currently, only dihedral restraints are allowed, but modification of
+the code to allow angle and bond restraints would be straightforward.
+</P>
+<P><B>Related commands:</B> none
+</P>
+<P><B>Default:</B> none
+</P>
+</HTML>
diff --git a/doc/fix_restrain.txt b/doc/fix_restrain.txt
new file mode 100644
index 0000000000..5e38f9f597
--- /dev/null
+++ b/doc/fix_restrain.txt
@@ -0,0 +1,139 @@
+"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
+
+:link(lws,http://lammps.sandia.gov)
+:link(ld,Manual.html)
+:link(lc,Section_commands.html#comm)
+
+:line
+
+fix restrain command :h3
+
+[Syntax:]
+
+fix ID group-ID restrain Kstart Kstop keyword value(s) :pre
+
+ID, group-ID are documented in "fix"_fix.html command :ulb,l
+restrain = style name of this fix command :l
+Kstart, Kstop = restraint coefficient at start/end of run (energy
+units) :l
+one keyword with one or more sets of parameter values may be appended to args :l
+keyword = {dihedral}  :l
+  {dihedral} value = atom1 atom2 atom3 atom4 target
+    atom1,atom2,atom3,atom4 = IDs of 4 atoms in restrained dihedral
+    target = target value for specified dihedral angle (degrees) :pre
+:ule
+
+[Examples:]
+
+fix holdem all restrain 2000.0 2000.0 dihedral 1 2 3 4 120.0
+fix texas_holdem all restrain 0.0 2000.0 dihedral 1 2 3 4 120.0 1 2 3 5 -120.0 1 2 3 6 0.0 :pre
+
+[Description:]
+
+Restrain the motion of the specified atoms by making them part of a
+bond or angle or dihedral interaction whose strength can vary over
+time during a simulation.  This is functionally equivalent to creating
+a bond or angle or dihedral for the atoms in a data file, as specified
+by the "read_data"_read_data.html command, albeit with a time-varying
+pre-factor coefficient.  For the purpose of forcefield
+parameter-fitting or mapping a molecular potential energy surface,
+this fix reduces the hassle and risk associated with modifying data
+files.  In other words, use this fix to temporarily force a molecule
+to adopt a particular conformation. To form a permanent bond or angle
+or dihedral, modify the data file.
+
+The first example above applies a restraint to hold the dihedral angle
+formed by atoms 1, 2, 3, and 4 near 120 degrees using a constant
+restraint coefficient.  The second example applies similar restraints
+to multiple dihedral angles using a restraint coefficient that
+increases from 0.0 to 2000.0 over the course of the run.
+
+IMPORTANT NOTE: Adding a force to atoms implies a change in their
+potential energy as they move due to the applied force field.  For
+dynamics via the "run"_run.html command, this energy can be added to
+the system's potential energy for thermodynamic output (see below).
+For energy minimization via the "minimize"_minimize.html command, this
+energy must be added to the system's potential energy to formulate a
+self-consistent minimization problem (see below).
+
+In order for a restraint to be effective, the restraint force must
+typically be significantly larger than the forces associated with
+conventional forcefield terms. If the restraint is applied during a
+dynamics run (as opposed to during an energy minimization), a large
+restraint coefficient can significantly reduce the stable timestep
+size, especially if the atoms are initially far from the preferred
+conformation.  You may need to experiment to determine what value of K
+works best for a given application.
+
+For the case of finding a minimum energy structure for a single
+molecule with particular restratins (e.g. for fitting forcefield
+parameters or constructing a potential energy surface), commands such
+as the following might be useful:
+
+# minimize molecule energy with restraints
+velocity all create 600.0 8675309 mom yes rot yes dist gaussian
+fix NVE all nve
+fix TFIX all langevin 600.0 0.0 100 24601
+fix REST all restrain 0.0 5000.0 dihedral 2 1 3 8 ${angle1} 3 1 2 9 ${angle2}
+fix_modify REST energy yes
+run 10000
+fix TFIX all langevin 0.0 0.0 100 24601
+fix REST all restrain 5000.0 5000.0 dihedral 2 1 3 8 ${angle1} 3 1 2 9 ${angle2}
+fix_modify REST energy yes
+run 10000
+# sanity check for convergence
+minimize 1e-6 1e-9 1000 100000
+# report unrestrained energies
+unfix REST
+run 0 :pre
+
+:line
+
+The {dihedral} keyword applies a dihedral restraint to the specified
+atoms using a simplified form of the function used in "dihedral_style
+charmm"_dihedral_charmm.html. Specifically, the potential associated
+with the restraint is
+
+:c,image(Eqs/dihedral_charmm.jpg)
+
+with the following coefficients:
+
+K (energy) = K (specified above)
+n = 1
+d (degrees) = 180.0 + target (specified above) :ul
+
+:line
+
+[Restart, fix_modify, output, run start/stop, minimize info:]
+
+No information about this fix is written to "binary restart
+files"_restart.html.
+
+The "fix_modify"_fix_modify.html {energy} option is supported by this
+fix to add the potential energy associated with this fix to the
+system's potential energy as part of "thermodynamic
+output"_thermo_style.html.
+
+IMPORTANT NOTE: If you want the fictitious potential energy associated
+with the added forces to be included in the total potential energy of
+the system (the quantity being minimized), you MUST enable the
+"fix_modify"_fix_modify.html {energy} option for this fix.
+
+This fix computes a global scalar, which can be accessed by various
+"output commands"_Section_howto.html#4_15.  The scalar is the
+potential energy discussed above. The scalar value calculated by this
+fix is "extensive".
+
+No parameter of this fix can be used with the {start/stop} keywords of
+the "run"_run.html command.
+
+[Restrictions:]
+
+The group-ID specified by this fix is ignored.
+
+Currently, only dihedral restraints are allowed, but modification of
+the code to allow angle and bond restraints would be straightforward.
+
+[Related commands:] none
+
+[Default:] none