Changeset 954 for trunk/GSASIIstrMath.py


Ignore:
Timestamp:
Jun 18, 2013 3:53:19 PM (9 years ago)
Author:
vondreele
Message:

fix to Hessian LSQ to stop if lam > 10e5!
fix to rigid body quaternion derivatives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r953 r954  
    188188            for i,name in enumerate(['RBVPx:','RBVPy:','RBVPz:']):
    189189                dFdvDict[pfx+name+rbsx] += dFdvDict[pfx+atxIds[i]+str(atNum)]
    190             for iv in range(4):         #there is a problem with the Oa,Oi,Oj,Ok derivatives
     190            for iv in range(4):
    191191                Q[iv] -= dx
    192                 XYZ1,Cart1 = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Vector')
     192                XYZ1 = G2mth.RotateRBXYZ(Bmat,Cart,G2mth.normQ(Q))
    193193                Q[iv] += 2.*dx
    194                 XYZ2,Cart2 = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Vector')
     194                XYZ2 = G2mth.RotateRBXYZ(Bmat,Cart,G2mth.normQ(Q))
    195195                Q[iv] -= dx
    196196                dXdO = (XYZ2[ia]-XYZ1[ia])/(2.*dx)
     
    251251        for ia,atId in enumerate(RBObj['Ids']):
    252252            atNum = AtLookup[atId]
    253             dx = 0.0001
     253            dx = 0.00001
    254254            for i,name in enumerate(['RBRPx:','RBRPy:','RBRPz:']):
    255255                dFdvDict[pfx+name+rbsx] += dFdvDict[pfx+atxIds[i]+str(atNum)]
    256256            for iv in range(4):
    257257                Q[iv] -= dx
    258                 XYZ1,Cart1 = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Residue')
     258                XYZ1 = G2mth.RotateRBXYZ(Bmat,Cart,G2mth.normQ(Q))
    259259                Q[iv] += 2.*dx
    260                 XYZ2,Cart2 = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,'Residue')
     260                XYZ2 = G2mth.RotateRBXYZ(Bmat,Cart,G2mth.normQ(Q))
    261261                Q[iv] -= dx
    262262                dXdO = (XYZ2[ia]-XYZ1[ia])/(2.*dx)
Note: See TracChangeset for help on using the changeset viewer.