From ce97ef384a0e12752e765bbe98fec999ac66e8c6 Mon Sep 17 00:00:00 2001
From: Chris Maffeo <cmaffeo2@illinois.edu>
Date: Sat, 27 Oct 2018 11:16:07 -0500
Subject: [PATCH] Added dihedral angle to DNA backbone for model with twist to
 obtain correct persistence length

---
 mrdna/segmentmodel.py | 12 ++++++------
 mrdna/simulate.py     |  2 ++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/mrdna/segmentmodel.py b/mrdna/segmentmodel.py
index 13a5d74..40ab067 100644
--- a/mrdna/segmentmodel.py
+++ b/mrdna/segmentmodel.py
@@ -2082,11 +2082,11 @@ class SegmentModel(ArbdModel):
             if b1.type_.name[0] == "D" and b2.type_.name[0] == "D" and b3.type_.name[0] == "D":
                 k = angle_spring_from_lp(sep,147)
                 if local_twist:
-                    ## TODO optimize this paramter
-                    k *= 0.5    # halve because orientation beads have similar springs
-                    angle = self.get_angle_potential(k,180)
-                    o1,o2,o3 = [b.orientation_bead for b in (b1,b2,b3)]
-                    parent.add_angle( o1, o2, o3, angle )
+                    k_dihed = 0.25*k
+                    k *= 0.75    # reduce because orientation beads impose similar springs
+                    dihed = self.get_dihedral_potential(k_dihed,180)
+                    parent.add_dihedral(b1,b2,b2.orientation_bead,b3, dihed)
+
 
             else:
                 ## TODO: get correct number from ssDNA model
@@ -2138,7 +2138,7 @@ class SegmentModel(ArbdModel):
                     pot = self.get_angle_potential(k,90)
                     parent.add_angle(o1,b1,b2, pot)
                     parent.add_angle(b1,b2,o2, pot)
-                                        
+
                     ## TODO: improve this
                     twist_per_nt = 0.5 * (p1.twist_per_nt + p2.twist_per_nt)
                     angle = sep*twist_per_nt
diff --git a/mrdna/simulate.py b/mrdna/simulate.py
index 7494f9b..2e04647 100644
--- a/mrdna/simulate.py
+++ b/mrdna/simulate.py
@@ -7,6 +7,8 @@ from . import get_resource_path
 arbd="/home/cmaffeo2/development/cuda/arbd.dbg/src/arbd" # reduced the mem footprint cause vmd
 namd="/home/cmaffeo2/development/namd-bin/NAMD_Git-2017-07-06_Linux-x86_64-multicore-CUDA/namd2"
 
+## TODO: implement replicas, initial conditions specified through some restart, and a custom simulation schedule
+
 def multiresolution_simulation( model, output_name, 
                                 job_id=None,
                                 gpu = 0,
-- 
GitLab