Engineering Papers⌕ Search

SEARCH · Engineering Papers

Results for “Python codes”

Search indexed NASA NTRS and DOE OSTI research on propulsion, heat transfer, battery materials and energy systems. Follow report and document links to the original sources.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

At least 217 records · Page 12

Integration of the Kromek D3S Detector and Spot Robot For Secondary Inspections

Inspecting vehicles and containers for the presence of nuclear material is a challenging task for border control and security. When performed manually by inspectors, this task also has an associated risk of exposing the inspectors to unknown radiation. With the advent of agile, easy-to-program, quadruped robots like the Boston Dynamics Spot, automation of secondary inspection can improve the efficiency of the inspection process and alleviates the radiation risks to inspectors. In this project, Brookhaven National Laboratory and the University of Massachussetts at Lowell explored how to automate a simple secondary inspection mission. The Spot robot comes with its own software development kit (SDK) that allows clients/users to write custom code in the Python programming language to control the robot. Spot also has a payload computer called Spot-CORE, which runs the Ubuntu Linux operating system and allows users to integrate external sensors, such as a radiation detector, with Spot. In this study, the Kromek D3S detector has been integrated with Spot via the Spot-CORE, allowing Spot to capture gamma spectra and neutron counts for a specified acquisition period. Two custom routines, search and confirmation, have been developed and executed in this specified order. The search routine directs Spot to go around the nearest obstacle, e.g., vehicle and container, in a preset distance and step to collect gamma and neutron gross counts with the D3S detector. The radiation data and the robot location corresponding to each step are stored and fed to the confirmation routine at the end of the search. The confirmation routine then navigates Spot to the locations of the highest gamma or neutron counts to perform a long, e.g., one minute, measurement, and gives the operators the signature gamma spectra and neutron counts at the hotspots. This paper presents a detailed description of this automated system along with results of the preliminary tests in identifying the location and signature of a 137Cs radiation source in a vehicle.

98 NUCLEAR DISARMAMENT, SAFEGUARDS, AND PHYSICAL P↗

JSPEC: A Program for IBS and Electron Cooling Simulation

JSPEC (JLab Simulation Package on Electron Cooling) is an open-source C++ program developed at Jefferson Lab to simulate the evolution of the ion beam under the intrabeam scattering effect and/or the electron cooling effect. JSPEC includes various models of the ion beam, the electron beam, and the friction force, aiming to reflect the latest advances in the field and to provide a useful tool to the community. JSPEC has been benchmarked against other cooling simulation codes and experimental data. It has been used to support the cooler design for JLEIC, an earlier JLab design for the Electron-Ion Collider. A Python wrapper of the C++ code, pyJSPEC, for Python 3.x environment has also been developed and released. It allows users to run JSPEC simulations in a Python environment and makes it possible for JSPEC to collaborate with other accelerator and beam modeling programs, as well as plentiful Python tools in data visualization, optimization, machine learning, etc. In this report, we introduce the features of JSPEC, with a focus on the latest development, and demonstrate how to use JSPEC and pyJSPEC with sample codes and numerical examples.

Accelerator Physics↗

ThunderBoltz API

The ThunderBoltz application programming interface (API) code is written in Python and is comprised of a set of tools to facilitate compilation of the ThunderBoltz code, as well as fast assembly and formatting of input files for the ThunderBoltz code, post-processing tools of ThunderBoltz results, plotting tools, and runs/schedules the ThunderBoltz code executable for calculations. The ThunderBoltz API code is utilized for importing and manipulating input cross section sets, input conditions, and any other simulation settings made available within the ThunderBoltz input deck via user-defined settings or via automatic generation. The API comes with a set of plotting capabilities of input cross sections, results from ThunderBoltz, and post-processed results carried out with the API.

Park, Ryan↗

An X-ray Intensity Operations Monitor (AXIOM) (Final LDRD Project Report)

The Saturn accelerator has historically lacked the capability to measure time-resolved spectra for its 3-ring bremsstrahlung x-ray source. This project aimed to create a spectrometer called AXIOM to provide this capability. The project had three major development pillars: hardware, simulation, and unfold code. The hardware consists of a ring of 24 detectors around an existing x-ray pinhole camera. The diagnostic was fielded on two shots at Saturn and over 100 shots at the TriMeV accelerator at Idaho Accelerator Center. A new Saturn x-ray environment simulation was created using measured data to validate. This simulation allows for timeresolved spectra computation to compare the experimental results. The AXIOM-Unfold code is a new parametric unfold code using modern global optimizers and uncertainty quantification. The code was written in Python, uses Gitlab version control and issue tracking, and has been developed with long term code support and maintenance in mind.

43 PARTICLE ACCELERATORS↗

Improved Verification and Validation Testing and Tools including Nuclear Criticality Safety Applications with the MCNP6.3® Code [Abstract]

A new Python-based framework has been developed to enable a more consistent layout with automatable setup, execution, and documentation of all verification and validation (V&V) test suites previously established for use with the MCNP code. In this paper, the new general framework for the V&V test suites is discussed, including information on all of the current capabilities and plans for future capabilities. For nuclear criticality safety applications, the existing V&V benchmark problems within the criticality, extended criticality, and analytic k-effective test suites have been ported into this new framework. In addition, the status and updates to the Rossi-alpha and subcritical multiplicationtest suites will be discussed. Some V&V results exercising new MCNP6.3 capabilities will be demonstrated.

97 MATHEMATICS AND COMPUTING↗

User’s Manual for Seal_Flux: A Seal Barrier Reduced-Order Model (Update)

This report provides a brief description on the use of the Seal_Flux computer program developed as part of the effort to quantify the risk of geologic storage of carbon dioxide (CO 2 ) under the U.S. Department of Energy’s (DOE) National Risk Assessment Partnership (NRAP). The Seal_Flux code simulates the flow of CO 2 through a low permeability rock horizon or seal formation overlying the storage reservoir into which CO 2 is injected. A two-phase, relative permeability approach with Darcy’s law is used for one-dimensional (1D) flow computations of CO 2 through the horizon in the vertical direction. The code also allows the simulation of time-dependent processes that can influence such flow. However, as part of its design, Seal_Flux is what can be termed a “reduced-order model” (ROM) and is not intended as a full-functioning flow code. The theory and simulation in the code is streamlined and directed towards the implementation of Monte Carlo risk analyses of CO 2 transport or as termed in this context as “leakage.” While presented in this report as a stand-alone tool, the Seal_Flux code is intended to function in the future as one of several models as part of an integrated, systems-level model of CO 2 storage performance. Finally, the code is written in Python 3.10 to provide an open framework for further development by others and to assist in linking the code with other modules in an integrated assessment model.

58 GEOSCIENCES↗

Large language model evaluation for high–performance computing software development

We apply AI-assisted large language model (LLM) capabilities of GPT-3 targeting high-performance computing (HPC) kernels for (i) code generation, and (ii) auto-parallelization of serial code in C ++, Fortran, Python and Julia. Our scope includes the following fundamental numerical kernels: AXPY, GEMV, GEMM, SpMV, Jacobi Stencil, and CG, and language/programming models: (1) C++ (e.g., OpenMP [including offload], OpenACC, Kokkos, SyCL, CUDA, and HIP), (2) Fortran (e.g., OpenMP [including offload] and OpenACC), (3) Python (e.g., numpy, Numba, cuPy, and pyCUDA), and (4) Julia (e.g., Threads, CUDA.jl, AMDGPU.jl, and KernelAbstractions.jl). Kernel implementations are generated using GitHub Copilot capabilities powered by the GPT-based OpenAI Codex available in Visual Studio Code given simple + + prompt variants. To quantify and compare the generated results, we propose a proficiency metric around the initial 10 suggestions given for each prompt. For auto-parallelization, we use ChatGPT interactively giving simple prompts as in a dialogue with another human including simple “prompt engineering” follow ups. Results suggest that correct outputs for C++ correlate with the adoption and maturity of programming models. For example, OpenMP and CUDA score really high, whereas HIP is still lacking. We found that prompts from either a targeted language such as Fortran or the more general-purpose Python can benefit from adding language keywords, while Julia prompts perform acceptably well for its Threads and CUDA.jl programming models. Finally, we expect to provide an initial quantifiable point of reference for code generation in each programming model using a state-of-the-art LLM. Overall, understanding the convergence of LLMs, AI, and HPC is crucial due to its rapidly evolving nature and how it is redefining human-computer interactions.

97 MATHEMATICS AND COMPUTING↗

ENDFtk: A robust tool for reading and writing ENDF-formatted nuclear data

ENDFtk is a recently developed C++ and Python interface to interact with ENDF-6 formatted nuclear data files. It provides a robust and complete interface, allowing the reading and writing of all formats currently part of the ENDF-6 formats manual, as well as some non-ENDF formats used by the NJOY processing code. It provides an interface that mimics the names in the ENDF-6 formats manual as well as an equivalent interface using human-readable attribute names. It is robust and powerful enogh for nuclear data experts to develop complex applications, while also simple enough to be used non-experts to retrieve and manipulate evaluated nuclear data. ENDFtk offers the ability to easily interrogate and manipulate data either in large-scale code projects or in simple Python scripts. Here, in this paper, a brief overview of the interface is given, as well as more substantial examples demonstrating plotting simple data, interacting with more complex data, and writing new data to files. ENDFtk is open source and available for download via GitHub (https://github.com/njoy/ENDFtk).

97 MATHEMATICS AND COMPUTING↗

Scientific Computational Imaging Code (SCICO)

Scientific Computational Imaging Code (SCICO) is a Python package for solving the inverse problems that arise in scientific imaging applications. Its primary focus is providing methods for solving ill-posed inverse problems by using an appropriate prior model of the reconstruction space. SCICO includes a growing suite of operators, cost functionals, regularizers, and optimization routines that may be combined to solve a wide range of problems, and is designed so that it is easy to add new building blocks. SCICO is built on top of JAX rather than NumPy, enabling GPU/TPU acceleration, just-in-time compilation, and automatic gradient functionality, which is used to automatically compute the adjoints of linear operators. An example of how to solve a multi-channel tomography problem with SCICO is shown in Figure 1. The SCICO source code is available from GitHub, and pre-built packages are available from PyPI. It has extensive online documentation, including API documentation and usage examples, which can be run online at Google Colab and binder.

97 MATHEMATICS AND COMPUTING↗

PyAlbany: A Python interface to the C++ multiphysics solver Albany

Albany is a parallel C++ finite element library for solving forward and inverse problems involving partial differential equations (PDEs). In this paper we introduce PyAlbany, a newly developed Python interface to the Albany library. PyAlbany can be used to effectively drive Albany enabling fast and easy analysis and post-processing of applications based on PDEs that are pre-implemented in Albany. PyAlbany relies on the library PyBind11 to bind Python with C++ Albany code. Here we detail the implementation of PyAlbany and showcase its capabilities through a number of examples targeting a heat-diffusion problem. In particular we consider the following: (1) the generation of samples for a Monte Carlo application, (2) a scalability study, (3) a study of parameters on the performance of a linear solver, and finally (4) a tool for performing eigenvalue decompositions of matrix-free operators for a Bayesian inference application.

97 MATHEMATICS AND COMPUTING↗

Inputs, Outputs and Plotting Scripts for paper Extending near-axis equilibria in DESC

Python scripts and outputs from the DESC and pyQSC/pyQIC codes used to create the results in the paper "Extending near-axis equilibria in DESC". The contained README file has the details of which scripts create which figures, as well as on what versions of the codes were used. The repo also contains python pickle (.p) files and .txt files with the data used to create each figure (which are used by the plotting scripts).

DESC↗

Calculation of machine precision second order derivatives using dual-complex numbers

It is well known that both complex and dual numbers can be employed to obtain machine precision first-order derivatives; however, neither, on their own, can compute machine precision 2nd order derivatives. To address this limitation, it is demonstrated in this paper that combined dual-complex numbers can be used to compute machine precision 1st and 2nd order derivatives. The dual-complex approach is simpler than utilizing multicomplex or hyper-dual numbers as existing dual libraries can be used as is or easily augmented to accept complex numbers, and the complexity of developing, integrating, and deploying multicomplex or hyper-dual libraries is avoided. The efficacy of this approach is demonstrated for both univariate and multivariate functions. Finally, source code examples using the Python, Julia, and Mathematica languages are provided as supplemental material.

97 MATHEMATICS AND COMPUTING↗

Design workflow of a symmetric traveling wave antenna for fast ion production on DD tokamaks

Initial computational plasma physics scoping and a finite element method antenna modeling design workflow for a symmetric center-fed high-field side high harmonic fast wave traveling wave array (TWA) antenna are reported here. The TWA is designed to generate a test population of fast deuterium ions in an existing D–D tokamak by heating neutral beam deuterium ions, accelerating them from 80 keV to several hundred keV. The resulting fast particles are tailored to mimic key reactor energetic particle parameters with regards to exciting Alfven eigenmode instabilities, allowing for a D–D tokamak like DIII-D or ASDEX-U to replicate reactor-relevant conditions experimentally. Initial scenario scoping for high single-pass absorption as well as good preferential fast ion damping relative to electron damping was completed using the ray-tracing/Fokker–Planck codes GENRAY and CQL3D. Python RF network analysis packages were used to create a custom TWA optimization tool to inform a COMSOL flat antenna design, and Petra-M was used to study cold plasma effects. The TWA produced by this workflow has several novel features when compared to previous TWA studies, including symmetric center feeding, and passive end straps for image current cancellation for reduced impurity production. We show here that the antenna design workflow can readily produce TWA antennas optimized for reflection coefficient, image current cancellation, and launched power spectrum shape; and that a population of fast ions can be generated in the correct region of parameter space, warranting future more detailed studies.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

CEGANN: CRYSTAL EDGE GRAPH ATTENTION NEURAL NETWORK

SF-22-156 Machine learning (ML) models and applications in materials design and discovery typically involve the use of feature representations or descriptors followed by a learning algorithm that maps them to user desired properties of interest. Most popular mathematical formulation-based descriptors are not unique across atomic environments and suffer from transferability issues across different application domains and/or material classes. The CEGANN code provides a unified interface to facilitate material characterization across materials across multiple scales (from atomic to mesoscale) and diverse classes of materials ranging from metals oxides, non-metals, and even hierarchical materials such as zeolites and semi ordered materials such as mesophases. CEGANN implements a Graph Attention Network (GAT) type convolution architecture. The details of network architecture can be found in the paper https://doi.org/10.48550/arXiv.2207.10168. The software comes with pretrained examples and dataset for the classification of the following representative systems: (1) Structure-level representation such as space group (2) Structural dimensionality (e.g., bulk, 2D, clusters etc.) (3) Grain boundary identification (4) Nucleation and growth of a zeolite polymorph (5) Characterization of binary mesophases and their phase transitions (6) Growth of ice. The code is written in python programming language.

CHAN, HENRYT↗

A Data Processing Pipeline To Extract A Knowledge Graph From Sec Documents For Socio-technical Analysis Of Critical Infrastructure Influence

The code is written in Python and consists of the following pipeline that is implemented in Apache Airflow. This pipeline intends to understand the companies that are directly or indirectly involved with a type of critical infrastructure system at some point in that system's lifecycle. The pipeline takes a configuration file that specifies a list of initial companies to consider, a geographic region of interest (disk) expressed as a latitude/longitude point and distance, and a set of SEC form types from which to extract entities and relations. There are three main components to this pipeline as currently implemented: Social Network Extraction, Critical Infrastructure Network Extraction, and Inference and Fusion. First, Social Network Extraction, implemented as the `organizations_sec` component of the workflow graph queries the SEC EDGAR webservice using the list of initial companies from the configuration file. Given this, it extracts metadata that documents the number of each type of form for the given set of companies and their location. This forms metadata represents a catalog of data sources for the extracted social network knowledge graph. The pipeline then downloads these forms from the website and saves them in a build directory for further processing. These documents are then parsed for entities and relations. Second, the Critical Network Extraction component extracts entities and relations for a critical infrastructure sector. Currently, we focus on Electric Vehicle charging stations and this information is available via the Department of Energy (DOE) database on fueling stations maintained by NREL. Third, the Inference and Fusion component relates the social network graph to the critical infrastructure graph in order to understand the impact of a company within a geographic region. Relations include ownership of the EV Charging Station asset as well as maintenance/ownership of the EV payment networks. The fused network can be represented in many ways and currently we emit a knowledge graph.

Weaver, GabrielA.↗

DeepLensSBI: Deep inference of simulated strong lenses in ground-based surveys

This code is used to train and test machine learning models and generate results and plots presented in 2501.08524 [astro-ph.IM]. The code is written in python. The goal of this work is to train ML models trained on simulated images of strong gravitational lenses. The trained model can then quickly infer properties of the lensed objects with uncertainty quantification.

Poh, Jason [Univ. of Chicago, IL (United States)] ↗

BEST USE OF BIOMASS

SF-25-046 Biomass resources are widely available in United States, however to utilize the resources we need to assess the bioenergy pathways per their economic and environmental performance. The framework combines several developments in the research field and integrates into a software easy to use and expand upon to study various bioenergy pathways.The software code is developed in Python language and works with an Excel based dashboard.

Saurajyoti, Kar [Argonne National Laboratory (ANL)↗

A Data Processing Pipeline To Extract A Knowledge Graph From Heterogeneous Data For Socio-technical Analysis Of Critical Infrastructure Influence

The code is written in Python and consists of the following pipeline that is implemented in Apache Airflow. This pipeline intends to understand the companies that are directly or indirectly involved with a type of critical infrastructure system at some point in that system's lifecycle. The pipeline takes a configuration file that specifies a list of initial companies to consider, a geographic region of interest, and a set of SEC form types as well as other data sources (e.g. CrunchBase) from which to extract entities and relations. There are four main components to this pipeline as currently implemented: Entity Extraction, Network Construction, Analysis, and Visualization. First, Entity Extraction, is implemented as the `topear-extract_organizations` Apache Airflow workflow. Given an initial query that specifies a geographic region of interest and a time interval, the software will extract CI facilities of interest and organizations that have a direct influence relationship to those facilities (e.g. ownership). During the course of the LDRD, we focused on Electric Vehicle charging stations and this information is available via the Department of Energy (DOE) database on fueling stations maintained by NREL. Within the context of the DOE CESER project, we have focused on Battery Energy Storage Systems (BESS). Second, the Network Extraction component will iteratively construct a social network graph given the set of organizations and people extracted in the previous step. Organizations (and eventually People if desired) are then fed as a query to the `topgear-construct_social_network` Apache Airflow workflow which given a set of initial companies and data sets (e.g. SEC EDGAR form types, OpenCorporates, Crunchbase). This Airflow workflow will iteratively query such data sources to discover relationships with new organizations and people. For example, this module can iteratively query SEC EDGAR for metadata that documents the number of each type of form for the given set of companies and their location. This forms metadata represents a catalog of data sources from SEC EDGAR for the extracted social network knowledge graph. The pipeline then downloads these forms from the website and saves them in a build directory for further processing. These documents are then parsed for entities and relations. Again, we note that in additional to SEC data sources, this step can also pull in information on organizations via API services such as CrunchBase and OpenCorporates or bulk data sources. At the end of this step, the resultant social network, the Critical Infrastructure network, and the edges that encode relationships between organizations and CI facilities, form the Adversarial Socio-Technical Network (ASTN) that informs the analysis. Third, the Analysis component processes these generated ASTN. Previously, that has included the ability to compare prevalence of different vendors for a given infrastructure component type across different regions as well as identify common public and private investors across those vendors. This was demonstrated for EV Charging Stations across several different metropolitan areas within an IEEE PES GridEdge publication. More recently, we have looked at ways to identify infrastructure owners and operators of BESS with the most nameplate capacity across different states as well as other indictors of risk resulting from changes in ownership over time. Finally, the Visualization component consists of an HTML/CSS/JS framework by which users can interact geospatial, operational, and organizational relationships across a given portfolio of Critical Infrastructure facilities. The objective is to provide a library of UI/UX modules that can be repurposed for stakeholder-specific dashboards. All of the modules are related via a common event model that enables UI actions in one view to percolate across the other views.

Weaver, Gabriel [Idaho National Laboratory (INL), ↗