Changeset 629
- Timestamp:
- Feb 4, 2010 10:21:53 PM (12 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/HPMSA_v40.ipf
r570 r629 793 793 return SofQ 794 794 end 795 796 797 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 798 // 799 // calculate U(r) given the HPMSA parameters 800 // 801 // pass in the x wave as scaled r/diam values 802 // 803 Function fHPMSA_Ur(w,x) 804 wave w 805 variable x 795 806 807 // variable timer=StartMSTimer 808 809 variable Elcharge=1.602189e-19 // electron charge in Coulombs (C) 810 variable kB=1.380662e-23 // Boltzman constant in J/K 811 variable FrSpPerm=8.85418782E-12 //Permittivity of free space in C^2/(N m^2) 812 813 variable SofQ, QQ, Qdiam, gammaek, Vp, csalt, ss 814 variable VolFrac, SIdiam, diam, Kappa, cs, IonSt 815 variable dialec, Perm, beta1, Temp, zz, charge, ierr 816 Variable ur,gam,kapSig 817 818 diam=w[0] //in A (not SI .. should force people to think in nm!!!) 819 zz = w[1] //# of charges 820 VolFrac=w[2] 821 QQ=x //in A^-1 (not SI .. should force people to think in nm^-1!!!) 822 Temp=w[3] //in degrees Kelvin 823 csalt=w[4] //in molarity 824 dialec=w[5] // unitless 825 826 827 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 828 //////////////////////////// convert to USEFUL inputs in SI units // 829 //////////////////////////// NOTE: easiest to do EVERYTHING in SI units // 830 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 831 beta1=1/(kB*Temp) // in Joules^-1 832 Perm=dialec*FrSpPerm //in C^2/(N m^2) 833 charge=zz*Elcharge //in Coulomb (C) 834 SIdiam = diam*1E-10 //in m 835 Vp=4*pi/3*(SIdiam/2)^3 //in m^3 836 cs=csalt*6.022E23*1E3 //# salt molecules/m^3 837 838 // Compute the derived values of : 839 // Ionic strength IonSt (in C^2/m^3) 840 // Kappa (Debye-Huckel screening length in m) 841 // and gamma Exp(-k) 842 IonSt=0.5 * Elcharge^2*(zz*VolFrac/Vp+2*cs) 843 Kappa=sqrt(2*beta1*IonSt/Perm) //Kappa calc from Ionic strength 844 // Kappa=2/SIdiam // Use to compare with HP paper 845 846 kapSig = kappa*SIDiam 847 848 gam=beta1*charge^2/(pi*Perm*SIdiam*(2+Kappa*SIdiam)^2)*exp(kapSig) 849 ur = gam*exp(-kapSig*x)/x 850 851 852 Return(ur) 853 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NSORT.ipf
r628 r629 133 133 Duplicate/O $(typPrefix+"_res") $(trimPrefix+"_res") 134 134 //Trimmed data set 135 Duplicate/O $(typPrefix+"_q"),$(trimPrefix+"_q")136 Duplicate/O $(typPrefix+"_i"),$(trimPrefix+"_i")137 Duplicate/O $(typPrefix+"_s"),$(trimPrefix+"_s")135 // Duplicate/O $(typPrefix+"_q"),$(trimPrefix+"_q") 136 // Duplicate/O $(typPrefix+"_i"),$(trimPrefix+"_i") 137 // Duplicate/O $(typPrefix+"_s"),$(trimPrefix+"_s") 138 138 WaveStats/Q $(typPrefix+"_q") //get info about the original q-values read in 139 139 pt = V_npnts-endPts 140 DeletePoints pt,endPts,$(trimPrefix+"_q"),$(trimPrefix+"_i"),$(trimPrefix+"_s") //delete end points first141 DeletePoints 0,begPts,$(trimPrefix+"_q"),$(trimPrefix+"_i"),$(trimPrefix+"_s") //then delete points from beginning140 DeletePoints pt,endPts,$(trimPrefix+"_q"),$(trimPrefix+"_i"),$(trimPrefix+"_s"),$(trimPrefix+"_res") //delete end points first 141 DeletePoints 0,begPts,$(trimPrefix+"_q"),$(trimPrefix+"_i"),$(trimPrefix+"_s"),$(trimPrefix+"_res") //then delete points from beginning 142 142 else 143 143 //Assume … … 149 149 Duplicate/O $(typPrefix+"_s") $(trimPrefix+"_s") 150 150 //Trimmed data set 151 Duplicate/O $(typPrefix+"_q"),$(trimPrefix+"_q")152 Duplicate/O $(typPrefix+"_i"),$(trimPrefix+"_i")153 Duplicate/O $(typPrefix+"_s"),$(trimPrefix+"_s")151 // Duplicate/O $(typPrefix+"_q"),$(trimPrefix+"_q") 152 // Duplicate/O $(typPrefix+"_i"),$(trimPrefix+"_i") 153 // Duplicate/O $(typPrefix+"_s"),$(trimPrefix+"_s") 154 154 WaveStats/Q $(typPrefix+"_q") //get info about the original q-values read in 155 155 pt = V_npnts-endPts … … 1266 1266 ControlInfo/W=NSORT_Panel PreviewCheck 1267 1267 if( V_Value==0 ) //if zero skip the preview and write out the file 1268 //If any of them have three columns write three column data 1269 err=WriteNSORTedFile(q12,i12,sig12,name1,name2,name3,normToStr,norm12,norm23) 1268 res12[][0] = sq12[p] 1269 res12[][1] = qb12[p] 1270 res12[][2] = fs12[p] 1271 err=WriteNSORTedFile(q12,i12,sig12,name1,name2,name3,normToStr,norm12,norm23,res=res12) 1270 1272 endif 1271 1273 // always clean up waves before exiting
Note: See TracChangeset
for help on using the changeset viewer.