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 289 records · Page 16

Variance reduction via simultaneous importance sampling and control variates techniques using vegas

Monte Carlo (MC) integration is an important calculational technique in the physical sciences. Practical considerations require that the calculations are performed as accurately as possible for a given set of computational resources. To improve the accuracy of MC integration, a number of useful variance reduction algorithms have been developed, including importance sampling and control variates. In this work, we demonstrate how these two methods can be applied simultaneously, thus combining their benefits. We provide a python wrapper, named CoVVVR, which implements our approach in the VEGAS program. The improvements are quantified with several benchmark examples from the literature.

72 PHYSICS OF ELEMENTARY PARTICLES AND FIELDS↗

Codebase release r1.4 for CoVVVR

Monte Carlo (MC) integration is an important calculational technique in the physical sciences. Practical considerations require that the calculations are performed as accurately as possible for a given set of computational resources. To improve the accuracy of MC integration, a number of useful variance reduction algorithms have been developed, including importance sampling and control variates. In this work, we demonstrate how these two methods can be applied simultaneously, thus combining their benefits. We provide a python wrapper, named COVVVR, which implements our approach in the VEGAS program. The improvements are quantified with several benchmark examples from the literature.

Shyamsundar, Prasanth↗

INL High Level Language Microcontroller Implementa

The overall goal of this project is to improve the security of embedded devices (microcontrollers) used in monitoring and control of energy-sector infrastructure. As these devices are essentially scaled-down personal computers (PCs), they are vulnerable to common low-level cyber-attacks such as buffer overflows and insecure authentication. The implementation of a modern high-level programming language on these microcontrollers would disallow such low-level attacks as the languages would have inherent safeguards against these types of cyber exploits. Idaho National Laboratory (INL) has partnered with Siemens Corporate Research (SCR) to develop and test a 4 th -generation language DNP3 implementation on real-world embedded hardware. These tests were carried out on control-system device models currently deployed in real-world applications. Testing was performed with existing C-based DNP implementation as well as the Python version developed by INL.

4GL↗

stochprop Documentation (Release 1.0)

Simulations of infrasonic propagation in the atmosphere typically utilize a single atmospheric specification describing the acoustic sound speed, ambient winds, and density as a function of altitude. Due to the dynamic and sparsely sampled nature of the atmosphere, there is a notable amount of uncertainty in the atmospheric state at a given location and time so that a more robust analysis of infrasonic propagation requires inclusion of this uncertainty. This Python library, stochprop, has been implemented using methods developed jointly by infrasound scientists at Los Alamos National Laboratory (LANL) and the University of Mississippi’s National Center for Physical Acoustics (NCPA). This software library includes methods to quantify variability in the atmospheric state, identify typical seasonal variability in the atmospheric state and generate suites of representative atmospheric states during a given season, as well as perform uncertainty analysis on a specified atmospheric state given some level of uncertainty. These methods have been designed to interface between propagation modeling capabilities such as InfraGA/GeoAc and NCPAprop and signal analysis methods in the LANL InfraPy tool.

58 GEOSCIENCES↗

Taylor wave solution for a general equation of state

This document describes a solution procedure for calculating the Taylor wave behind an unsupported Chapman–Jouguet (CJ) detonation in planar, cylindrical, and spherical geometries given a general equation of state. The resulting semi-analytic solution can be utilized to examine new equation of state models for detonation products and during the verification of hydrodynamic codes. The governing partial differential equations are reduced to ordinary differential equations in both characteristic and self-similar forms. The first-order systems corresponding to each geometry are amenable to solution numerically using commonly available methods. A difficulty arises at the CJ point in radial coordinates where the similarity equations become singular. Two separate strategies are proposed to integrate the first-order system. The first one uses an asymptotic approximation near the CJ point that can be used to perturb the boundary conditions. The second one applies a change of variables which removes the singularity at the expense of an additional equation to be integrated. A test problem is provided for the Davis products equation of state to illustrate the qualitative features of the Taylor wave in each geometric configuration and compared with a Lagrangian hydrodynamics research code. A Python code listing gives an implementation using the SciPy library to assists users in generating the results.

97 MATHEMATICS AND COMPUTING↗

Use of Digital Real-Time Simulation and Optimization to Identify Maximum Real Power Injection on Banshee Distribution Network

This study investigates the hosting capacity of the Banshee Distribution Network by optimizing the real power injection at carefully selected Distributed Energy Resource (DER) locations. The analysis is conducted within the framework of power system operational constraints, including bus voltage ranges, thermal line ratings, and transformer loading limits. A Python-based Genetic Algorithm (GA), implemented using the PyGAD library, is employed to iteratively identify the optimal power injection configuration that maximizes network utilization while preserving system reliability. The methodology integrates a real-time simulation environment using the Real-Time Digital Simulator (RTDS), allowing high-fidelity evaluation of power flow and voltage behavior under each proposed injection scenario. By coupling the optimization algorithm with real-time simulation feedback, this approach ensures that both static and dynamic constraints are enforced during the evaluation process. The GA leverages evolutionary operators such as selection, crossover, and mutation to navigate the nonlinear search space efficiently. The results of the study delineate the feasible hosting capacity at three targeted buses, reflecting maximum real power levels that can be injected without causing voltage violations, transformer overloading, or line congestion. These findings provide a decision- support tool for distribution planners and utilities aiming to integrate higher penetrations of DERs in existing infrastructure. Additionally, the work lays the foundation for extending such optimization techniques to multi-objective formulations, including economic dispatch and reactive power coordination, in future studies.

24 POWER TRANSMISSION AND DISTRIBUTION↗

Detecting Weak Spectral Lines in Interferometric Data through Matched Filtering

Modern radio interferometers enable observations of spectral lines with unprecedented spatial resolution and sensitivity. In spite of these technical advances, many lines of interest are still at best weakly detected and therefore necessitate detection and analysis techniques specialized for the low signal-to-noise ratio (S/N) regime. Matched filters can leverage knowledge of the source structure and kinematics to increase sensitivity of spectral line observations. Application of the filter in the native Fourier domain improves S/N while simultaneously avoiding the computational cost and ambiguities associated with imaging, making matched filtering a fast and robust method for weak spectral line detection. We demonstrate how an approximate matched filter can be constructed from a previously observed line or from a model of the source, and we show how this filter can be used to robustly infer a detection significance for weak spectral lines. When applied to ALMA Cycle 2 observations of CH{sub 3}OH in the protoplanetary disk around TW Hya, the technique yields a ≈53% S/N boost over aperture-based spectral extraction methods, and we show that an even higher boost will be achieved for observations at higher spatial resolution. A Python-based open-source implementation of this technique is available under the MIT license at http://github.com/AstroChem/VISIBLE.

79 ASTRONOMY AND ASTROPHYSICS↗

Identification of Stellar Flares Using Differential Evolution Template Optimization

In this paper, we explore methods for the identification of stellar flare events in irregularly sampled data of ground-based time domain surveys. In particular, we describe a new technique for identifying flaring stars, which we have implemented in a publicly available Python module called "PyVAN." The approach uses the Differential Evolution algorithm to optimize parameters of empirically derived light curve templates for different types of stars to fit a candidate light curve. The difference of the likelihoods that these best-fit templates produced the observed data is then used to delineate targets that are well-explained by a flare template but simultaneously poorly explained by templates of common contaminants. By testing on light curves of known identity and morphology, we show that our technique is capable of recovering flaring status in 69% of all light curves containing a flare event above thresholds drawn to include <1% of any contaminant population. By applying to Palomar Transient Factory data, we show consistency with prior samples of flaring stars, and identify a small selection of candidate flaring G-type stars for possible follow-up.

79 ASTRONOMY AND ASTROPHYSICS↗

An accurate and efficient algorithm for detection of radio bursts with an unknown dispersion measure, for single-dish telescopes and interferometers

Astronomical radio signals are subjected to phase dispersion while traveling through the interstellar medium. To optimally detect a short-duration signal within a frequency band, we have to precisely compensate for the unknown pulse dispersion, which is a computationally demanding task. We present the “fast dispersion measure transform” algorithm for optimal detection of such signals. Our algorithm has a low theoretical complexity of 2N{sub f}N{sub t}+N{sub t}N{sub Δ}log{sub 2}(N{sub f}), where N{sub f}, N{sub t}, and N{sub Δ} are the numbers of frequency bins, time bins, and dispersion measure bins, respectively. Unlike previously suggested fast algorithms, our algorithm conserves the sensitivity of brute-force dedispersion. Our tests indicate that this algorithm, running on a standard desktop computer and implemented in a high-level programming language, is already faster than the state-of-the-art dedispersion codes running on graphical processing units (GPUs). We also present a variant of the algorithm that can be efficiently implemented on GPUs. The latter algorithm’s computation and data-transport requirements are similar to those of a two-dimensional fast Fourier transform, indicating that incoherent dedispersion can now be considered a nonissue while planning future surveys. We further present a fast algorithm for sensitive detection of pulses shorter than the dispersive smearing limits of incoherent dedispersion. In typical cases, this algorithm is orders of magnitude faster than enumerating dispersion measures and coherently dedispersing by convolution. We analyze the computational complexity of pulsed signal searches by radio interferometers. We conclude that, using our suggested algorithms, maximally sensitive blind searches for dispersed pulses are feasible using existing facilities. We provide an implementation of these algorithms in Python and MATLAB.

79 ASTRONOMY AND ASTROPHYSICS↗

Robust Period Estimation Using Mutual Information for Multiband Light Curves in the Synoptic Survey Era

The Large Synoptic Survey Telescope (LSST) will produce an unprecedented amount of light curves using six optical bands. Robust and efficient methods that can aggregate data from multidimensional sparsely sampled time-series are needed. Here, we present a new method for light curve period estimation based on quadratic mutual information (QMI). The presented method does not assume a particular model for the light curve nor its underlying probability density and it is robust to non-Gaussian noise and outliers. By combining the QMI from several bands the true period can be estimated even when no single-band QMI yields the period. Period recovery performance as a function of average magnitude and sample size is measured using 30,000 synthetic multiband light curves of RR Lyrae and Cepheid variables generated by the LSST Operations and Catalog simulators. The results show that aggregating information from several bands is highly beneficial in LSST sparsely sampled time-series, obtaining an absolute increase in period recovery rate up to 50%. We also show that the QMI is more robust to noise and light curve length (sample size) than the multiband generalizations of the Lomb–Scargle and AoV periodograms, recovering the true period in 10%–30% more cases than its competitors. A python package with efficient Cython implementations of the QMI and other methods is provided.

79 ASTRONOMY AND ASTROPHYSICS↗

Gravity-Assist Trajectories to the Ice Giants: An Automated Method to Catalog Mass- Or Time-Optimal Solutions

This work presents an automated method of calculating mass (or time) optimal gravity-assist trajectories without a priori knowledge of the flyby-body combination. Since gravity assists are particularly crucial for reaching the outer Solar System, we use the Ice Giants, Uranus and Neptune, as example destinations for this work. Catalogs are also provided that list the most attractive trajectories found over launch dates ranging from 2024 to 2038. The tool developed to implement this method, called the Python EMTG Automated Trade Study Application (PEATSA), iteratively runs the Evolutionary Mission Trajectory Generator (EMTG), a NASA Goddard Space Flight Center in-house trajectory optimization tool. EMTG finds gravity-assist trajectories with impulsive maneuvers using a multiple-shooting structure along with stochastic methods (such as monotonic basin hopping) and may be run with or without an initial guess provided. PEATSA runs instances of EMTG in parallel over a grid of launch dates. After each set of runs completes, the best results within a neighborhood of launch dates are used to seed all other cases in that neighborhood-allowing the solutions across the range of launch dates to improve over each iteration. The results here are compared against trajectories found using a grid-search technique, and PEATSA is found to outperform the grid-search results for most launch years considered.

Hughes, Kyle M.↗

Gravity-Assist Trajectories to the Ice Giants: An Automated Method to Catalog Mass-or Time-Optimal Solutions

This work presents an automated method of calculating mass (or time) optimal gravity-assist trajectories without a priori knowledge of the flyby-body combination. Since gravity assists are particularly crucial for reaching the outer Solar System, we use the Ice Giants, Uranus and Neptune, as example destinations for this work. Catalogs are also provided that list the most attractive trajectories found over launch dates ranging from 2024 to 2038. The tool developed to implement this method, called the Python EMTG Automated Trade Study Application (PEATSA), iteratively runs the Evolutionary Mission Trajectory Generator (EMTG), a NASA Goddard Space Flight Center in-house trajectory optimization tool. EMTG finds gravity-assist trajectories with impulsive maneuvers using a multiple-shooting structure along with stochastic methods (such as monotonic basin hopping) and may be run with or without an initial guess provided. PEATSA runs instances of EMTG in parallel over a grid of launch dates. After each set of runs completes, the best results within a neighborhood of launch dates are used to seed all other cases in that neighborhood---allowing the solutions across the range of launch dates to improve over each iteration. The results here are compared against trajectories found using a grid-search technique, and PEATSA is found to outperform the grid-search results for most launch years considered.

Hughes, Kyle M.↗

Machine Learning Prototype App For Recognition of Fruits

As the incidence of obesity and associated negative health consequences is rising, it becomes crucial to monitor the dietary choices of individuals. Unfortunately, traditional methods to collect this information involve collecting food frequency questionnaires from individuals using paper. Electronic food trackers have been developed to collect food data, but they require participants to manually label and describe the content of their meals, and which may be difficult for researchers to interpret in a standardized fashion. Machine learning, however, provides an easy and efficient method for both participants and researchers to label food items with standardized descriptions. This project aims to create a prototype phone application that can identify and label photos of apples. This is done by making a machine learning model through Turicreate, a python module, which is then implemented into an iOS app through Xcode and Swift. The modules used in Swift include CoreML and AVFoundation. This machine learning application will be incorporated with a MealLogger phone app that is also under development. The MealLogger app will be used to keep track of participants' calorie intake and other personal details throughout the sleep study. The machine learning model will present several potential identities of the foods found in the photo, and the user will only need to select the correct option. This will be a user-friendly method for participants to easily log their food consumption without the hard work of manually inputting each and every description. Some limitations to this project include the wide variety of food, including those within different cultures. To deal with this, the model will include the most generic food categories, which the participant may select, and produce a drop-down menu of more specific dishes under that specified category, with the option of self-input. Additional questionnaires may be implemented according to the food type selected This will allow the process to be quick and easy, but also specific for the purpose of analysis. The release of the application will require a much longer process, but the machine learning prototype presents a first step toward an application that may change data analysis for researchers interested in collecting food intake from individuals living in the real world.

Food tracker↗

Enabling in-time Prognostics with Surrogate Modeling through Physics-enhanced Dynamic Mode Decomposition Method

Computational models provide essential quantitative tools for assessing and predicting the health and performance of physical systems. However, high-fidelity models are rarely used in real-time operations or large optimization loops, due to their time-intensive nature. A common approach to improving computational efficiency of prognosis is to employ surrogate models. Such models can significantly decrease computation time for some accuracy loss. In this context, use of Dynamic Mode Decomposition (DMD) is proposed to generate surrogate models for lithium-ion (Li-ion) battery discharge. DMD has been suggested and used successfully in the area of fluid dynamics for over a decade, but it has not been applied to the PHM domain, where far-ahead prediction of nonlinear behavior is crucial to propagate faults or predict Remaining Useful Life (RUL). For Li-ion battery health management, the standard application of DMD using only the observable quantities of interest was unable to capture the nonlinear discharge of batteries exhibited in lab testing. The Koopman theory, however, provides a mechanism to tradeoff low dimensional nonlinear models with high-dimensional linear ones in a DMD framework, by augmenting nonlinear state variables into the system representation. In this way, DMD allows for configurable simulation accuracy dependent on the dimensionality of the Koopman operator. For battery health management, we augmented the observable variables with the hidden states of a higher-fidelity physics model to build the DMD surrogate. In comparison to a high-fidelity model, the surrogate improved computational efficiency with only a minimal loss of accuracy, and enabled long-term prognostics horizons. A generalized method for this was implemented in the prog models python package.

prognostics and health management↗

hls4ml: An Open-Source Codesign Workflow to Empower Scientific Low-Power Machine Learning Devices

Accessible machine learning algorithms, software, and diagnostic tools for energy-efficient devices and systems are extremely valuable across a broad range of application domains. In scientific domains, real-time near-sensor processing can drastically improve experimental design and accelerate scientific discoveries. To support domain scientists, we have developed hls4ml, an open-source software-hardware codesign workflow to interpret and translate machine learning algorithms for implementation with both FPGA and ASIC technologies. We expand on previous hls4ml work by extending capabilities and techniques towards low-power implementations and increased usability: new Python APIs, quantization-aware pruning, end-to-end FPGA workflows, long pipeline kernels for low power, and new device backends include an ASIC workflow. Taken together, these and continued efforts in hls4ml will arm a new generation of domain scientists with accessible, efficient, and powerful tools for machine-learning-accelerated discovery.

46 INSTRUMENTATION RELATED TO NUCLEAR SCIENCE AND ↗

Use of Digital Real-Time Simulation and Optimization to Identify Maximum Real Power Injection on the Banshee Distribution Network: Preprint

This study investigates the hosting capacity of the Banshee Distribution Network by optimizing the real power injection at carefully selected Distributed Energy Resource (DER) locations. The analysis is conducted within the framework of power system operational constraints, including bus voltage ranges, thermal line ratings, and transformer loading limits. A Python-based Genetic Algorithm (GA), implemented using the PyGAD library, is employed to iteratively identify the optimal power injection configuration that maximizes network utilization while preserving system reliability. The methodology integrates a real-time simulation environment using the Real-Time Digital Simulator (RTDS), allowing high-fidelity evaluation of power flow and voltage behavior under each proposed injection scenario. By coupling the optimization algorithm with real-time simulation feedback, this approach ensures that both static and dynamic constraints are enforced during the evaluation process. The GA leverages evolutionary operators such as selection, crossover, and mutation to navigate the nonlinear search space efficiently. The results of the study delineate the feasible hosting capacity at three targeted buses, reflecting maximum real power levels that can be injected without causing voltage violations, transformer overloading, or line congestion. These findings provide a decision- support tool for distribution planners and utilities aiming to integrate higher penetrations of DERs in existing infrastructure. Additionally, the work lays the foundation for extending such optimization techniques to multi-objective formulations, including economic dispatch and reactive power coordination, in future studies.

24 POWER TRANSMISSION AND DISTRIBUTION↗

Semi-analytic model of magnetized liner inertial fusion

The code that was developed is called SAMM (Semi-Analytic MagLIF Model). In 2015, McBride and Slutz published all of the equations that are solved by the code in the original SAMM paper: R. D. McBride and S. A. Slutz, ?A semi-analytic model of magnetized liner inertial fusion?, Phys. Plasmas 22, 052708 (2015); http://doi.org/10.1063/1.4918953. The SAMM code is now implemented in both the MATLAB and Python programming languages. Students from multiple universities have requested copies of the code so that they can become more familiar with the MagLIF concept. We would like to seek an open-source solution. There is no market value to this code, as there are plenty of more sophisticated simulation codes already available; SAMM is merely a simplified model that is purely for educational purposes. In fact, at least one graduate student (from the University of California, San Diego) has already implemented and published his own modified version of the model: J. Narkis, H. U. Rahman, J. C. Valenzuela, F. Conti, R. D. McBride, D. Venosa, and F. N. Beg, ?A semi-analytic model of gas-puff liner-on-target magneto-inertial fusion?, Phys. Plasmas 26, 032708 (2019); https://doi.org/10.1063/1.5086056. SAND2020-12244 M Sandia National Laboratories is a multimission laboratory managed and operated by National Technology & Engineering Solutions of Sandia, LLC, a wholly owned subsidiary of Honeywell International Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA0003525.

Moore, Thomas↗