Regular Expressions in Nuclear Transmutation Calculations

Introduction


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

Modeling a 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 with heuristic algorithms from discrete global and local optimization methods with elements of the mathematical theory of decision making and the theory of artificial intelligence [3,4,5].

As a user tool, UNIVERSAL METROLOGIC PROGRAM (UPM) was developed under Windows XP. This version of the UPM is designed to calculate the effects of nuclear transmutation, which damages the doses in structural materials during reactor irradiation using data from the neutron physical characteristics database, the chemical composition of the material, and nuclide transformation schemes.

The volume of neutron-physical data in the database created for the UPM takes 1.1 Mb. It consists of 162 entries on the neutron energy spectra measured or calculated for various points and configurations of research reactors. Data on the chemical composition of structural materials are compiled on the basis of actually used in irradiation devices, in design elements of research reactors (covers of screen assemblies, shells of fuel elements, etc.). Data on branched block diagrams of nuclide transformations are updated based on calculations of nuclear transmutation.
In the calculations of nuclear transmutation and in the basis of word 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. The extensive pattern matching capabilities provided by regular expressions allow you to quickly analyze large amounts of text, check the text for compliance with predefined patterns (for example, the format of integrated libraries of evaluated nuclear data on the cross sections for the interaction of neutrons 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, as well as add extracted strings to the collection for generating 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.

Using regular expressions in UPM


General information about UPM

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

The PREPRO 2007 utility package is used for pre-processing nuclear data in the ENDF / B format. This is a modular set of computer codes, each of which reads and writes estimated nuclear data in ENDF format. Each code performs one or more independent operations on data. Pre-processing of ENDF formatted data is required 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 a crucial role in modern computer science - both in its theoretical and practical sections. Regular languages ​​are an important class of formal languages. Formal languages ​​are classified according to the types of grammars with which they are defined. The complexity of a language is determined by its type. The most complex are languages ​​with a phrasal structure (natural languages ​​can be attributed here), 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 is regular expressions, which finds practical application in many computer applications, such as text editors, command line interpreters and automatic generators of lexical analyzers, information retrieval systems.

Summary of ENDF / B-6 format

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

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

Examples of regular expressions from UPM


Substrings

The System.Text.RegularExpressions.Regex class [17,18] represents the .NET Framework regular expression handler. 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 one character of the alphabet of the regular language. For example, "=", "-", "\\ n", "\\ t". The following example from UPM illustrates the process of finding 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;iLength; 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 given search pattern refers to simple regular expressions, since this is the level of string methods. I will give examples of other substrings for organizing searches 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 listing snippets, you can see the use of the Split () method. The method splits the input string at positions that are determined by regular expression matching. Implementations of the sample strings “SKALE”, “Chart”, “8457” are similar. Now consider the more complex patterns for the search.

Character classes

A character class defines a set of characters, one of which can occur in the input line so that a match is successful. This list of characters can be set individually [character_group], where character_group is a list of individual characters, or / and as a range [first_character - last_character], where first_character is the character that starts the range, and last_character is the character, which ends the range.

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

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

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

Here, the \ w transition sign indicates any of the characters that make up the word, such as a letter, number, or underscore. We assume that the nuclide consists of one or two characters separated by a single hyphen, followed by decimal digits, followed by the isomerism sign of this nuclide in the form of the character m or M in the first case (corresponds to the ENDF / B6 format, the INT dialect for ADL- 3), or the symbol M or N or O in the second case (corresponds to the ENDF / B-6 format for the rest of the libraries), then decimal digits can follow, which indicate the number of the level of nuclide isomerism.
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 a regular expression, nuclides are 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. Records that the use of brackets is automatically numbered from left to right, based on the order of the opening brackets in the regular expression, starting with 1. Capture with number 0 is the text that matches the entire regular expression pattern.

The design for validating a floating point number has already been described. I will show the second option.

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

The regular expression pattern 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 an exponential character and a sign of the order of the number, and the character class [\\ s \\ t] allows you to check strictly one space or tab character.

The grouping construct is used here, since in the processed text each line is represented by two real 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 to compile the working files of the PREPRO 2007 utility package [11] for preliminary processing of nuclear data in the ENDF / B-6 format. The text format of the GROUPIE.LST working file is presented in the form of a fragment below (see Appendix 2).

We list examples of implemented grouping constructions in UPM (see table 3).

Table 3.
Regular expressions with grouping constructs
"([\\ 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


The demonstration of some regular expressions of the UPM shows the flexible possibilities of manipulating an arbitrary text format provided by the regular expression toolkit. Regular expressions made it possible to quickly analyze text and search for specific character patterns to extract, edit, replace, or delete text substrings, as well as to add extracted strings to the collection when creating a report. The peculiarity of the effective use of regular expressions, in contrast to string types, is evident in the implementation of ENDF / B-6 format evaluated nuclear data using integrated libraries such as ADL-3, FENDL-2.0, ENDF / B-VII.0, JEFF- 3.1.1.

List of references


1. Structural materials of nuclear reactors. Part 2: Structure, properties, purpose / Ed. N.M. Beskorovaynogo. M .: Atomizdat, 1977, 256 pp.
2. Solonin MI, Chernov VM, Gorokhov VA, et al. Present Status and Future Prospect of the Russian Program for Fusion Low-activation Materials // J. Nucl. Ma-ter. 283-287. 2000.1468-1472.
3. Markina NV, Shimansky GA TRANS_MU computer code for computation of transmutant formation kinetics in advanced structural materials for fusion reactors // Journal of nuclear materials, 271-272, 1999, p.30-34.
4. Belozyorova A.R., Shimansky G.A. Optimization of the transmutation calculation scheme by the branch and border method // Collection of abstracts 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. Belozyorova A.R., Melnikov B.F. The use of the heuristic complex in the task of compiling a nuclide transformation scheme // Proceedings 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 O. T., Zelenetskiy A. V., Ignatyuk A. V., Pashchenko A. B. Library of nuclear physical data for calculations of activation and transmutation // Atomic Energy, 1994, v. 76, issue 2, pp. 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_31J-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, Nuclear Physics Division of the US Department of Energy under contract 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 The Nuclear Data Section International Atomic Energy Agency PO Box 100 A-1400, Vi-enna, Austria
12. Torsteinson P., Oberg R. Architecture .NET and programming in Visual C ++ / Per. from English - M.: Williams Publishing House, 2002.
13. Sarang P.G., Korera A., Fraser S., Gentail S., Kumar N., Macklin S., Robinson S. Visual C ++ .NET: A guide for C ++ developers / Per. from English - M .: Publishing house "LORI", 2003.
14. Artyomov D.V. Microsoft SQL Server 2000. The latest technology. - M .: Publishing and trading house "Russian Edition", 2001.
15. Melnikov B.F. Nondeterministic finite state machines // Monograph. Tolyatti, TSU, 2009.
16. chernykh.net/content/view/71/127 Keith S. Reed-Green The history of the US census and its data processing / In the world of science, 1989, N 4. P. 70-76.
17.msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx 2012 Microsoft
18. P. Becker Regular Expressions / Journal for Professionals. C / C ++ programming. LLC Infopress, 2006, No. 10 (34). S. 1-7.
Annex 1
Radionuclide decay data file “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 10
** 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 2 2 0 099999
……… ………… the remaining 450532 lines of the file are cut out …………………………

Appendix 2
Work file GROUPIE.LST

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 .30000. .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 has been cut out …………………………
16300000.0 16400000.0 16500000.0 16600000.0 16700000.0 16800000.0
16900000.0 17000000.0.0 17100000.0 17200000.0 17300000.0 17400000.0 17500000.0
17600000.0 17700000.0 17800000.0 17900000.0 18000000.0
18100000.0 18200000.0 18300000.0 18400000.0 18500000.0 18600000.0
18700000.0 18800000.0 18900000.0 19000000.0
- ENDF / B Tape Label
-

Also popular now: