Changeset 3341


Ignore:
Timestamp:
Apr 11, 2018 2:29:19 PM (4 years ago)
Author:
vondreele
Message:

simplify mag moment derivatives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r3340 r3341  
    10991099    Gdata = Gdata/Mag       #normalze mag. moments
    11001100    Gdata = np.inner(Gdata.T,uAmat).T*np.sqrt(nl.det(GS))       #make unit vectors in Cartesian space
    1101     dGdm = (1.-Gdata**2)                        #1/Mag removed - canceled out in dqmx=sum(dqdm*dGdm)
     1101#    dGdm = (1.-Gdata**2)                        #1/Mag removed - canceled out in dqmx=sum(dqdm*dGdm)
    11021102    dFdMx = np.zeros((nRef,mSize,3))
    11031103    Uij = np.array(G2lat.U6toUij(Uijdata))
     
    11531153        NQ = np.where(np.abs(Q)>0.,1./np.abs(Q),0.)     #this sort of works esp for 1 axis moments
    11541154#        NQ2 = np.where(np.abs(Q)>0.,1./np.sqrt(np.sum(Q**2,axis=0)),0.)
    1155         dqdm = np.array([np.outer(hm,hm)-np.eye(3) for hm in HM.T]).T   #Mxyz,Mxyz,Nref (3x3 matrix)
    1156         dqmx = dqdm[:,:,:,nxs,nxs]*dGdm[:,nxs,nxs,:,:]
    1157         dqmx2 = np.sum(dqmx,axis=1)   #matrix * vector = vector
     1155#        dqdm = np.array([np.outer(hm,hm)-np.eye(3) for hm in HM.T]).T   #Mxyz,Mxyz,Nref (3x3 matrix)
     1156#        dqmx = dqdm[:,:,:,nxs,nxs]*dGdm[:,nxs,nxs,:,:]
     1157#        dqmx2 = np.sum(dqmx,axis=1)   #matrix * vector = vector
    11581158#        dqmx1 = np.swapaxes(np.swapaxes(np.inner(dqdm.T,dGdm.T),0,1),2,3)
    1159         dmx = (NQ*Q*dGdM[:,nxs,:,:]-Q*dqmx2)/Mag                                #*Mag canceled out of dqmx term
     1159        dmx = (NQ*Q*dGdM[:,nxs,:,:])/Mag        #just use dpdM term & ignore dqdM term(small)
     1160#        dmx = (NQ*Q*dGdM[:,nxs,:,:]-Q*dqmx2)/Mag
    11601161       
    11611162        fam = Q*TMcorr[nxs,:,nxs,:]*cosm[nxs,:,:,:]*Mag[nxs,nxs,:,:]    #Mxyz,Nref,Nop,Natm
Note: See TracChangeset for help on using the changeset viewer.