- Timestamp:
- Feb 3, 2014 3:36:30 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/Teubner_v40.ipf
r570 r931 7 7 // 8 8 // 06 NOV 98 SRK 9 // 10 // JAN 2014 - SRK 11 // 12 // Changed the input parameters to be the length scales rather than a2, c1, c2 13 // which have no physical meaning. 9 14 //////////////////////////////////////////////// 10 15 … … 17 22 Make/O/D/n=(num) xwave_ts,ywave_ts 18 23 xwave_ts = alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) 19 Make/O/D coef_ts = {0.1,-30,5000,0.1} 20 make/o/t parameters_ts = {"scale (a2)","c1","c2","bkg"} 24 // Make/O/D coef_ts = {0.1,-30,5000,0.1} 25 // make/o/t parameters_ts = {"scale (a2)","c1","c2","bkg"} 26 27 Make/O/D coef_ts = {0.3,6e-6,30,100,0.1} 28 make/o/t parameters_ts = {"scale","SLD difference (A^-2)","correlation length (xi) (A)","repeat distance, d, (A)","bkg (1/cm)"} 29 21 30 Edit parameters_ts,coef_ts 22 31 Variable/G root:g_ts … … 47 56 48 57 // Setup parameter table for model function 49 Make/O/D smear_coef_ts = {0. 1,-30,5000,0.1}50 make/o/t smear_parameters_ts = {"scale (a2)","c1","c2","bkg"}58 Make/O/D smear_coef_ts = {0.3,6e-6,30,100,0.1} 59 make/o/t smear_parameters_ts = {"scale","SLD difference (A^-2)","correlation length (xi) (A)","repeat distance, d, (A)","bkg (1/cm)"} 51 60 Edit smear_parameters_ts,smear_coef_ts 52 61 … … 73 82 Wave cw,yw,xw 74 83 84 Variable a2, c1, c2 85 Variable d,xi,scale,delrho 86 87 scale = cw[0] 88 delrho = cw[1] 89 xi = cw[2] 90 d = cw[3] 91 92 93 a2 = (1 + (2*pi*xi/d)^2)^2 94 c1 = -2*xi*xi*(2*pi*xi/d)^2+2*xi*xi 95 c2 = xi^4 96 97 a2 /= 8*pi*xi^3*scale*delrho^2*1e8 //this makes the units work out 98 c1 /= 8*pi*xi^3*scale*delrho^2*1e8 99 c2 /= 8*pi*xi^3*scale*delrho^2*1e8 100 101 // Print a2,c1,c2 102 103 Duplicate/O cw tmp_ts_cw 104 tmp_ts_cw[0] = a2 105 tmp_ts_cw[1] = c1 106 tmp_ts_cw[2] = c2 107 tmp_ts_cw[3] = cw[4] 108 75 109 #if exists("TeubnerStreyModelX") 76 yw = TeubnerStreyModelX( cw,xw)110 yw = TeubnerStreyModelX(tmp_ts_cw,xw) 77 111 #else 78 yw = fTeubnerStreyModel( cw,xw)112 yw = fTeubnerStreyModel(tmp_ts_cw,xw) 79 113 #endif 80 114 return(0) … … 109 143 Endif 110 144 // calculate the correlation length and the repeat distance 111 Variable a2,c1,c2,xi,dd 112 a2 = coef_ts[0] 113 c1 = coef_ts[1] 114 c2 = coef_ts[2] 115 116 xi = 0.5*sqrt(a2/c2) + c1/4/c2 117 xi = 1/sqrt(xi) 118 119 dd = 0.5*sqrt(a2/c2) - c1/4/c2 120 dd = 1/sqrt(dd) 121 dd *=2*Pi 122 145 // Variable a2,c1,c2,xi,dd,fa 146 // a2 = coef_ts[0] 147 // c1 = coef_ts[1] 148 // c2 = coef_ts[2] 149 // 150 // xi = 0.5*sqrt(a2/c2) + c1/4/c2 151 // xi = 1/sqrt(xi) 152 // 153 // dd = 0.5*sqrt(a2/c2) - c1/4/c2 154 // dd = 1/sqrt(dd) 155 // dd *=2*Pi 156 // 157 158 Variable a2, c1, c2 159 Variable d,xi,scale,delrho,fa 160 xi = coef_ts[2] 161 d = coef_ts[3] 162 163 164 a2 = (1 + (2*pi*xi/d)^2)^2 165 c1 = -2*xi*xi*(2*pi*xi/d)^2+2*xi*xi 166 c2 = xi^4 167 168 fa = c1/(sqrt(4*a2*c2)) 169 123 170 Printf "The correlation length (the dispersion of d) xi = %g A\r",xi 124 Printf "The quasi-periodic repeat distance, d = %g A\r",dd 171 Printf "The quasi-periodic repeat distance, d = %g A\r",d 172 Printf "The amphiphilicity factor, fa = %g\r",fa 125 173 126 174 End
Note: See TracChangeset
for help on using the changeset viewer.