#============================================================* # test rigid body simulation * # * # look at difference in dynamics with translated model. * #============================================================* # set units units units scale name = mass uname = reducedMass value = 10000.0 # open pdb file database open name = neck format = pdb file = ../../data/neck_xform.pdb # read molecule molecule read name = m1 database = neck molecule m1 xform translation = [ 10 0 0 ] # create a some domains domain create iq1 = AC[760-788] domain iq1 backbone color = [ 1 0 0 ] width = 2 show #domain iq1 atoms color = [ 1 0 0 ] show = true domain create iq2 = BC[788-814] domain iq2 backbone color = [ 0 1 0 ] width = 2 show #domain iq2 bonds atom_color = element atoms = true show = true #domain iq2 atoms color = [ 0 1 0 ] show = true domain create iq3 = DC[814-836] domain iq3 backbone color = [ 0 0 1 ] width = 2 show #domain iq3 bonds atom_color = element atoms = true show = true #domain iq3 atoms color = [ 0 0 1 ] show = true domain create hc = C # open pdb file database open name = neck2 format = pdb file = ../../data/neck_xform.pdb # read molecule molecule read name = m2 database = neck2 # create a some domains domain create iq1a = AC[760-788] domain iq1a backbone color = [ 0.5 0 0 ] width = 2 show domain create iq2a = BC[788-814] domain iq2a backbone color = [ 0 0.5 0 ] width = 2 show domain create iq3a = DC[814-836] domain iq3a backbone color = [ 0 0 0.5 ] width = 2 show domain create hca = C #--------------------------------------------------------------# # create bodies # #--------------------------------------------------------------# body create name = ground type = ground body create name = iq1_body type = rigid domain = iq1 body create name = iq2_body type = rigid domain = iq2 body create name = iq3_body type = rigid domain = iq3 body create name = iq1a_body type = rigid domain = iq1a body create name = iq2a_body type = rigid domain = iq2a body create name = iq3a_body type = rigid domain = iq3a #--------------------------------------------------------------# # create joints # #--------------------------------------------------------------# # joint 1 #-------- joint create name = 1 type = ball domain = iq1 res = C[760] use = CA joint 1 color = [ 1 0 0 ] msize = 0.1 shading = color show = true joint 1 bodies = { ground iq1_body } # joint 2 #-------- joint create name = 2 type = ball domain = hc res = C[788] use = CA joint 2 color = [ 0 1 0 ] msize = 0.1 shading = flat display = line show = true joint 2 bodies = { iq1_body iq2_body } # joint 3 #-------- joint create name = 3 type = ball domain = hc res = C[814] use = CA joint 3 color = [ 0 0 1 ] msize = 0.1 shading = flat display = line show = true joint 3 bodies = { iq2_body iq3_body } # joint 1 #-------- joint create name = 1a type = ball domain = iq1a res = C[760] use = CA joint 1a color = [ 1 0 0 ] msize = 0.1 shading = color show = true joint 1a bodies = { ground iq1a_body } # joint 2 #-------- joint create name = 2a type = ball domain = hca res = C[788] use = CA joint 2a color = [ 0 1 0 ] msize = 0.1 shading = flat display = line show = true joint 2a bodies = { iq1a_body iq2a_body } # joint 3 #-------- joint create name = 3a type = ball domain = hca res = C[814] use = CA joint 3a color = [ 0 0 1 ] msize = 0.1 shading = flat display = line show = true joint 3a bodies = { iq2a_body iq3a_body } #--------------------------------------------------------------# # create a rigid simulation # #--------------------------------------------------------------# simulation create name = rsim type = rigid # add bodies #----------- simulation rsim add body = ground simulation rsim add body = iq1_body simulation rsim add body = iq2_body simulation rsim add body = iq3_body simulation rsim add body = iq1a_body simulation rsim add body = iq2a_body simulation rsim add body = iq3a_body # add joints #----------- simulation rsim add joint = 1 simulation rsim add joint = 2 simulation rsim add joint = 3 simulation rsim add joint = 1a simulation rsim add joint = 2a simulation rsim add joint = 3a # set solver #----------- simulation rsim solver = ode simulation rsim solver finite_rotation = on # add forces #----------- force create name = force1 \ type = explicit \ point = [ 0 0 0 ] \ direction = [ 40 0 0 ] \ scale = 1.0 simulation rsim add force = force1 \ body = iq3_body \ time = { 0 1000 } force create name = force2 \ type = explicit \ point = [ 0 0 0 ] \ direction = [ 40 0 0 ] \ scale = 1.0 simulation rsim add force = force2 \ body = iq3a_body \ time = { 0 1000 } # initialize simulation #---------------------- simulation rsim initialize simulation rsim time step = 0.001 simulation rsim momentum = on simulation rsim add trace name = tr1 \ body = iq3_body \ color = [ 1 0 0 ] \ global_frame = false \ point = [ 0 0 0 ] simulation rsim add trace name = tr1a \ body = iq3a_body \ color = [ 1 1 1 ] \ global_frame = false \ point = [ 0 0 0 ] # step simulation #---------------- #simulation rsim step = 100 #simulation rsim step #simulation rsim step #simulation rsim step #graphics write format = jpeg name = i1 #graphics record format = jpeg name = i1 on = true