Search NASA⌕ Search

SEARCH · Search NASA

Results for “Python implementation”

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 361 records · Page 20

Hybrid-RL-MPC4CLR (Hybird-Reinforcement-Learning-Model-Predictive-Control-for-Reserve-Policy-Assisted-Critical-Load-Restoration-in-Distribution-Grids)

Hybrid-RL-MPC4CLR was developed as a hybrid controller for active distribution grid critical load restoration, combining deep reinforcement learning (RL) and model predictive control (MPC) aiming at maximizing total restored load following an extreme event. The RL determines a policy for quantifying operating reserve requirements, thereby hedging against uncertainty, while the MPC models grid operations incorporating the RL policy actions (i.e., reserve requirements), renewable (wind and solar) power predictions, and load demand forecasts. The developers formulated the reserve requirement determination problem as a sequential decision-making problem based on the Markov Decision Process (MDP) and design an RL learning environment based on the OpenAI Gym framework and MPC simulation. The RL agent reward and MPC objective function aim to maximize and monotonically increase total restored load and minimize load shedding and renewable power curtailment. The software is developed using various software packages in Python. The MPC's optimal power flow (OPF) model is implemented using the Pyomo package, the RL simulation environment is implemented using the MPC simulation with various scenarios of renewable energy and load demand profiles and power outage beginning times, based on the OpenAI Gym framework. The RL agent training is performed using the RLlib Ray package. The RL algorithm is trained offline using historical forecasts of renewable generation and load demand profiles. Simulation analysis and performance tests are conducted using a modified IEEE 13-bus distribution test feeder containing wind turbine, photovoltaic, microturbine, and battery.

Eseye, Abinet Tesfaye↗

NNFDivergence

The code implements f divergence regularization for neural networks in the Python-based Pytorch framework. The methods are the main focus but the repository will also contain examples that operate on purely synthetic "toy" data or on openly available, public data from NASA.

Klein, Natalie [@lanl]↗

Enabling AI in synthetic biology through Construction File specification

The Construction File (CF) specification establishes a standardized interface for molecular biology operations, laying a foundation for automation and enhanced efficiency in experiment design. It is implemented across three distinct software projects: PyDNA_CF_Simulator, a Python project featuring a ChatGPT plugin for interactive parsing and simulating experiments; ConstructionFileSimulator, a field-tested Java project that showcases 'Experiment' objects expressed as flat files; and C6-Tools, a JavaScript project integrated with Google Sheets via Apps Script, providing a user-friendly interface for authoring and simulation of CF. The CF specification not only standardizes and modularizes molecular biology operations but also promotes collaboration, automation, and reuse, significantly reducing potential errors. The potential integration of CF with artificial intelligence, particularly GPT-4, suggests innovative automation strategies for synthetic biology. While challenges such as token limits, data storage, and biosecurity remain, proposed solutions promise a way forward in harnessing AI for experiment design. This shift from human-driven design to AI-assisted workflows, steered by high-level objectives, charts a potential future path in synthetic biology, envisioning an environment where complexities are managed more effectively.

59 BASIC BIOLOGICAL SCIENCES↗

Characterization of Crystallographic Structures Using Bragg-Edge Neutron Imaging at the Spallation Neutron Source

Over the past decade, wavelength-dependent neutron radiography, also known as Bragg-edge imaging, has been employed as a non-destructive bulk characterization method due to its sensitivity to coherent elastic neutron scattering that is associated with crystalline structures. Several analysis approaches have been developed to quantitatively determine crystalline orientation, lattice strain, and phase distribution. In this study, we report a systematic investigation of the crystal structures of metallic materials (such as selected textureless powder samples and additively manufactured (AM) Inconel 718 samples), using Bragg-edge imaging at the Oak Ridge National Laboratory (ORNL) Spallation Neutron Source (SNS). Firstly, we have implemented a phenomenological Gaussian-based fitting in a Python-based computer called iBeatles. Secondly, we have developed a model-based approach to analyze Bragg-edge transmission spectra, which allows quantitative determination of the crystallographic attributes. Moreover, neutron diffraction measurements were carried out to validate the Bragg-edge analytical methods. These results demonstrate that the microstructural complexity (in this case, texture) plays a key role in determining the crystallographic parameters (lattice constant or interplanar spacing), which implies that the Bragg-edge image analysis methods must be carefully selected based on the material structures.

47 OTHER INSTRUMENTATION↗

High-Performance Multi-Mode Ptychography Reconstruction on Distributed GPUs

Abstract—Ptychography is an emerging imaging technique that is able to provide wavelength-limited spatial resolution from spec-imen with extended lateral dimensions. As a scanning microscopy method, a typical two-dimensional image requires a number of data frames. As a diffraction-based imaging technique, the real-space image has to be recovered through iterative reconstruction algorithms. Due to these two inherent aspects, a ptychographic reconstruction is generally a computation-intensive and time-consuming process, which limits the throughput of this method. We report an accelerated version of the multi-mode difference map algorithm for ptychography reconstruction using multiple distributed GPUs. This approach leverages available scientific computing packages in Python, including mpi4py and PyCUDA, with the core computation functions implemented in CUDA C. We find that interestingly even with MPI collective communications, the weak scaling in the number of GPU nodes can still remain nearly constant. Most importantly, for realistic diffraction measurements, we observe a speedup ranging from a factor of 10 to 103 depending on the data size, which reduces the reconstruction time remarkably from hours to typically about 1 minute and is thus critical for real-time data processing and visualization.

97 MATHEMATICS AND COMPUTING↗

Single-Center Experience Implementing the LOINC-RSNA Radiology Playbook for Adult Abdomen/Pelvis CT and MR Procedures Using a Semi-Automated Method

The LOINC-RSNA Radiology Playbook represents the future direction of standardization for radiology procedure names. We developed a software solution (“RadMatch”) utilizing Python 2.7 and FuzzyWuzzy, an open-source fuzzy string matching algorithm created by SeatGeek, to implement the LOINC-RSNA Radiology Playbook for adult abdomen and pelvis CT and MR procedures performed at our institution. Execution of this semi-automated method resulted in the assignment of appropriate LOINC numbers to 86% of local CT procedures. For local MR procedures, appropriate LOINC numbers were assigned to 75% of these procedures whereas 12.5% of local MR procedures could only be partially mapped. For the standardized local procedures, only 63% of CT and 71% of MR procedures had corresponding RadLex Playbook identifier (RPID) codes in the LOINC-RSNA Radiology Playbook, which limited the utility of RPID codes. RadMatch is a semi-automated open-source software tool that can assist radiology departments seeking to standardize their radiology procedures via implementation of the LOINC-RSNA Radiology Playbook.

62 RADIOLOGY AND NUCLEAR MEDICINE↗

Towards Vendor and Operating System Independence of USB-based portable multi-channel analyzers

The nuclear measurements group is called on to develop portable, user friendly systems that performs at, or near, laboratory standards. These systems typically consist of a detector and a USB-based multi-channel analyzer. An ORTEC digi-Base is an example of a USB-based portable multi-channel analyzer with 14-pin photomultiplier tube base for gamma-ray spectroscopy applications with NaI(Tl) and other scintillation detectors. Operating system independence - we want to be able to develop applications that are 'future-proof' and can run on the best hardware for the job: desktop, laptop, tablet, phone, or embedded device. To do that we need our software to be operating system independent. Hardware vendor independence - to use the most appropriate equipment for the job, while still maintaining our rapid method development, we would like our software that uses this equipment to be independent of the specific vendor or model of the hardware. To do that we need a common interface to each vendor's equipment (high voltage, gain, start, stop, clear, etc.) In prior work, we were able to use an existing library to communicate with an ORTEC digi-base via Linux and Android. However the application developed did not have a user friendly front-end. Part of this work was to develop a simple user interface to control the settings of the hardware from Android. While OS independence is the final goal, another goal is standardized software for user-application development. For current purposes those standard systems are Windows 7, Windows 10, and Python 3. Our next step was to develop a common software interface between a front-end user interface and back-end hardware communication software. This was done using Python's Ctypes library. Ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python. Ctypes exports the cdll, and Windows windll and oledll objects, for loading dynamic link libraries. You load libraries by accessing them as attributes of these objects. cdll loads libraries which export functions using the standard cdecl calling convention. The first steps of developing the common software interface have been done. Once the software interface has been developed the next goal will be to develop hardware specific back-end software that way rapid user facing software can be developed using equipment that is 'on-hand' and once finished prototyping, the 'best' hardware can be chosen for the specific implementation.

12 MANAGEMENT OF RADIOACTIVE AND NON-RADIOACTIVE W↗

The Particle Accelerator Simulation Code PyORBIT

The particle accelerator simulation code PyORBIT is presented. The structure, implementation, history, parallel and simulation capabilities, and future development of the code are discussed. The PyORBIT code is a new implementation and extension of algorithms of the original ORBIT code that was developed for the Spallation Neutron Source accelerator at the Oak Ridge National Laboratory. The PyORBIT code has a two level structure. The upper level uses the Python programming language to control the flow of intensive calculations performed by the lower level code implemented in the C++ language. The parallel capabilities are based on MPI communications. The PyORBIT is an open source code accessible to the public through the Google Open Source Projects Hosting service.

Accelerator Simulation↗

Towards a Standard Process Management Infrastructure for Workflows Using Python

Orchestrating the execution of ensembles of processes lies at the core of scientific workflow engines on large scale parallel platforms. This is usually handled using platform-specific command line tools, with limited process management control and potential strain on system resources. The PMIx standard provides a uniform interface to system resources. The low level C implementation of PMIx has hampered its use in workflow engines, leading to the development of Python binding that has yet to gain traction. In this paper, we present our work to harden the PMIx Python client, demonstrating its usability using a prototype Python driver to orchestrate the execution of an ensemble of processes. We present experimental results using the prototype on the Summit supercomputer at Oak Ridge National Laboratory. This work lays the foundation for wider adoption of PMIx for workflow engines, and encourages wider support of more PMIx functionality in vendor provided system software stacks.

Elwasif, Wael↗

Dynamic Provisioning and Execution of HPC Workflows Using Python

High-performance computing (HPC) workflows over the last several decades have proven to assist in the understanding of scientific phenomena and the production of better products, more quickly, and at reduced cost. However, HPC workflows are difficult to implement and use for a variety of reasons. In this paper, we describe the development of the Python-based cumulus, which addresses many of these barriers. cumulus is a platform for the dynamic provisioning and execution of HPC workflows. cumulus provides the infrastructure needed to build applications that leverage traditional or Cloud-based HPC resources in their workflows. Lastly, we demonstrate the use of cumulus in both web and desktop simulation applications, as well as in an Apache Spark-based analysis application.

97 MATHEMATICS AND COMPUTING↗

A generalized wind turbine cross section as a reduced-order model to gain insights in blade aeroelastic challenges

In this work, we present an approach to study the aeroelastic stability of a wind turbine by focusing on the dynamics of a blade cross section. We present a methodology to obtain a reduced-order model of the blade dynamics in the form of generalized cross-sectional quantities that approximates the aerodynamic and structural properties of the full blade. The motivation for the work is to gain a physical understanding of the influence of aerodynamic models such as dynamic wake and dynamic stall on the frequency and damping of the structure using a reduced-order model with low computational cost. The model may be coupled to two-dimensional computational fluid dynamics softwares or engineering unsteady airfoil aerodynamics models accounting for dynamic wake and dynamic stall. In the latter case, we can obtain monolithic state-space forms of the aeroelastic system of equations, which simplifies the determination of the modal parameters and therefore the study of stability. The work investigates wind turbines in operation or at standstill, where vortex-induced vibrations and stall-induced vibrations, respectively, might be an issue. The implementation is made available as part of the open-source Python package WELIB and as part of the open-source unsteady aerodynamic driver of OpenFAST.

17 WIND ENERGY↗

DSPS: Differentiable stellar population synthesis

ABSTRACT Models of stellar population synthesis (SPS) are the fundamental tool that relates the physical properties of a galaxy to its spectral energy distribution (SED). In this paper, we present DSPS: a python package for SPS. All of the functionality in DSPS is implemented natively in the JAX library for automatic differentiation, and so our predictions for galaxy photometry are fully differentiable, and directly inherit the performance benefits of JAX, including portability onto GPUs. DSPS also implements several novel features, such as i) a flexible empirical model for stellar metallicity that incorporates correlations with stellar age, ii) support for the Diffstar model that provides a physically-motivated connection between the star formation history of a galaxy (SFH) and the mass assembly of its underlying dark matter halo. We detail a set of theoretical techniques for using autodiff to calculate gradients of predictions for galaxy SEDs with respect to SPS parameters that control a range of physical effects, including SFH, stellar metallicity, nebular emission, and dust attenuation. When forward modelling the colours of a synthetic galaxy population, we find that DSPS can provide a factor of 5 speed-up over standard SPS codes on a CPU, and a factor of 300-400 on a modern GPU. When coupled with gradient-based techniques for optimization and inference, DSPS makes it practical to conduct expansive likelihood analyses of simulation-based models of the galaxy–halo connection that fully forward model galaxy spectra and photometry.

79 ASTRONOMY AND ASTROPHYSICS↗

Quantitative approaches for multiscale structural analysis with atomic resolution electron microscopy

Atomic-resolution imaging with scanning transmission electron microscopy is a powerful tool for characterizing the nanoscale structure of materials, in particular features such as defects, local strains, and symmetry-breaking distortions. In addition to advanced instrumentation, the effectiveness of the technique depends on computational image analysis to extract meaningful features from complex datasets recorded in experiments, which can be complicated by the presence of noise and artifacts, small or overlapping features, and the need to scale analysis over large representative areas. Here, we present image analysis approaches which synergize real and reciprocal space information to efficiently and reliably obtain meaningful structural information with picometer scale precision across hundreds of nanometers of material from atomic-resolution electron microscope images. Damping superstructure peaks in reciprocal space allows symmetry-breaking structural distortions to be disentangled from other sources of inhomogeneity and measured with high precision. Real-space fitting of the wavelike signals resulting from Fourier filtering enables absolute quantification of lattice parameter variations and strain, as well as the uncertainty associated with these measurements. Implementations of these algorithms are made available as an open source python package.

36 MATERIALS SCIENCE↗

A Walking Method for Non-Decomposition Intersection and Union of Arbitrary Polygons and Polyhedrons

We present a method for computing the intersection and union of non- convex polyhedrons without decomposition in O(n log n) time, where n is the total number of faces of both polyhedrons. We include an accompanying Python package which addresses many of the practical issues associated with implementation and serves as a proof of concept. The key to the method is that by considering the edges of the original ob- jects and the intersections between faces as walking routes, we can e ciently nd the boundary of the intersection of arbitrary objects using directional walks, thus handling the concave case in a natural manner. The method also easily extends to plane slicing and non-convex polyhedron unions, and both the polyhedron and its constituent faces may be non-convex.

97 MATHEMATICS AND COMPUTING↗

An Algorithm to Generate Synthetic 3D Microstructures from 2D Exemplars

The inverse problem of constructing 3D microstructures from 2D data is an area of active research within the materials science community. This paper presents the implementation of a robust, computationally efficient algorithm, Hierarchical Algorithm for the Reconstruction of Exemplars (HARE), written in Python to reconstruct 3D features in a given microstructure from up to three orthogonal 2D exemplars using nearest neighbor matching to reproduce feature qualities, such as shape, size, and distribution. HARE’s feature sampling implements histogram reweighting to avoid both over- and undersampling. A neighborhood voting scheme allows each pixel to provisionally affect its neighbors according to its weight. Finally, the algorithm is presently configured for two-phase materials and is being extended to accommodate multiple phases. HARE is a convenient and robust base from which to generate statistically representative synthetic microstructures for use in multi-scale modeling or machine learning applications to support advanced manufacturing and materials discovery.

36 MATERIALS SCIENCE↗

SUSPECT: MINLP special structure detector for Pyomo

We present SUSPECT, an open source toolkit that symbolically analyzes mixed-integer nonlinear optimization problems formulated using the Python algebraic modeling library Pyomo. We present the data structures and algorithms used to implement SUSPECT. SUSPECT works on a directed acyclic graph representation of the optimization problem to perform: bounds tightening, bound propagation, monotonicity detection, and convexity detection. We show how the tree-walking rules in SUSPECT balance the need for lightweight computation with effective special structure detection. SUSPECT can be used as a standalone tool or as a Python library to be integrated in other tools or solvers. Here, we highlight the easy extensibility of SUSPECT with several recent convexity detection tricks from the literature. We also report experimental results on the MINLPLib 2 dataset.

97 MATHEMATICS AND COMPUTING↗

GEOPHIRES v2.0

GEOPHIRES v2.0 is a geothermal techno-economic simulation tool upgraded from GEOPHIRES v1.2. The name stands for "GEOthermal energy for Production of Heat and electricity (“IR”) Economically Simulated". GEOPHIRES combines reservoir, wellbore, and surface plant technical models with cost correlations and levelized cost models to estimate the capital and operation and maintenance costs, instantaneous and lifetime energy production, and overall levelized cost of energy of a geothermal plant. In addition to electricity generation, direct-use heat applications and combined heat and power or cogeneration can be modeled. Various upgrades have been implemented to develop GEOPHIRES v2.0, including: updating the built-in cost correlations, coupling to the external reservoir simulator TOUGH2, enhancing the built-in wellbore simulator, converting the programming language to Python, and making the code open-source. Users are encouraged to build upon the tool, e.g. by implementing their own correlations or coupling to other simulators.

Beckers, Koenraad↗

Pyomo v5.0

Pyomo supports the formulation and analysis of mathematical models for complex optimization applications. This capability is commonly associated with algebraic modeling languages (AMLs), which support the description and analysis of mathematical models with a high-level language. Although most AMLs are implemented in custom modeling languages, Pyomo's modeling objects are embedded within Python, a full- featured high-level programming language that contains a rich set of supporting libraries.

Woodruff, David↗