Changeset 1482


Ignore:
Timestamp:
Aug 29, 2014 2:23:41 PM (7 years ago)
Author:
vondreele
Message:

change comment about sign of Dij application
fix TOF derivatives for Ai = met. tensor elements
fix TOF mustrain derivatives - all now OK
work on TOF size derivatives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r1481 r1482  
    891891            parm = keys[0]+'::'+keys[2]             #parm is e.g. '0::D11'
    892892            newCellDict[parm] = [key,parmDict[key]-parmDict[item]]
    893     return newCellDict          # is e.g. {'0::D11':A0+D11}
     893    return newCellDict          # is e.g. {'0::D11':A0-D11}
    894894   
    895895def ApplyXYZshifts(parmDict,varyList):
     
    13041304    else:   #'T'OF
    13051305        if calcControls[phfx+'SizeType'] == 'isotropic':
    1306             Sgam = 1.e-4*parmDict[hfx+'difC']*refl[4]*parmDict[phfx+'Size;i']
    1307             gamDict[phfx+'Size;i'] = 1.e-4*parmDict[hfx+'difC']*refl[4]*parmDict[phfx+'Size;mx']
    1308             sigDict[phfx+'Size;i'] = 2.e-4*parmDict[hfx+'difC']*refl[4]*Sgam*(1.-parmDict[phfx+'Size;mx'])**2/ateln2
     1306            Sgam = 1.e-4*parmDict[hfx+'difC']*parmDict[phfx+'Size;i']
     1307            gamDict[phfx+'Size;i'] = 1.e-4*parmDict[hfx+'difC']*parmDict[phfx+'Size;mx']
     1308            sigDict[phfx+'Size;i'] = 2.e-4*parmDict[hfx+'difC']*Sgam*(1.-parmDict[phfx+'Size;mx'])**2/ateln2
    13091309        elif calcControls[phfx+'SizeType'] == 'uniaxial':
    1310             const = 1.e-4*parmDict[hfx+'difC']*refl[4]
     1310            const = 1.e-4*refl[4]*parmDict[hfx+'difC']
    13111311            H = np.array(refl[:3])
    13121312            P = np.array(calcControls[phfx+'SizeAxis'])
     
    13161316            gami = const*(Si*Sa)
    13171317            sqtrm = np.sqrt((sinP*Sa)**2+(cosP*Si)**2)
    1318             Sgam = gami*sqtrm
    1319             dsi = gami*Si*cosP**2/sqtrm-gam/Si
    1320             dsa = gami*Sa*sinP**2/sqtrm-gam/Sa
    1321             gamDict[phfx+'Size;i'] = const*parmDict[phfx+'Size;mx']*Sa
    1322             gamDict[phfx+'Size;a'] = const*parmDict[phfx+'Size;mx']*Si
     1318            Sgam = gami/sqtrm
     1319            dsi = -gami*Si*cosP**2/sqtrm**3
     1320            dsa = -gami*Sa*sinP**2/sqtrm**3
     1321            gamDict[phfx+'Size;i'] = const*parmDict[phfx+'Size;mx']*Sa/8.
     1322            gamDict[phfx+'Size;a'] = const*parmDict[phfx+'Size;mx']*Si/8.
    13231323            sigDict[phfx+'Size;i'] = 2.*dsi*Sgam*(1.-parmDict[phfx+'Size;mx'])**2/ateln2
    13241324            sigDict[phfx+'Size;a'] = 2.*dsa*Sgam*(1.-parmDict[phfx+'Size;mx'])**2/ateln2
     
    13381338        if calcControls[phfx+'MustrainType'] == 'isotropic':
    13391339            Mgam = 1.e-6*parmDict[hfx+'difC']*refl[4]*parmDict[phfx+'Mustrain;i']
    1340             gamDict[phfx+'Mustrain;i'] =  1.e-6*parmDict[hfx+'difC']*parmDict[phfx+'Mustrain;mx']
    1341             sigDict[phfx+'Mustrain;i'] =  2.e-6*parmDict[hfx+'difC']*Mgam*(1.-parmDict[phfx+'Mustrain;mx'])**2/ateln2       
     1340            gamDict[phfx+'Mustrain;i'] =  1.e-6*refl[4]*parmDict[hfx+'difC']*parmDict[phfx+'Mustrain;mx']
     1341            sigDict[phfx+'Mustrain;i'] =  2.e-6*refl[4]*parmDict[hfx+'difC']*Mgam*(1.-parmDict[phfx+'Mustrain;mx'])**2/ateln2       
    13421342        elif calcControls[phfx+'MustrainType'] == 'uniaxial':
    13431343            H = np.array(refl[:3])
     
    13511351            dsi = -gami*Si*cosP**2/sqtrm**3
    13521352            dsa = -gami*Sa*sinP**2/sqtrm**3
    1353             gamDict[phfx+'Mustrain;i'] = (Mgam/Si+dsi)*parmDict[phfx+'Mustrain;mx']
    1354             gamDict[phfx+'Mustrain;a'] = (Mgam/Sa+dsa)*parmDict[phfx+'Mustrain;mx']
    1355             sigDict[phfx+'Mustrain;i'] = 2*(Mgam/Si+dsi)*Mgam*(1.-parmDict[phfx+'Mustrain;mx'])**2/ateln2
    1356             sigDict[phfx+'Mustrain;a'] = 2*(Mgam/Sa+dsa)*Mgam*(1.-parmDict[phfx+'Mustrain;mx'])**2/ateln2       
     1353            gamDict[phfx+'Mustrain;i'] = (Mgam/Si+dsi)*parmDict[phfx+'Mustrain;mx']*refl[4]
     1354            gamDict[phfx+'Mustrain;a'] = (Mgam/Sa+dsa)*parmDict[phfx+'Mustrain;mx']*refl[4]
     1355            sigDict[phfx+'Mustrain;i'] = 2*refl[4]*(Mgam/Si+dsi)*Mgam*(1.-parmDict[phfx+'Mustrain;mx'])**2/ateln2
     1356            sigDict[phfx+'Mustrain;a'] = 2*refl[4]*(Mgam/Sa+dsa)*Mgam*(1.-parmDict[phfx+'Mustrain;mx'])**2/ateln2       
    13571357        else:       #generalized - P.W. Stephens model
    13581358            pwrs = calcControls[phfx+'MuPwrs']
     
    14171417            return dpdA,dpdw,dpdZ,0.,0.,dpdXd,dpdYd
    14181418    elif 'T' in calcControls[hfx+'histType']:
    1419         dpdA = np.array([h**2,k**2,l**2,h*k,h*l,k*l])
     1419        dpdA = -np.array([h**2,k**2,l**2,h*k,h*l,k*l])*parmDict[hfx+'difC']*dsp**3/2.
    14201420        dpdZ = 1.0
    14211421        dpdDC = dsp
     
    17751775        pfx = '%d::'%(pId)
    17761776        phfx = '%d:%d:'%(pId,hId)
    1777         A = [parmDict[pfx+'A%d'%(i)] for i in range(6)]     #And modify here by Dij?
     1777        A = [parmDict[pfx+'A%d'%(i)] for i in range(6)]     #And modify here by Dij? - no
    17781778        G,g = G2lat.A2Gmat(A)       #recip & real metric tensors
    17791779        GA,GB = G2lat.Gmat2AB(G)    #Orthogonalization matricies
Note: See TracChangeset for help on using the changeset viewer.