# Point-Kernel Code Development for Gamma-Ray Shielding Applications
## 4 The PK Program Overview  
The C-programming language [25] was used for solving numerical forms of equations presented in the previous chapter. The dynamical data structures, matrices, arrays and pointers on structures were used for storing and retrieving various energy-dependent material data [26; 27]. The Goldstein infinite medium \(B\)-factors and parameters of Taylor and Berger forms were coded as matrices, together with data on material densities and the energy-dependent mass attenuation coefficients of seven shielding materials: water, concrete, aluminum, iron, tin, lead and depleted uranium. For retrieving such data, auxiliary functions for linear and bilinear interpolation were coded in external files, with various user-driven arguments on shielding material and gamma-ray energy. The timing functions were also implemented using external libraries to measure total and per-iteration elapsed CPU time. Special functions such as the exponential integral function of order \(E_{n}\) and Sievert integral \(F\) were programed as independent program modules [28]. The auxiliary function was written that transforms final buildup flux to exposure rate in air (R/h) or dose rates (Gy/h) in four practical materials (water, tissue, concrete and sodium-iodine). This is achieved by the kerma factor, i.e., multiplying the mass energy absorption coefficients (cm\({}^{2}\)/g), gamma-ray energy (MeV) and appropriate conversion factors. The compiled modules are built to solve a specific gamma shielding problem (line, disc, plane, sphere or volumetric slab) and input-output communication is carried out in the command prompt terminal window. The redirection of input and output data using external files is also possible. The PK program functionality will be briefly demonstrated for the case of the finite gamma disc and slab shield. Figure 5 shows a simple input prompt using the terminal window. The user is prompted to select or input problem-dependent parameters, such as shielding material (choices 1-7), gamma-ray energy (in MeV), specific source intensity (in phot/cm\({}^{2}\)/s), gamma disc radius (in cm), and perpendicular distance (in cm) between the source and the point detector. Figure 6 shows basic input data with an on-screen printout of intermediate results of energy-dependent coefficients (mass attenuation and Taylor \(B\)-factor). The computational case considered as an example is the gamma disc of radius 25 cm emitting isotropically 1.0 \(\times\) 10\({}^{3}\) phot/cm\({}^{2}\)/s in front of the 100 cm-thick concrete slab shield. The point detector is located 200 cm from the gamma disc center. Figure 5: The PK program’s main selection menu. The compiled modules can be run in two basic modes, depending on what is a search variable: detector buildup flux or a slab shield thickness. The latter is harder to solve since a nonlinear equation with the shield thickness unknown must be found iteratively, using a numerical algorithm for root finding; we have implemented a simple iteration and Newton method [29]. Regardless of the selected mode, the program will print information on material data, shield thickness, \(B\)-factors and fluxes. Additional info on CPU timing (total and per-iteration) will be printed for iterative cases. Figure 7 shows the results of the \"easy variant\" solution for a 100 cm-thick concrete shield and 1 MeV gamma rays emitted from a planar disc 25 cm in radius. One can notice that the 100 cm-thick concrete slab equals almost 15 mfpps for 1 MeV gamma ray. The user should be aware of how various analytical forms of \(B\)-factors actually represent different fitting functions of fundamental exposure \(B\)-factor data [3] available for shield thickness [1; 20] mfpps and gamma-ray energy [0.5, 10] MeV. In our case, we have a good agreement of \(B\)-factors: the \"numerical\" 43.04 is calculated by buildup-to-uncollided flux ratio while the \"analytical\" 42.7 comes directly from the Taylor formula.