attlin_dke_yp

PURPOSE ^

SYNOPSIS ^

function [att] = attlin_dke_yp(mat,k)

DESCRIPTION ^

    Calculation of the lineic attenuation of hard X-rays between 10 and 1100 keV
    Data are calculated using parameters given in reference
    McMaster et al. compilation of x-ray cross sections
      UCRL-50174,sect.II,rev. 1(1969).
    
    Input:

        - mat: type of material [1,1]
            1: Air
            2: Germanium
            3: Iron
            4: Aluminium
            5: Beryllium
            6: Lead
            7: BGO
            8: CsI
            9: NaI
            10: Carbon
            11: Copper
            12: Nickel
            13: Inconel
            14: CdTe
        - k: photon energy (keV) [4,m]
            (total,photoelectric,rayleigh,compton)

    Output: 

        - att: lineic attenuation (cm-1) [1,m]

by Y.PEYSSON CEA-DRFC <yves.peysson@cea.fr>

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [att] = attlin_dke_yp(mat,k)
0002 %
0003 %    Calculation of the lineic attenuation of hard X-rays between 10 and 1100 keV
0004 %    Data are calculated using parameters given in reference
0005 %    McMaster et al. compilation of x-ray cross sections
0006 %      UCRL-50174,sect.II,rev. 1(1969).
0007 %
0008 %    Input:
0009 %
0010 %        - mat: type of material [1,1]
0011 %            1: Air
0012 %            2: Germanium
0013 %            3: Iron
0014 %            4: Aluminium
0015 %            5: Beryllium
0016 %            6: Lead
0017 %            7: BGO
0018 %            8: CsI
0019 %            9: NaI
0020 %            10: Carbon
0021 %            11: Copper
0022 %            12: Nickel
0023 %            13: Inconel
0024 %            14: CdTe
0025 %        - k: photon energy (keV) [4,m]
0026 %            (total,photoelectric,rayleigh,compton)
0027 %
0028 %    Output:
0029 %
0030 %        - att: lineic attenuation (cm-1) [1,m]
0031 %
0032 %by Y.PEYSSON CEA-DRFC <yves.peysson@cea.fr>
0033 %
0034 if nargin < 2,
0035     info_dke_yp(2,'Wrong number of input arguments for attlin_dke_yp');
0036     return;
0037 end
0038 if length(find(k>1100 | k<10))~=0,
0039     info_dke_yp(2,'Warning: some energy values are outside of the range of validity !');
0040 end
0041 %
0042 sk = size(k);
0043 mhup = 0.0*ones(size(k));mhuc=0.0*ones(size(k));mhur=0.0*ones(size(k));
0044 if mat==1,
0045 %
0046 %Air...
0047 %
0048      para1 = [1.293e-3,1.25e-3,1.43e-3,1.78e-3];%dens,densazote,densoxy,densargon
0049      para2 = [0.7804,0.2102,0.0094];%pazote,poxy,pargon
0050 %
0051 %nitrogen...
0052 %
0053      para = [1.25e-3,14.0,6.023e+23,1.0e-24];%dens,pa,avo,barn
0054      p = [11.2765,-2.65400,-0.200445,0.0200765];%ap0 -> ap3 (photoelectric)
0055     c = [-1.23693,1.74510,-0.354660,0.0198705];%ac0 -> ac3 (compton)
0056      r = [3.47760,-0.215762,-0.288874,0.0151312];%ar0 -> ar3 (rayleigh)
0057      for i=1:sk(2),
0058           if (k(i) >= 3.20) & (k(i) <= 1100.0),
0059                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0060                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0061                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0062           end
0063      end
0064      mhu0 = para(1)*para(3)*para(4)/para(2);
0065      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0066      mhutot = mhuco+mhuph+mhura;attazote = [mhutot;mhuph;mhura;mhuco];
0067 %
0068 %oxygen...
0069 %
0070      para = [1.43e-3,16.00,6.023e+23,1.0e-24];%dens,pa,avo,barn
0071      p = [11.7130,-2.57229,-0.205893,0.0199244];%ap0 -> ap3 (photoelectric)
0072      c = [-1.73679,2.17686,-0.449050,0.0264733];%ac0 -> ac3 (compton)
0073      r = [3.77239,-0.148539,-0.307124,0.0167303];%ar0 -> ar3 (rayleigh)
0074      for i=1:sk(2),
0075           if (k(i) >= 7.11) & (k(i) <= 1100.0),
0076                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0077                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0078                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0079           end
0080      end
0081      mhu0 = para(1)*para(3)*para(4)/para(2);
0082      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0083      mhutot = mhuco+mhuph+mhura;attoxy = [mhutot;mhuph;mhura;mhuco];
0084 %
0085 %argon...
0086 %
0087      para = [1.78e-3,39.95,6.023e+23,1.0e-24];%dens,pa,avo,barn
0088      p = [13.9491,-1.82276,-0.328827,0.0274382];%ap0 -> ap3 (photoelectric)
0089      c = [-0.682105,1.74279,-0.317646,0.0156467];%ac0 -> ac3 (compton)
0090      r = [5.21079,0.135618,-0.347214,0.0184333];%ar0 -> ar3 (rayleigh)
0091      for i=1:sk(2),
0092           if (k(i) >= 3.20) & (k(i) <= 1100.0),
0093                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0094                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0095                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0096           end
0097      end
0098      mhu0 = para(1)*para(3)*para(4)/para(2);
0099      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0100      mhutot = mhuco+mhuph+mhura;attargon = [mhutot;mhuph;mhura;mhuco];
0101 %
0102      att = attazote*para2(1)*para1(2)/para1(1);
0103      att = att+attoxy*para2(2)*para1(3)/para1(1);
0104      att = att+attargon*para2(3)*para1(4)/para1(1);
0105 elseif mat==2,
0106 %
0107 %Germanium...
0108 %
0109      para = [5.32,72.6,6.023e+23,1.0e-24];%dens,pa,avo,barn
0110      p1 = [14.6813,-2.59285,-0.0208355,0.0];%ap10 -> ap13 (photoelectric)
0111      p2 = [13.9288,-0.479613,-0.572897,0.0431277];%ap20 -> ap23 (photoelectric)
0112      c = [ -0.334383,1.60237,-0.245555,0.00871239];%ac0 -> ac3 (compton)
0113      r = [6.33896,0.291512,-0.365643,0.0192896];%ar0 -> ar3 (rayleigh)
0114      for i=1:sk(2),
0115           if (k(i) < 11.10),
0116                mhup(i) = exp(p1(1)+p1(2)*log(k(i))+p1(3)*log(k(i)).^2+p1(4)*log(k(i)).^3);
0117                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0118                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0119           elseif (k(i) >= 11.10) & (k(i) <=1100),
0120                mhup(i) = exp(p2(1)+p2(2)*log(k(i))+p2(3)*log(k(i)).^2+p2(4)*log(k(i)).^3);
0121                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0122                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0123           end
0124      end
0125      mhu0 = para(1)*para(3)*para(4)/para(2);
0126      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0127      mhutot = mhuco+mhuph+mhura;att = [mhutot;mhuph;mhura;mhuco];
0128 elseif mat==3,
0129 %
0130 %Iron...
0131 %
0132      para = [7.86,55.85,6.023e+23,1.0e-24];%dens,pa,avo,barn
0133      p = [14.3456,-1.23491,-0.418785,0.0321662];%ap0 -> ap3 (photoelectric)
0134      c = [-0.342379,1.57245,-0.253198,0.00985822];%ac0 -> ac3 (compton)
0135      r = [5.93292,0.225038,-0.361748,0.0193024];%ar0 -> ar3 (rayleigh)
0136      for i=1:sk(2),
0137           if (k(i) >= 7.11) & (k(i) <=1100),
0138                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0139                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0140                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0141           end
0142      end
0143      mhu0 = para(1)*para(3)*para(4)/para(2);
0144      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0145      mhutot = mhuco+mhuph+mhura;att = [mhutot;mhuph;mhura;mhuco];
0146 elseif mat==4,
0147 %
0148 %Aluminium...
0149 %
0150      para = [2.70,26.97,6.023e+23,1.0e-24];%dens,pa,avo,barn
0151      p = [13.1738,-2.18203,-0.258960,0.022284];%ap0 -> ap3 (photoelectric)
0152      c = [-0.439322,1.30867,-0.211648,0.00754210];%ac0 -> ac3 (compton)
0153      r = [4.51995,0.140549,-0.352441,0.0193692];%ar0 -> ar3 (rayleigh)
0154      for i=1:sk(2),
0155           if (k(i) >= 1.56) & (k(i) <=1100),
0156                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0157                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0158                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0159           end
0160      end
0161      mhu0 = para(1)*para(3)*para(4)/para(2);
0162      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0163      mhutot = mhuco+mhuph+mhura;att = [mhutot;mhuph;mhura;mhuco];
0164 elseif mat==5,
0165 %
0166 %Beryllium...
0167 %
0168      para  =[1.85,9.01,6.023e+23,1.0e-24];%dens,pa,avo,barn
0169      p = [9.04511,-2.83487,-0.210021,0.0229526];%ap0 -> ap3 (photoelectric)
0170      c = [-0.690079,0.946448,-0.171142,0.00651413];%ac0 -> ac3 (compton)
0171      r = [2.00860,-0.046192,-0.337018,0.0186939];%ar0 -> ar3 (rayleigh)
0172      for i=1:sk(2),
0173           if (k(i) >= 0.11) & (k(i) <=1100),
0174                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0175                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0176                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0177           end
0178      end
0179      mhu0 = para(1)*para(3)*para(4)/para(2);
0180      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0181      mhutot = mhuco+mhuph+mhura;att = [mhutot;mhuph;mhura;mhuco];
0182 elseif mat==6,
0183 %
0184 %Lead...
0185 %
0186      para = [11.35,207.21,6.023e+23,1.0e-24];%dens,pa,avo,barn
0187      p1 = [16.7131,-2.61538,0.0,0.0];%ap10 -> ap13 (photoelectric)
0188      p2 = [17.7963,-2.37691,-0.045883,0.0];%ap20 -> ap23 (photoelectric)
0189      p3 = [8.63374,3.69400,-1.21312,0.0774601];%ap30 -> ap33 (photoelectric)
0190      c = [0.182167,1.54661,-0.195793,0.00390772];%ac0 -> ac3 (compton)
0191      r = [8.15996,0.418031,-0.352330,0.0164660];%ar0 -> ar3 (rayleigh)
0192      for i=1:sk(2),
0193          if (k(i) >= 3.85) & (k(i) < 15.86),
0194                mhup(i) = exp(p1(1)+p1(2)*log(k(i))+p1(3)*log(k(i)).^2+p1(4)*log(k(i)).^3);
0195                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0196                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0197           elseif (k(i) >= 15.86) & (k(i) < 88.00),
0198                mhup(i) = exp(p2(1)+p2(2)*log(k(i))+p2(3)*log(k(i)).^2+p2(4)*log(k(i)).^3);
0199                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0200                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0201           elseif (k(i) >= 88.00) & (k(i) <= 1100.00),
0202                mhup(i) = exp(p3(1)+p3(2)*log(k(i))+p3(3)*log(k(i)).^2+p3(4)*log(k(i)).^3);
0203                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0204                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0205           end
0206      end
0207      mhu0 = para(1)*para(3)*para(4)/para(2);
0208      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0209      mhutot = mhuco+mhuph+mhura;att = [mhutot;mhuph;mhura;mhuco];
0210 elseif mat==7,
0211 %
0212 %BGO (Bi4Ge3O12)...
0213 %
0214      para1 = [7.13,9.8,5.32,1.43e-3];%dens,densbismu,densgerma,densoxy
0215      para2 = [0.671,0.175,0.154];%pbismu,pgerma,poxy
0216 %
0217 %Bismuth...
0218 %
0219      para = [9.8,209.00,6.023e+23,1.0e-24];%dens,pa,avo,barn
0220      p1 = [16.7078,-2.58648,0.0,0.0];%ap10 -> ap13 (photoelectric)
0221      p2 = [17.5348,-2.23353,-0.0596161,0.0];%ap20 -> ap23 (photoelectric)
0222      p3 = [9.44293,3.44965,-1.19886,0.0783484];%ap30 -> ap33 (photoelectric)
0223      c = [0.189860,1.56125,-0.200932,0.00436768];%ac0 -> ac3 (compton)
0224      r = [8.17489,0.427916,-0.355068,0.0166601];%ar0 -> ar3 (rayleigh)
0225      for i=1:sk(2),
0226           if (k(i) < 16.39),
0227                mhup(i) = exp(p1(1)+p1(2)*log(k(i))+p1(3)*log(k(i)).^2+p1(4)*log(k(i)).^3);
0228                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0229                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0230           elseif (k(i) >= 16.39) & (k(i) < 90.53),
0231                mhup(i) = exp(p2(1)+p2(2)*log(k(i))+p2(3)*log(k(i)).^2+p2(4)*log(k(i)).^3);
0232                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0233                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0234           elseif (k(i) >= 11.10) & (k(i) <=1100),
0235                mhup(i) = exp(p3(1)+p3(2)*log(k(i))+p3(3)*log(k(i)).^2+p3(4)*log(k(i)).^3);
0236                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0237                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0238           end
0239      end
0240      mhu0 = para(1)*para(3)*para(4)/para(2);
0241      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0242      mhutot = mhuco+mhuph+mhura;attbismu = [mhutot;mhuph;mhura;mhuco];
0243 %
0244 %Germanium...
0245 %
0246      para = [5.32,72.6,6.023e+23,1.0e-24];%dens,pa,avo,barn
0247      p1 = [14.6813,-2.59285,-0.0208355,0.0];%ap10 -> ap13 (photoelectric)
0248      p2 = [13.9288,-0.479613,-0.572897,0.0431277];%ap20 -> ap23 (photoelectric)
0249      c = [ -0.334383,1.60237,-0.245555,0.00871239];%ac0 -> ac3 (compton)
0250      r = [6.33896,0.291512,-0.365643,0.0192896];%ar0 -> ar3 (rayleigh)
0251      for i=1:sk(2),
0252           if (k(i) < 11.10),
0253                mhup(i) = exp(p1(1)+p1(2)*log(k(i))+p1(3)*log(k(i)).^2+p1(4)*log(k(i)).^3);
0254                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0255                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0256           elseif (k(i) >= 11.10) & (k(i) <=1100),
0257                mhup(i) = exp(p2(1)+p2(2)*log(k(i))+p2(3)*log(k(i)).^2+p2(4)*log(k(i)).^3);
0258                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0259                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0260           end
0261      end
0262      mhu0 = para(1)*para(3)*para(4)/para(2);
0263      mhuph = mhu0*mhup;mhuco  =mhu0*mhuc;mhura = mhu0*mhur;
0264      mhutot = mhuco+mhuph+mhura;attgerma = [mhutot;mhuph;mhura;mhuco];
0265 %
0266 %Oxygen...
0267 %
0268      para = [1.43e-3,16.00,6.023e+23,1.0e-24];%dens,pa,avo,barn
0269      p = [11.7130,-2.57229,-0.205893,0.0199244];%ap0 -> ap3 (photoelectric)
0270      c = [-1.73679,2.17686,-0.449050,0.0264733];%ac0 -> ac3 (compton)
0271      r = [3.77239,-0.148539,-0.307124,0.0167303];%ar0 -> ar3 (rayleigh)
0272      for i=1:sk(2),
0273           if (k(i) >= 7.11) & (k(i) <= 1100.0),
0274                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0275                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0276                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0277           end
0278      end
0279      mhu0 = para(1)*para(3)*para(4)/para(2);
0280      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0281      mhutot = mhuco+mhuph+mhura;attoxy = [mhutot;mhuph;mhura;mhuco];
0282 %
0283      att = attbismu*para2(1)*para1(1)/para1(2);
0284      att = att+attgerma*para2(2)*para1(1)/para1(3);
0285      att = att+attoxy*para2(3)*para1(1)/para1(4);
0286 elseif mat==8,
0287 %
0288 %CsI...
0289 %
0290      para1 = [4.51,1.873,4.94];%dens,densCs,densI
0291      para2 = [0.5115,0.4885];%pCs,pI
0292 %
0293 %Cesium...
0294 %
0295      para = [1.873,132.91,6.023e+23,1.0e-24];%dens,pa,avo,barn
0296      p1 = [16.5418,-2.46363,-0.0542849,0.0];%ap10 -> ap13 (photoelectric)
0297      p2 = [11.3757,1.94161,-0.983232,0.0671986];%ap20 -> ap23 (photoelectric)
0298      c = [0.184861,1.50030,-0.213333,0.00624264];%ac0 -> ac3 (compton)
0299      r = [7.33490,0.376825,-0.365713,0.0181843];%ar0 -> ar3 (rayleigh)
0300      for i=1:sk(2),
0301           if (k(i) < 35.985),
0302                mhup(i) = exp(p1(1)+p1(2)*log(k(i))+p1(3)*log(k(i)).^2+p1(4)*log(k(i)).^3);
0303                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0304                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0305           elseif (k(i) >= 35.985) & (k(i) <=1100),
0306                mhup(i) = exp(p2(1)+p2(2)*log(k(i))+p2(3)*log(k(i)).^2+p2(4)*log(k(i)).^3);
0307                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0308                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0309           end
0310      end
0311      mhu0 = para(1)*para(3)*para(4)/para(2);
0312      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0313      mhutot = mhuco+mhuph+mhura;attCs = [mhutot;mhuph;mhura;mhuco];
0314 %
0315 %Iode...
0316 %
0317      para = [4.94,126.91,6.023e+23,1.0e-24];%dens,pa,avo,barn
0318      p1 = [16.4086,-2.48214,-0.0507179,0.0];%ap10 -> ap13 (photoelectric)
0319      p2 = [12.1075,1.43635,-0.882038,0.0603575];%ap20 -> ap23 (photoelectric)
0320      c = [-0.0404420,1.65596,-0.251067,0.00904874];%ac0 -> ac3 (compton)
0321      r = [7.27415,0.377223,-0.369728,0.0186280];%ar0 -> ar3 (rayleigh)
0322      for i=1:sk(2),
0323           if (k(i) < 33.169),
0324                mhup(i) = exp(p1(1)+p1(2)*log(k(i))+p1(3)*log(k(i)).^2+p1(4)*log(k(i)).^3);
0325                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0326                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0327           elseif (k(i) >= 33.169) & (k(i) <=1100),
0328                mhup(i) = exp(p2(1)+p2(2)*log(k(i))+p2(3)*log(k(i)).^2+p2(4)*log(k(i)).^3);
0329                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0330                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0331           end
0332      end
0333      mhu0 = para(1)*para(3)*para(4)/para(2);
0334      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0335      mhutot = mhuco+mhuph+mhura;attIo = [mhutot;mhuph;mhura;mhuco];
0336 %
0337      att = attCs*para2(1)*para1(1)/para1(2);
0338      att = att+attIo*para2(2)*para1(1)/para1(3);
0339 elseif mat==9,
0340 %
0341 %NaI...
0342 %
0343      para1 = [3.67,0.97,4.94];%dens,densNa,densIo
0344      para2 = [0.1534,0.8466];%pNa,pIo
0345 %
0346 %Sodium (Na)...
0347 %
0348      para = [0.97,22.997,6.023e+23,1.0e-24];%dens,pa,avo,barn
0349      p = [12.6777,-2.24521,-0.274873,0.02507];%ap10 -> ap13 (photoelectric)
0350      c = [-0.967717,1.61794,-0.287191,0.0131526];%ac0 -> ac3 (compton)
0351      r = [4.26374,0.134662,-0.370080,0.0214467];%ar0 -> ar3 (rayleigh)
0352      for i=1:sk(2),
0353           if (k(i) >= 5.198) & (k(i) <=1100),
0354                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0355                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0356                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0357           end
0358      end
0359      mhu0 = para(1)*para(3)*para(4)/para(2);
0360      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0361      mhutot = mhuco+mhuph+mhura;attNa = [mhutot;mhuph;mhura;mhuco];
0362 %
0363 %Iode...
0364 %
0365      para = [4.94,126.91,6.023e+23,1.0e-24];%dens,pa,avo,barn
0366      p1 = [16.4086,-2.48214,-0.0507179,0.0];%ap10 -> ap13 (photoelectric)
0367      p2 = [12.1075,1.43635,-0.882038,0.0603575];%ap20 -> ap23 (photoelectric)
0368      c = [-0.0404420,1.65596,-0.251067,0.00904874];%ac0 -> ac3 (compton)
0369      r = [7.27415,0.377223,-0.369728,0.0186280];%ar0 -> ar3 (rayleigh)
0370      for i=1:sk(2),
0371           if (k(i) < 33.169),
0372                mhup(i) = exp(p1(1)+p1(2)*log(k(i))+p1(3)*log(k(i)).^2+p1(4)*log(k(i)).^3);
0373                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0374                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0375           elseif (k(i) >= 33.169) & (k(i) <=1100),
0376                mhup(i) = exp(p2(1)+p2(2)*log(k(i))+p2(3)*log(k(i)).^2+p2(4)*log(k(i)).^3);
0377                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0378                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0379           end
0380      end
0381      mhu0 = para(1)*para(3)*para(4)/para(2);
0382      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0383      mhutot = mhuco+mhuph+mhura;attIo = [mhutot;mhuph;mhura;mhuco];
0384 %
0385      att = attNa*para2(1)*para1(1)/para1(2);
0386      att = att+attIo*para2(2)*para1(1)/para1(3);
0387 elseif mat==10,
0388 %
0389 %Carbon...
0390 %
0391      para = [1.80,12.01,6.023e+23,1.0e-24];%dens,pa,avo,barn
0392      p = [1.06879e+01,-2.714,-2.00530e-01,2.07248e-2];%ap0 -> ap3 (photoelectric)
0393      c = [-9.82878e-1,1.46693,-2.93743e-1,1.56005e-2];%ac0 -> ac3 (compton)
0394      r = [3.10861,-2.60580e-1,-2.71974e-1,1.35181e-2];%ar0 -> ar3 (rayleigh)
0395      for i=1:sk(2),
0396           if (k(i) >= 0.284) & (k(i) <=1100),
0397                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0398                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0399                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0400           end
0401      end
0402      mhu0 = para(1)*para(3)*para(4)/para(2);
0403      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0404      mhutot = mhuco+mhuph+mhura;att = [mhutot;mhuph;mhura;mhuco];
0405 elseif mat==11,
0406 %
0407 %Copper...
0408 %
0409      para = [8.94,63.54,6.023e+23,1.0e-24];%dens,pa,avo,barn
0410      p = [14.5808,-1.18375,-0.413850,0.0312088];%ap0 -> ap3 (photoelectric)
0411      c = [-0.570210,1.75042,-0.284555,0.0116930];%ac0 -> ac3 (compton)
0412      r = [6.17739,0.273123,-0.372360,0.0201638];%ar0 -> ar3 (rayleigh)
0413      for i=1:sk(2),
0414           if (k(i) >= 8.979) & (k(i) <=1100),
0415                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0416                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0417                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0418           end
0419      end
0420      mhu0 = para(1)*para(3)*para(4)/para(2);
0421      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0422      mhutot = mhuco+mhuph+mhura;att = [mhutot;mhuph;mhura;mhuco];
0423 elseif mat==12,
0424 %
0425 %Nickel...
0426 %
0427      para = [8.90,58.69,6.023e+23,1.0e-24];%dens,pa,avo,barn
0428      p = [14.2388,-0.967736,-0.47807,0.0366138];%ap0 -> ap3 (photoelectric)
0429      c = [-0.50436,1.70040,-0.276443,0.0112628];%ac0 -> ac3 (compton)
0430      r = [6.09204,0.252277,-0.366568,0.0196586];%ar0 -> ar3 (rayleigh)
0431      for i=1:sk(2),
0432           if (k(i) >= 8.333) & (k(i) <=1100),
0433                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0434                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0435                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0436           end
0437      end
0438      mhu0 = para(1)*para(3)*para(4)/para(2);
0439      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0440      mhutot = mhuco+mhuph+mhura;att = [mhutot;mhuph;mhura;mhuco];
0441 elseif mat==13,
0442 %
0443 %Inconel...
0444 %
0445     pFe = 0.424;
0446      para1 = [7.86*pFe+8.9*(1-pFe),7.86,8.9];%dens,densFe,densNi
0447      para2 = [pFe,1-pFe];%pFe,pNi
0448 %
0449 %Iron...
0450 %
0451      para = [7.86,55.85,6.023e+23,1.0e-24];%dens,pa,avo,barn
0452      p = [14.3456,-1.23491,-0.418785,0.0321662];%ap0 -> ap3 (photoelectric)
0453      c = [-0.342379,1.57245,-0.253198,0.00985822];%ac0 -> ac3 (compton)
0454      r = [5.93292,0.225038,-0.361748,0.0193024];%ar0 -> ar3 (rayleigh)
0455      for i=1:sk(2),
0456           if (k(i) >= 7.11) & (k(i) <=1100),
0457                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0458                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0459                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0460           end
0461      end
0462      mhu0 = para(1)*para(3)*para(4)/para(2);
0463      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0464      mhutot = mhuco+mhuph+mhura;attFe = [mhutot;mhuph;mhura;mhuco];
0465 %
0466 %Nickel...
0467 %
0468      para = [8.90,58.69,6.023e+23,1.0e-24];%dens,pa,avo,barn
0469      p = [14.2388,-0.967736,-0.47807,0.0366138];%ap0 -> ap3 (photoelectric)
0470      c = [-0.50436,1.70040,-0.276443,0.0112628];%ac0 -> ac3 (compton)
0471      r = [6.09204,0.252277,-0.366568,0.0196586];%ar0 -> ar3 (rayleigh)
0472      for i=1:sk(2),
0473           if (k(i) >= 8.333) & (k(i) <=1100),
0474                mhup(i) = exp(p(1)+p(2)*log(k(i))+p(3)*log(k(i)).^2+p(4)*log(k(i)).^3);
0475                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0476                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0477           end
0478      end
0479      mhu0 = para(1)*para(3)*para(4)/para(2);
0480      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0481      mhutot = mhuco+mhuph+mhura;attNi = [mhutot;mhuph;mhura;mhuco];
0482 %
0483      att = attFe*para2(1)*para1(1)/para1(2);
0484      att = att+attNi*para2(2)*para1(1)/para1(3);    
0485 elseif mat==14,
0486 %
0487 %CdTe...
0488 %
0489      para1 = [5.856,8.65,6.24];%dens,densCd,densTe
0490      para2 = [0.468,0.532];%pCd,pTe
0491 %
0492 %Cadmium...
0493 %
0494      para = [8.65,112.41,6.023e+23,1.0e-24];%dens,pa,avo,barn
0495      p1 = [15.9668,-2.38363,-0.0801104,0];%ap10 -> ap13 (photoelectric)
0496      p2 = [11.5254,1.07714,-0.831424,0.0579120];%ap20 -> ap23 (photoelectric)
0497      c = [-0.0516701,1.57426,-0.227646,0.0070565];%ac0 -> ac3 (compton)
0498      r = [7.09856,0.372199,-0.375345,0.0193481];%ar0 -> ar3 (rayleigh)
0499      for i=1:sk(2),
0500           if (k(i) < 26.711),
0501                mhup(i) = exp(p1(1)+p1(2)*log(k(i))+p1(3)*log(k(i)).^2+p1(4)*log(k(i)).^3);
0502                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0503                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0504           elseif (k(i) >= 26.711) & (k(i) <=1100),
0505                mhup(i) = exp(p2(1)+p2(2)*log(k(i))+p2(3)*log(k(i)).^2+p2(4)*log(k(i)).^3);
0506                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0507                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0508           end
0509      end
0510      mhu0 = para(1)*para(3)*para(4)/para(2);
0511      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0512      mhutot = mhuco+mhuph+mhura;attCd = [mhutot;mhuph;mhura;mhuco];
0513 %
0514 %Tellurium...
0515 %
0516      para = [6.24,127.6,6.023e+23,1.0e-24];%dens,pa,avo,barn
0517      p1 = [16.1087,-2.27876,-0.0929405,0];%ap10 -> ap13 (photoelectric)
0518      p2 = [11.6656,1.71052,-0.948281,0.0653213];%ap20 -> ap23 (photoelectric)
0519      c = [-0.0407579,1.64267,-0.247897,0.00880567];%ac0 -> ac3 (compton)
0520      r = [7.23464,0.382493,-0.372715,0.0189194];%ar0 -> ar3 (rayleigh)
0521      for i=1:sk(2),
0522           if (k(i) < 31.813),
0523                mhup(i) = exp(p1(1)+p1(2)*log(k(i))+p1(3)*log(k(i)).^2+p1(4)*log(k(i)).^3);
0524                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0525                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0526           elseif (k(i) >= 31.813) & (k(i) <=1100),
0527                mhup(i) = exp(p2(1)+p2(2)*log(k(i))+p2(3)*log(k(i)).^2+p2(4)*log(k(i)).^3);
0528                mhuc(i) = exp(c(1)+c(2)*log(k(i))+c(3)*log(k(i)).^2+c(4)*log(k(i)).^3);
0529                mhur(i) = exp(r(1)+r(2)*log(k(i))+r(3)*log(k(i)).^2+r(4)*log(k(i)).^3);
0530           end
0531      end
0532      mhu0 = para(1)*para(3)*para(4)/para(2);
0533      mhuph = mhu0*mhup;mhuco = mhu0*mhuc;mhura = mhu0*mhur;
0534      mhutot = mhuco+mhuph+mhura;attTe = [mhutot;mhuph;mhura;mhuco];
0535 %
0536      att = attCd*para2(1)*para1(1)/para1(2);
0537      att = att+attTe*para2(2)*para1(1)/para1(3);    
0538     
0539 end
0540

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.