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 325 records · Page 18

BLAST-Lite (Battery Lifetime Analysis and Simulation Tool - Lite) [SWR-22-69] Related to: BLAST aka: BLAST-Py

Battery Lifetime Analysis and Simulation Toolsuite (BLAST) provides a library of battery lifetime and degradation models for various commercial lithium-ion batteries from recent years. Degradation models are identified from publicly available lab-based aging data using NREL's battery life model identification toolkit. The battery life models predicted the expected lifetime of batteries used in mobile or stationary applications as functions of their temperature and use (state-of-charge, depth-of-discharge, and charge/discharge rates). Model implementation is in both Python and MATLAB programming languages. The MATLAB code also provides example applications (stationary storage and EV), climate data, and simple thermal management options. For more information on battery health diagnostics, prediction, and optimization, see NREL's Battery Lifespan webpage.

Smith, Kandler↗

Python Library For Reading Endf Files

Evaluated Nuclear Data Files (ENDFs) are the most common way to store nuclear data. However, they are a hard-to-read format that few people or programs can read. OpenMC, an open source project, developed a way to read Evaluated Nuclear Data Files (ENDF) into a useful form for python. This library will remove all unnecessary code from OpenMC to focus solely on reading nuclear data. In addition, it will handle parsing Grouped cross-section data from an ENDF file, which OpenMC does not currently handle.

Gale, MicahD.↗

PETSc/TAO Users Manual V.3.21

This manual describes the use of the Portable, Extensible Toolkit for Scientific Computation (PETSc) and the Toolkit for Advanced Optimization (TAO) for the numerical solution of partial differential equations (PDEs) and related problems on high-performance computers. PETSc/TAO is a suite of data structures and routines that provide the building blocks for implementing large-scale application codes on parallel (and serial) computers. PETSc uses the MPI standard for all distributed memory communication. PETSc/TAO includes a large suite of parallel linear solvers, nonlinear solvers, time integrators, and optimizers that may be used in application codes written in Fortran, C, C++, and Python (via petsc4py; see Getting Started ). The library is organized hierarchically, enabling users to employ the abstraction level most appropriate for a particular problem. By using techniques of object-oriented programming, PETSc provides enormous flexibility for users.

97 MATHEMATICS AND COMPUTING↗

Using Numba for GPU acceleration of Neutron Beamline Digital Twins

Digital twins of neutron instruments using Monte Carlo ray tracing have proven to be useful in neutron data analysis and verifying instrument and sample designs. However, these simulations can become quite complex and computationally demanding with tens of billions of neutrons. In this paper, we present a GPU accelerated version of MCViNE using Python and Numba to balance user extensibility with performance. Numba is an open-source just-in-time (JIT) compiler for Python using LLVM to generate efficient machine code for CPUs and GPUs with NVIDIA CUDA. The JIT nature of Numba allowed complex instrument kernels to be generated easily. Initial simulations have shown a speedup between 200-1000x over the original CPU implementation. The performance gain with Numba enables more sophisticated data analysis and impacts neutron scattering science and instrument design.

Kendrick, Coleman↗

Mahakala: A Python-based Modular Ray-tracing and Radiative Transfer Algorithm for Curved Spacetimes

We introduce Mahakala, a Python-based, modular, radiative ray-tracing code for curved spacetimes. We employ Google's JAX framework for accelerated automatic differentiation, which can efficiently compute Christoffel symbols directly from the metric, allowing the user to easily and quickly simulate photon trajectories through non-Kerr spacetimes. JAX also enables Mahakala to run in parallel on both CPUs and GPUs. Mahakala natively uses the Cartesian Kerr–Schild coordinate system, which avoids numerical issues caused by the pole in spherical coordinate systems. We demonstrate Mahakala's capabilities by simulating 1.3 mm wavelength images (the wavelength of Event Horizon Telescope observations) of general relativistic magnetohydrodynamic simulations of low-accretion rate supermassive black holes. The modular nature of Mahakala allows us to quantitatively explore how different regions of the flow influence different image features. We show that most of the emission seen in 1.3 mm images originates close to the black hole and peaks near the photon orbit. We also quantify the relative contribution of the disk, forward jet, and counterjet to 1.3 mm images.

79 ASTRONOMY AND ASTROPHYSICS↗

Simulated hydrological dynamics and coupled iron redox cycling impact methane production in an Arctic soil: Modeling Archive

This Modeling Archive is in support of an NGEE Arctic publication "Simulated hydrological dynamics and coupled iron redox cycling impact methane production in an Arctic soil" in the Journal of Geophysical Research-Biogeosciences. We simulated biogeochemical cycling in arctic soils using the PFLOTRAN geochemical model combined with measurements from previous NGEE Arctic incubations of polygonal permafrost soils in northern Alaska (Zheng et al., 2018). Simulated iron cycling, carbon dioxide production, and methane production were compared with incubation measurements and the parameterized model was then used to simulate coupled iron and carbon cycling over repeated oxic-anoxic cycles at different levels of carbon substrate availability and pH. The most recent data version (2.0) in the archive incorporates changes to the model and simulations as suggested by reviewers during the manuscript review process. These changes include an updated parameterization of the model; a new set of simulations omitting the iron cycle for direct evaluation of how iron cycle processes affect modeled outcomes; and a set of simulations testing different scenarios of carbon substrate availability in addition to scenarios of initial soil pH. This archive contains simulation code, model output, and analysis code for PFLOTRAN simulations. All scripts are python except the batch script for submitting multiprocessor jobs. Note that the model also requires compiled versions of the Alquimia interface and the NGEE Arctic fork of the PFLOTRAN geochemical simulator (see the README_INSTALL document for basic instructions). The Output directory contains eight data files in netCDF format generated by the model. The Next-Generation Ecosystem Experiments: Arctic (NGEE Arctic), was a 10-year research effort (2012-2022) to reduce uncertainty in Earth System Models by developing a predictive understanding of carbon-rich Arctic ecosystems and feedbacks to climate. NGEE Arctic was supported by the Department of Energy's Office of Biological and Environmental Research. The NGEE Arctic project had two field research sites: 1) located within the Arctic polygonal tundra coastal region on the Barrow Environmental Observatory (BEO) and the North Slope near Utqiagvik (Barrow), Alaska and 2) multiple areas on the discontinuous permafrost region of the Seward Peninsula north of Nome, Alaska. Through observations, experiments, and synthesis with existing datasets, NGEE Arctic provided an enhanced knowledge base for multi-scale modeling and contributed to improved process representation at global pan-Arctic scales within the Department of Energy's Earth system Model (the Energy Exascale Earth System Model, or E3SM), and specifically within the E3SM Land Model component (ELM).

54 ENVIRONMENTAL SCIENCES↗

Annual Technology Baseline: ATB-calc Open Source Tools [Slides]

The Annual Technology Baseline (ATB) team will introduce the new open-source Python tools for processing and interacting with electricity ATB data and provide helpful user demonstrations, including how to: extract data from the ATB workbook and calculate levelized cost of electricity (LCOE) in Python; programmatically interact with and modify ATB data; and use the tools to modify the tax credit assumptions of the ATB to account for bonus credits from the Inflation Reduction Act of 2022.

29 ENERGY PLANNING, POLICY, AND ECONOMY↗

TokaMaker: An open-source time-dependent Grad-Shafranov tool for the design and modeling of axisymmetric fusion devices

Here, in this paper, we present a new static and time-dependent MagnetoHydroDynamic (MHD) equilibrium code, TokaMaker, for axisymmetric configurations of magnetized plasmas, based on the well-known Grad-Shafranov equation. This code utilizes finite element methods on an unstructured triangular grid to enable capturing accurate machine geometry and simple mesh generation from engineering-like descriptions of present and future devices. The new code is designed for ease of use without sacrificing capability and speed through a combination of Python, Fortran, and C/C++ components. A detailed description of the numerical methods of the code, including a novel formulation of the boundary conditions for free-boundary equilibria, and validation of the implementation of those methods using both analytic test cases and cross-code validation is shown. Results show expected convergence across tested polynomial degree for analytic and cross-code test cases.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

Multi-genome Phage Annotation Toolkit and Evaluator

Summary: To address the need for improved tools for annotation and comparative genomics of bacteriophage genomes, we developed multiPhATE2. As an extension of the multiPhATE code, multiPhATE2 includes comparative genomics codes for gene matching among sets of input bacteriophage genomes, and scales well to large input data sets due to incorporation of multiprocessing in the functional annotation and comparative genomics subsystems. Furthermore, additional search algorithms and databases have been added to the functional annotation subsystem. MultiPhATE2 was implemented in Python 3.7, and runs as a command-line code under Linux or MAC-OS.

Kimbrel, JeffreyA.↗

MultiPhATE2: code for functional annotation and comparison of phage genomes

To address a need for improved tools for annotation and comparative genomics of bacteriophage genomes, we developed multiPhATE2. As an extension of multiPhATE, a functional annotation code released previously, multiPhATE2 performs gene finding using multiple algorithms, compares the results of the algorithms, performs functional annotation of coding sequences, and incorporates additional search algorithms and databases to extend the search space of the original code. MultiPhATE2 performs gene matching among sets of closely related bacteriophage genomes, and uses multiprocessing to speed computations. MultiPhATE2 can be re-started at multiple points within the workflow to allow the user to examine intermediate results and adjust the subsequent computations accordingly. In addition, multiPhATE2 accommodates custom gene calls and sequence databases, again adding flexibility. MultiPhATE2 was implemented in Python 3.7 and runs as a command-line code under Linux or MAC operating systems. Full documentation is provided as a README file and a Wiki website.

59 BASIC BIOLOGICAL SCIENCES↗

Code associated with Publication “Analytic Solutions and Field-Scale Application for Verification of Coupled Thermo-Hydro-Mechanical Processes in Subsurface Fractured Media”

As part of a submitted paper, which is collection of previously published analytical solutions to coupled thermo-hydro-mechanical problems in subsurface flow and transport, we have prepared a collection of python scripts to compute and plot those analytic solutions. All code to be released implements existing methods; there are no novel algorithms nor any major innovations to existing software.

Hyman, Jeffrey↗

Investigating resource-efficient neutron/gamma classification ML models targeting eFPGAs

There has been considerable interest and resulting progress in implementing machine learning (ML) models in hardware over the last several years from the particle and nuclear physics communities. A big driver has been the release of the Python package, hls4ml, which has enabled porting models specified and trained using Python ML libraries to register transfer level (RTL) code. So far, the primary end targets have been commercial field-programmable gate arrays (FPGAs) or synthesized custom blocks on application specific integrated circuits (ASICs). However, recent developments in open-source embedded FPGA (eFPGA) frameworks now provide an alternate, more flexible pathway for implementing ML models in hardware. These customized eFPGA fabrics can be integrated as part of an overall chip design. In general, the decision between a fully custom, eFPGA, or commercial FPGA ML implementation will depend on the details of the end-use application. In this work, we explored the parameter space for eFPGA implementations of fully-connected neural network (fcNN) and boosted decision tree (BDT) models using the task of neutron/gamma classification with a specific focus on resource efficiency. We used data collected using an AmBe sealed source incident on Stilbene, which was optically coupled to an OnSemi J-series silicon photomultiplier (SiPM) to generate training and test data for this study. We investigated relevant input features and the effects of bit-resolution and sampling rate as well as trade-offs in hyperparameters for both ML architectures while tracking total resource usage. The performance metric used to track model performance was the calculated neutron efficiency at a gamma leakage of 10 -3 . The results of the study will be used to aid the specification of an eFPGA fabric, which will be integrated as part of a test chip.

47 OTHER INSTRUMENTATION↗

Open database for GPD analyses

This article summarizes the main ideas behind creating an open database proposed for use in the exploration of generalized parton distributions (GPDs). This lightweight database is well suited for GPD phenomenology and is designed to store both experimental and lattice-QCD data. It can also aid in benchmarking GPD-related developments, such as GPD models. The database utilizes a new data format based on the YAML serialization language, enabling the storage of essential information for modern analyses, such as replica values. It includes interfaces for both Python and C++, allowing straightforward integration with analysis codes.

Burkert, V. D. [Thomas Jefferson National Accelera↗

ATLAS: a Snakemake workflow for assembly, annotation, and genomic binning of metagenome sequence data

Background: Metagenomics and metatranscriptomics studies provide valuable insight into the composition and function of microbial populations from diverse environments, however the data processing pipelines that rely on mapping reads to gene catalogs or genome databases for cultured strains yield results that underrepresent the genes and functional potential of uncultured microbes. Recent improvements in sequence assembly methods have eased the reliance on genome databases, thereby allowing the recovery of genomes from uncultured microbes. However, configuring these tools, linking them with advanced binning and annotation tools, and maintaining provenance of the processing continues to be challenging for researchers. Results: Here we present ATLAS, a software package for customizable data processing from raw sequence reads to functional and taxonomic annotations using state-of-the-art tools to assemble, annotate, quantify, and bin metagenome and metatranscriptome data. Genome-centric resolution and abundance estimates are provided for each sample in a dataset. ATLAS is written in Python and the workflow implemented in Snakemake; it operates in a Linux environment, and is compatible with Python 3.5+ and Anaconda 3+ versions. The source code for ATLAS is freely available, distributed under a BSD-3 license. Conclusions: ATLAS provides a user-friendly, modular and customizable Snakemake workflow for metagenome and metatranscriptome data processing; it is easily installable with conda and maintained as open-source on GitHub at https://github.com/metagenome-atlas/atlas.

59 BASIC BIOLOGICAL SCIENCES↗

Developing and testing capabilities for simulating cases with heterogeneous land/water surfaces in a novel atmospheric large eddy simulation code

Large eddy simulations (LES) are the primary computational tool used to simulate high Reynolds number three-dimensional turbulent flows. In the context of earth system sciences, particularly atmospheric science, LES are uniquely able to resolve the scales of atmospheric motion that are key for building process-level understanding of boundary layer turbulence, atmosphere-surface interaction, clouds, and cloud-aerosol-chemistry interaction, and are a core limited-area modeling capability. Increasing demands are being placed on LES code bases as growing high performance computing resources allow LES to address a wider range of scientific problems. In addition, LES are emerging as a source of high-quality machine learning training data. These demands necessitate an agile and extensible code base that allows the model to quickly adapt to emergent needs. However, LES have largely relied on legacy Fortran code bases that lack flexibility. A new, Python-based LES capability called Predicting INteractions of Aerosol and Clouds in Large Eddy Simulation (PINACLES) has been developed as part of the Department of Energy’s Earth System Model Development (ESMD) program area’s Enabling Aerosol-cloud interactions at Global convection-permitting scalES (EAGLES) project. PINACLES was developed from the ground up with a philosophy of maximizing scientific throughput, by attempting to optimize for both model throughput and software extensibility. The initial development of PINACLES delivered a state-of-the-art idealized LES capability solving the non-hydrostatic anelastic equations of motion with doubly periodic boundary conditions and idealized homogenous surface boundary conditions. Here we provide a final report on the outcomes of a fiscal year 2021 Seed Laboratory Directed Research Project that extended PINACLES in two key ways. First, PINACLES was coupled to a state-of-the-art land surface model enabling it to simulate spatially inhomogeneous land-atmosphere interactions that are known to control key atmospheric processes. Second, the dynamical core of PINACLES was modified to permit non-periodic boundary conditions. This model enhancement enables simulation of realistic cases with boundary conditions prescribed from atmospheric reanalysis and enables nested simulations conducted on a hierarchy of computational domains with increasing resolution. Together, these extensions to PINACLES make it a formidable modeling capability and expand its potential application to diverse components of DOE’s atmospheric science portfolio.

42 ENGINEERING↗

Static Controls Performance Tool for Lunar Landers

This document presents a static analysis tool used to evaluate the controllability of Lunar landers. This was created as part of the NASA Lunar Cargo Transportation and Landing by Soft Touchdown (Lunar CATALYST) program. This tool is capable of accepting typical design information such as location and direction of thrusters, maximum thruster forces, gravity vectors, and center of mass locations. The tool evaluates how far the center of gravity can move from its starting position while still maintaining control. This type of analysis is intended to support results produced by time domain simulations. The code created for this project was implemented in Python, and it was designed to be integrated into systems level optimization tools to yield first-cut results on optimal thruster placement.

Aretskin-Hariton, Eliot D.↗

Julia Programming Language Benchmark Using a Flight Simulation

Julia’s goal to provide scripting language ease-of-coding with compiled language speed is explored. The runtime speed of the relatively new Julia programming language is assessed against other commonly used languages including Python, Java, and C++. An industry-standard missile and rocket simulation, coded in multiple languages, was used as a test bench for runtime speed. All language versions of the simulation, including Julia, were coded to a highly-developed object-oriented simulation architecture tailored specifically for time-domain flight simulation. A “speed-of-coding” second-dimension is plotted against runtime for each language to portray a space that characterizes Julia’s scripting language efficiencies in the context of the other languages. With caveats, Julia runtime speed was found to be in the class of compiled or semi-compiled languages. However, some factors that affect runtime speed at the cost of ease-of-coding are shown. Julia’s built-in functionality for multi-core processing is briefly examined as a means for obtaining even faster runtime speed. The major contribution of this research to the extensive language benchmarking body-of-work is comparing Julia to other mainstream languages using a complex flight simulation as opposed to benchmarking with single algorithms.

Sells, Ray↗

Improving Access to the GEOS Composition Forecast Model with API Development and Ingestion into Google Earth Engine

The GEOS Composition Forecast (GEOS-CF) model produces forecast and historical estimates of atmospheric composition and meteorology fields, which provide useful insight into air quality issues and events. In a year for which Canadian wildfires created adverse air quality conditions in the eastern United States, access to model fields such as PM2.5 are in high demand. The GEOS-CF team at the NASA Global Modeling and Assimilation Office (GMAO) first developed in-house solutions to improve data access via the CF API, and recently partnered with Google to ingest a collated set of model diagnostics into the Google Earth Engine (GEE) data repository. GEOS-CF model output is also being ingested into AWS storage. Creating these various open access points to GEOS-CF model diagnostics provides the public with an opportunity to easily interact with air quality information. Users are able to use a temporally consistent global grid of air quality fields in machine learning applications, mapping tools, and data informatics. Hosting GEOS-CF forecasts and the historical timeseries of these chemistry and meteorology fields in GEE allows users to create dynamic JavaScript-based air quality applications in the GEE code editor. GEOS-CF users can also access the model output via the GEE Python application programming interface (API), making it easy to perform various analyses with Python. This presentation will show two examples of accessing the GEOS-CF model through GEE. The first is an example application made in the GEE code editor which allows users to view time series plots and downscaled maps of surface level NO2. The second example exhibits using the GEE Python API to create a machine learning model to temporally gap-fill between air quality observations. These examples are an introduction to the many possible benefits of having open access to the GEOS-CF model through multiple platforms.

Callum Wayman↗