Changeset 5001
- Timestamp:
- Jul 27, 2021 11:11:23 AM (18 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r4999 r5001 1728 1728 fxn of gTau points; NB: this allows only 1 mag. wave fxn. 1729 1729 ''' 1730 Am = np.array(MSSdata[3:]).T[:,0,:] #atoms x cos posmods; only 1 wave used1731 Bm = np.array(MSSdata[:3]).T[:,0,:] #...sin posmods1730 Am = np.array(MSSdata[3:]).T[:,0,:] #atoms x cos mag mods; only 1 wave used 1731 Bm = np.array(MSSdata[:3]).T[:,0,:] #...sin mag mods 1732 1732 SGMT = np.array([ops[0] for ops in SGData['SGOps']]) #not .T!! 1733 1733 Sinv = np.array([nl.inv(ops[0]) for ops in SSGData['SSGOps']]) … … 1746 1746 epsinv = Sinv[:,3,3] 1747 1747 mst = np.inner(Sinv[:,:3,:3],modQ)-epsinv[:,nxs]*modQ #van Smaalen Eq. 3.3 1748 phi = np.inner( XYZ,modQ).T1748 phi = np.inner((XYZ-SGT[:,:3][nxs,:,:]),modQ).T 1749 1749 TA = np.sum(mst[nxs,:,:]*(XYZ-SGT[:,:3][nxs,:,:]),axis=-1).T 1750 phase = TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs] +phi[nxs,:,:])+SGT[:,3][nxs,:,nxs]1751 psin = np.sin(twopi*phase) 1750 phase = TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs])+phi[nxs,:,:]-SGT[:,3][nxs,:,nxs] #+,+,+ best for DyMnGe 1751 psin = np.sin(twopi*phase) #tau,ops,atms 1752 1752 pcos = np.cos(twopi*phase) 1753 MmodAR = Am[nxs,nxs,:,:]*pcos[:,:,:,nxs] # cos term1754 MmodBR = Bm[nxs,nxs,:,:]*psin[:,:,:,nxs] # sin term1753 MmodAR = Am[nxs,nxs,:,:]*pcos[:,:,:,nxs] #Re cos term; tau,ops,atms, Mxyz 1754 MmodBR = Bm[nxs,nxs,:,:]*psin[:,:,:,nxs] #Re sin term 1755 1755 MmodAR = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAR[:,:,:,nxs,:],axis=-1) 1756 1756 MmodBR = np.sum(SGMT[nxs,:,nxs,:,:]*MmodBR[:,:,:,nxs,:],axis=-1) 1757 MmodAI = Am[nxs,nxs,:,:]*psin[:,:,:,nxs] # cos term1758 MmodBI = Bm[nxs,nxs,:,:]*pcos[:,:,:,nxs] # sin term1757 MmodAI = Am[nxs,nxs,:,:]*psin[:,:,:,nxs] #Im cos term 1758 MmodBI = Bm[nxs,nxs,:,:]*pcos[:,:,:,nxs] #Im sin term 1759 1759 MmodAI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAI[:,:,:,nxs,:],axis=-1) 1760 1760 MmodBI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodBI[:,:,:,nxs,:],axis=-1) 1761 return MmodAR,MmodBR,MmodAI,MmodBI #Ntau,Nops,Natm,Mxyz; cos & sin parts1761 return MmodAR,MmodBR,MmodAI,MmodBI #Ntau,Nops,Natm,Mxyz; Re, Im cos & sin parts 1762 1762 1763 1763 def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt): -
trunk/GSASIIstrMath.py
r4999 r5001 1534 1534 if parmDict[pfx+'isMag']: #This part correct for making modulated mag moments on equiv atoms - Mmod matched drawing & Bilbao drawings 1535 1535 1536 mXYZ = np.array([[XYZ[0] for XYZ in list(G2spc.GenAtom(xyz,SGData,All=True,Move= True))] for xyz in (Xdata+dXdata).T]) #Natn,Nop,xyz1536 mXYZ = np.array([[XYZ[0] for XYZ in list(G2spc.GenAtom(xyz,SGData,All=True,Move=False))] for xyz in (Xdata+dXdata).T]) #Natn,Nop,xyz 1537 1537 if SGData['SGGray']: 1538 1538 mXYZ = np.hstack((mXYZ,mXYZ)) 1539 1539 1540 1540 MmodAR,MmodBR,MmodAI,MmodBI = G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData) #Ntau,Nops,Natm,Mxyz cos,sin parts sum matches drawing 1541 MmodA = MmodAR+MmodBR1542 MmodB = MmodAI+MmodBI1543 1541 1544 1542 if not SGData['SGGray']: #for fixed Mx,My,Mz … … 1645 1643 fbsm = np.sum(np.sum(fbms,axis=-2),axis=-2) 1646 1644 # #put into cartesian space 1647 facm = np.inner(fasm,u Amat.T) #.T better than not1648 fbcm = np.inner(fbsm,u Amat.T)1645 facm = np.inner(fasm,uBmat) #uBmat best fit for DyMnGe 1646 fbcm = np.inner(fbsm,uBmat) 1649 1647 #form e.F dot product 1650 1648 eDotFa = np.sum(eM[:,nxs,:]*facm,axis=-1) #Nref,Ntau
Note: See TracChangeset
for help on using the changeset viewer.