📜 ⬆️ ⬇️

Regular expressions in nuclear transmutation calculations

Introduction


The processes of nuclear transformations (transmutations) in a substance, occurring under the influence of neutron irradiation, are especially important when choosing materials that are used as construction for a wide range of nodes and devices of various types of nuclear reactors. Nuclear transmutations lead to changes in the chemical and isotopic composition, there is an accumulation of radioactive and stable products, the content of which determines the times of safe operation of devices in nuclear power plants in terms of both radiation and functional [1, 2].

The simulation of the nuclear process in the form of a linear system of ordinary differential equations leads to the problem of discrete optimization of the nuclide transformation scheme by heuristic algorithms from the methods of discrete global and local optimization with elements of the mathematical decision theory and the theory of artificial intelligence [3,4,5].

As a user tool, developed under Windows XP UNIVERSAL METROLOGY PROGRAM (UPM). The current version of the UPM is intended for calculations of the effects of nuclear transmutation, damaging doses in structural materials during reactor irradiation using data from the DB of neutron-physical characteristics, chemical composition of the material and nuclide transformation schemes.
')
The volume of neutron-physical data in the database created for UPM takes 1.1 MB. Consists of 162 records of neutron energy spectra measured or calculated for various points and configurations of research reactors. The data on the chemical composition of construction materials are based on actually used in irradiation devices, in the design elements of research reactors (covers screen assemblies, fuel cladding shells, etc.). The data on the branched block schemes of nuclide transformations are updated on the basis of the performed calculations of nuclear transmutation.
In the calculations of nuclear transmutation and in the basis of text processing with the results of calculations, the application makes extensive use of regular expressions. Regular expressions provide a powerful, flexible and efficient text processing method. Extensive matching patterns provided by regular expressions allow you to quickly analyze large amounts of text, check text for compliance with predetermined patterns (for example, the format of integrated libraries of estimated nuclear data on cross sections for neutron interaction reactions with atomic nuclei ADL-3 [6], FENDL-2.0 [7], ENDF / B-VII.0 [8], and JEFF-3.1.1 [9]), extract, modify, replace, or delete substrings of text, and add extracted lines to the collection to generate reports.

To create a scientific program, we used the capabilities of the System.Text.RegularExpressions.Regex class in the Microsoft VISUAL STUDIO .NET development environment.

The use of regular expressions in UPM


General information about UPM

Universal meteorological program - this application with a graphical user interface assumes a pseudo / real-multitasking execution mode. The program is developed on the principle of modular design, contains the PREPRO 2007 utility package [11] and a number of independent subroutines in the form of dll-files of the dynamic library, exe-files. The interface part of the UPM and the algorithms of the calculation procedures are written in VISUAL C ++ .NET in the Microsoft VISUAL STUDIO .NET development environment [12, 13]. The structure of the database was created using MS SQL Server.2000 database management tools [14]. Currently being tested on experimental data to confirm the adequacy of calculations and determine the amendments.

The PREPRO 2007 utility package is used to preprocess nuclear data in ENDF / B format. This is a modular set of computer codes, each of which reads and writes estimated nuclear data in the ENDF format. Each code performs one or more independent operations on data. Pre-processing of ENDF formatted data is necessary for later use in applications. PREPRO 2007 utilities are independent and compatible with modern operating systems of any type of computer, from a large universal computer to small personal computers, such as IBM-PC and Power MAC.

Regular Expression Overview [15]

The concept of a regular language plays an important role in modern computer science - both in theoretical and practical sections of it. Regular languages ​​are an important class of formal languages. Formal languages ​​are classified according to the types of grammars by which they are specified. The complexity of a language is determined by its type. The most complex are languages ​​with a phrase structure (here we can include natural languages), then context-dependent languages, context-free languages, and the simplest are regular languages.

A convenient and compact way of the final description of a formal language - regular expressions - which finds practical application in many computer applications, such as text editors, command line interpreters and automatic lexical analyzer generators, information retrieval systems.

ENDF / B-6 format overview

ENDF / B-6 is an international format for storing nuclear-rated data (see Appendix 1). Once prepared in the ENDF format, the estimated data sets can be converted into forms suitable for testing and direct applications using processing programs. Processing programs have been developed that receive cross sections from the ENDF library averaged over groups for use in neutron calculations. These programs perform such functions as the restoration of a detailed course of the cross sections according to the parameters of resonances, the Doppler broadening of resonance lines, averaging over given energy groups, and / or translation into special interface formats.

Descriptive information is given in the form of a series of card images, each card contains up to 66 symbols of Hollerith [16].
The latest assessment of the standards was carried out in 2005 and is currently included only in the ENDF / B-VII assessment.

Examples of regular expressions from UPM


Substrings

The System.Text.RegularExpressions.Regex [17,18] class represents the .NET Framework regular expression processor. An object of type Regex is initialized by passing a string to the constructor (see the highlighted listing line). The trivial case of a regular expression is a string consisting of a single character in the alphabet of a regular language. For example, "=", "-", "\\ n", "\\ t". The following example from DIM illustrates the process of searching for the substring "CROSS" in another line:
DirectoryInfo* di = new DirectoryInfo(Environment::CurrentDirectory); DirectoryInfo* fi[] = di->GetDirectories(); String* l_strContents; Regex* myDirectory = new Regex(S"CROSS"); for(int i=0;i<fi->Length; i++) { l_strContents=String::Copy(fi->GetValue(i)->ToString()); if(myDirectory->IsMatch(l_strContents)) break; } 

The IsMatch () method indicates whether a match is found in the specified input string. The sample search refers to simple regular expressions, as this is a string method level. I will give examples of other substrings for organizing search in strings (see tab. 1).

Table 1.
Listing Fragments Substrings
 Regex* myEqual = new Regex(S"\\n"); String* sim[]=myEqual->Split(l_strContents); "\\n" Regex* FirstRegex = new Regex(S"->"); if(FirstRegex->IsMatch(words)){…} "->" Regex* myOneRegex = new Regex(S"ppm"); if(!myOneRegex->IsMatch(m_ptrLVMaterial->get_Items()-> get_Item(MaterialIndex)->get_SubItems()->get_Item(j)-> get_Text()->ToString())){…} "ppm" 

In fragments of listings you can find the use of the Split () method. The method splits the input string into positions that are determined by the regular expression match. The implementations of the “SKALE”, “Chart”, and “8457” line samples are similar. I will consider now more difficult samples for search.

Character classes

A character class defines a set of characters, one of which may occur in the input line so that the matching search is successful. This list of characters can be specified individually [character_group], where character_group is a list of individual characters, or / and as a range [first_symbol is last_symbol], where first_symbol is the character from which the range begins, and the last_character is the symbol that which ends the range.

Classes of characters consist of language elements, examples are listed in the following table (Table 2). A character class corresponds to any one character set.

To test a real floating point number, UPM uses a regular expression of the form: "$ [0-9] [.]? [0-9] + [eE]? [- +]? [0-9] - $", where the sign ? makes sense “0 or 1”, sign + makes sense “one or several”, sign - makes sense “0 or more”
In this form, I used regular expressions to test nuclides.

"[\\ w] + [-] {1} [\\ d] + [mM]? [\\ d]?"
"[0-9] {1,3} - [A-Za-z \\ s] {2} - [0-9 \\ s] {3} [MNO] {0,1}"

Here, the transition character \ w indicates any of the characters that make up a word, such as a letter, a number, or an underscore. We assume that a nuclide consists of one or two characters separated by a single hyphen, followed by decimal digits, followed by the isomeric sign of the nuclide as m or M in the first case (corresponds to the ENDF / B6 format for the dialect of INT for ADL- 3), or the symbol M or N or O in the second case (corresponds to the ENDF / B-6 format for the other libraries), then decimal digits that indicate the number of the nuclide isomerity level can follow.
According to the first definition, nuclides will be correct: He-4, Co-60, Co-60m, Zn-61m2, Zn-61m3. In accordance with the second definition of the regular expression, the nuclides will be correct: 2-He-4, 27-Co-60, 27-Co-60M, 30-Zn-61N, 30-Zn-61O.

Table 2.
Regular expressions with character classes
"[\\ b \\ n \\ t \\ r] +"
"[\\ d \\. \\ w - +] + [\\ s \\ t] {1}"
"[\\ w] + [-] {1} [\\ d] + [mM]? [\\ d]?"
"[0-9] {1} \\. [0-9] + [- +] {1} [0-9] +"
"[= \\ s] +"
"$ (? <= \ b | v0 | =) [\\ d \\. + - \\ w] {8} [\\ s \\ t] {1}"
"(? <= \ b | ~ 0 | =) [\\ d \\. + - \\ w] {8} [\\ s \\ t] {1} $"
"[M, m]?"
"$ [0-9] [.]? [0-9] + [eE]? [- +]? [0-9] - $"
"[\\ s \\ b \\ t] +"
"[\\ d \\. \\ w - +] +"

Grouping constructs

Grouping constructs display parts of expressions using regular expressions and usually capture parts of a string in the input string. Grouping constructs consist of language elements.

The following grouping construct captures the corresponding part of the expression: (expression_part), where expression_part is any valid regular expression pattern. Writes that the use of brackets is numbered automatically from left to right, based on the order of opening brackets in a regular expression, starting with 1. Capture number 0 is the text corresponding to the entire regular expression pattern.

A construction for testing a real floating point number has already been described. I will show the second option.

"([\\ d \\. \\ w - +] + [\\ s \\ t] {1})"

The pattern of a regular expression captures the corresponding part of the expression [\\ d \\. \\ w - +] + [\\ s \\ t] {1}, where the character class [\\ d \\. \\ w- +] allows check one or more standard decimal digits with the possible occurrence of the exponent symbol and the sign of the order of the number, and the character class [\\ s \\ t], allows you to check strictly one space or tab character.

Here, the grouping construction is used, since in the text being processed each line is represented by two valid values, between which there is a space character or a tab character. The values ​​of the two-dimensional array for describing the neutron spectrum are processed and used in the compilation of the working files of the PREPRO 2007 utilities package [11] for preliminary processing of nuclear data in the ENDF / B-6 format. The text format of the working file GROUPIE.LST is presented as a fragment below (see Appendix 2).

Let us list the examples of implemented grouping constructions in UPM (see table 3).

Table 3.
Regular expressions with grouping constructions
"([\\ b \\ n \\ t \\ r] +)"
"([\\ w] + [-] {1} [\\ d] + [mM]? [\\ d]?)"
"([\\ d \\. \\ w - +] + [\\ s \\ t] {1})"
"(\\ b)"
"(\\ n)"
"(\\ t)"
"()"
"([\\ d \\. \\ w - +] +)"
"(\\ d +)"
"([AZ, az, AZ, az, 0-9, \\ - ,,] +)"
"(\\. \\ w +)"
"(\\ w + [- \\.] + \\ d +)"
"(\\ w + [- \\.]? \\ d * \\ w? [- +]? \\ d *)"
"([\\ w -] +) $"
"([\\ d] {3} - [\\ w] {2} - [\\ d] {3})"


CONCLUSION


Demonstration of some regular expressions UTP shows the flexibility to manipulate arbitrary text formats provided by the regular expression toolkit. Regular expressions allowed for quick text analysis and searching for certain character patterns, for extracting, editing, replacing or deleting text substrings, as well as for adding extracted lines to the collection when creating a report. The peculiarity of the effective use of regular expressions, as opposed to string types, is evident in the implementation of the ENDF / B-6 format of estimated nuclear data using integrated libraries, such as ADL-3, FENDL-2.0, ENDF / B-VII.0, JEFF- 3.1.1.

Bibliography


1. Construction materials of nuclear reactors. Part 2: Structure, properties, purpose / Ed. NM Beskorovaynogo. M .: Atomizdat, 1977, 256 p.
2. Solonin MI, Chernov VM, Gorokhov VA, et al. Prospect of the Russian Program for Fusion Low-activation Materials // J. Nucl. Ma-ter. 283-287. 2000. 1468-1472.
3. Markina N.V., Shimansky GA TRANS_MU, for the transmutant formation of the intermediary materials for fusion reactors // Journal of Nuclear Materials, 271-272, 1999, p.30-34.
4. Belozerova A.R., Shimansky G.A. Optimization of the transmutation calculation method by the branch and bound method // Collection of essays of the seminar “Physical modeling of changes in the properties of reactor materials in nominal and emergency conditions”, Dimitrovgrad, April 5-6, 2004. Dimitrovgrad: FSUE SSC RF RIAR, 2005. P.75- 77.
5. Belozerova A.R., Melnikov B.F. Application of the complex of heuristics in the task of drawing up a scheme of nuclide transformations // Collection of works of the Second All-Russian Scientific Conference "Methods and means of information processing", Moscow, October 5-7, 2005. Moscow: Moscow State University named after MV Lomonosov, 2005. P.208 -214.
6. Grudzevich OT, Zelenetsky AV, Ignatyuk AV, Pashchenko AB Library of Nuclear Physical Data for Calculations of Activation and Transmutation // Atomic Energy, 1994, Vol. 76, Issue 2, P. 124-130.
7. International Atomic Energy Agency (http://www.iaea.org/), Division of Physical and Chemical Sciences, Nuclear Data Section, A-1400 AUSTRIA, CD ROM Edition, Request 2378.01, FENDL-2, May 1998 Version, www-nds.iaea.org/fendl/index.html
8. www.nndc.bnl.gov/exfor/endf00.jsp Nuclear Data Sheets, Volume 112, Issue 12, December 2011, Pages 2887–2996, Special Issue on ENDF / B-VII.1 Library
9. www.nea.fr/dbforms/data/eva/evatapes/jeff_31 J-Ch Sublet, AJ Koning1, RA Forrest, J Kopecky The JEFF-3.0 / A Neutron Activation File - EAF-2003 into ENDF-6 format, JEFDOC -982, CEA Cadarache, DEN / DER / SPRC 13108 Saint Paul Lez Durance, France, November 2003, p.34.
10. Richard B. Firestone, Table of Isotopes, Office of Energy Research, Office of High Energy and Nuclear Physics, DE-AC03-76SF00098, subcontract LBL no. 4573810, CD ROM Edition, Version 1.0, March, 1996.
11. www-nds.iaea.org/ndspub/endf/prepro2007 PREPRO 2007, ENDF / B Pre-processing Codes (ENDF / B-VII Tested) Owned, Maintained and Distributed by A-1400, Vi-enna, Austria
12. Thorsteinson P., Oberg R. .NET Architecture and Visual C ++ Programming / Per. from English - M .: Publishing house "Williams", 2002.
13. Sarang P.G., Korera A., Fraser S., Gentile S., Kumar N., McLean S., Ro-binson S. Visual C ++ .NET: A Handbook for C ++ Developers / Per. from English - M .: Publishing house "LORI", 2003.
14. Artyomov D.V. Microsoft SQL Server 2000. The latest technology. - Moscow: Publishing and trading house "Russian Edition", 2001.
15. Melnikov B.F. Nondeterministic finite automata // Monograph. Tolyatti, TSU, 2009.
16. chernykh.net/content/view/71/127 Keith S. Reed-Green History of the US census and its data processing / In the world of science, 1989, N 4. P. 70-76.
17. msdn.microsoft.com/ru-ru/library/system.text.regularexpressions.regex.aspx 2012 Microsoft
18. P. Becker Regular Expressions / Magazine for Professionals. C / C ++ programming. LLC Infopress, 2006, No. 10 (34). Pp. 1-7.
Annex 1
Data file on decay radionuclides “decay-ENDF-VII0.endf"

………………… the first 53 lines of the file are cut out …………………………
1.001000 + 3 9.991673-1 -1 0 0 1 2 1451 1
0.000000 + 0 0.000000 + 0 0 0 0 6 2 1451 2
0.000000 + 0 0.000000 + 0 0 0 4 7 2 1451 3
0.000000 + 0 0.000000 + 0 0 0 16 2 2 1451 4
1-H - 1 BNL EVAL-NOV05 AA Sonzogni (from NWC) 2 1451 5
/ ENSDF / DIST-DEC06 2 1451 6
---- ENDF / B-VII MATERIAL 2 2 1451 7
----- RADIOACTIVE DECAY DATA 2 1451 8
------ ENDF-6 FORMAT 2 1451 9
*********************** Begin Description *********************** 2 1451 ten
** ENDF / B-VII RADIOACTIVE DECAY DATA FILE ** 2 1451 11
** Produced at the BNL from the Nuclear Wallet Cards database ** 2 1451 12
** Author: JK Tuli ** 2 1451 13
** Translated into ENDF format by AA Sonzogni, November 2005 ** 2 1451 14
************************************************** *************** 2 1451 15
Parent Excitation Energy: 0.0000 2 1451 16
Parent Spin & Parity: 1/2 + 2 1451 17
Parent half-life: STABLE 2 1451 18
Abundance: 99.985% 1 2 1451 19
************************ End Description ************************ 2 1451 20
1 451 22 0 2 1451 21
8 457 5 0 2 1451 22
0.000000 + 0 0.000000 + 0 0 0 0 0 2 1 099999
0.000000 + 0 0.000000 + 0 0 0 0 0 2 0 0 0
1.001000 + 3 9.991673-1 0 0 1 0 2 8457 1
0.000000 + 0 0.000000 + 0 0 0 6 0 2 8457 2
0.000000 + 0 0.000000 + 0 0.000000 + 0 0.000000 + 0 0.000000 + 0 0.000000 + 0 2 8457 3
5.000000-1 1.000000 + 0 0 0 6 0 2 8457 4
0.000000 + 0 0.000000 + 0 0.000000 + 0 0.000000 + 0 0.000000 + 0 0.000000 + 0 2 8457 5
0.000000 + 0 0.000000 + 0 0 0 0 0 2 8 099999
………………… the remaining 450532 file lines are cut out …………………………

Appendix 2
GROUPIE.LST Work File

Multi-Band Library Identification
- Groupie Test Run
- MAT / MF / MT Ranges
- Minimum Maximum
MAT MF MT MAT MF MT
- 1 1 1 9999 99 999
- Group Energy Boundaries
- Energy-eV Energy-eV Energy-eV Energy-eV Energy-eV Energy-eV
- .100000000 .105000000 .110000000 .115000000 .120000000 .127500000
.135000000 .142500000 .150000000 .160000000 .170000000 .180000000
.190000000 .200000000 .210000000 .220000000 .230000000 .240000000
.255000000 .270000000 .280000000 .300000000 .320000000 .340000000
.360000000 .380000000 .400000000 .425000000 .450000000 .475000000
.500000000 .525000000 .550000000 .575000000 .600000000 .630000000
.660000000 .690000000 .720000000 .760000000 .800000000 .840000000
.880000000 .920000000 .960000000 1.00000000 1.05000000 1.10000000
………………… this part of the file is cut out …………………………
16300000.0 16400000.0 16500000.0 16600000.0 16700000.0 16800000.0
16900000.0 17000000.0 17100000.0 17200000.0 17300000.0 17400000.0
17500000.0 17600000.0 17700000.0 17800000.0 17900000.0 18000000
18100000.0 18200000.0 18300000.0 18400000.0 18500000.0 18600000.0
18700000.0 18800000.0 18900000.0 19000000.0
- ENDF / B Tape Label
-

Source: https://habr.com/ru/post/188448/


All Articles