Search NASASearch

SEARCH · Search NASA

Results for “Python Programming”

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 19 records

An Expanded Role for Python in Expediting System Simulation Development

The Python programming language has traditionally been used as a “scripting” language and is not generally recognized as a language for building system simulations, where C++, Java, and other compiled languages are typically used. While very powerful and gaining favor for a large set of programming tasks, Python is generally regarded as not having the speed to directly do the extensive numeric computations required in large-scale simulation. This paper aims to present an approach, supported by case studies, to re-think this assertion. Directly using Python in this new role has the potential to expedite an agile, spiral cycle of development of design-test-modify for systems simulation.

programming language

Advancement of the General Aviation Synthesis Program Using Python to Enable Optimization-Based Hybrid-Propulsion Aircraft Design

In support of the Electrified Powertrain Flight Demonstrator and Advanced Air Transport Technologies projects at NASA, a new tool has been developed at NASA’s Ames and Glenn Research Centers to enable coupled engine and airframe optimization and analysis. The new tool combines the engineering-level analysis methods and empirical models of the FORTRAN General Aviation Synthesis Program (GASP) with the Python-based OpenMDAO framework to provide a modular framework for efficient gradient-based optimization with the aim of incorporating new subsystem models for unconventional configurations. The tool has been verified against GASP analyses of several aircraft models and mission formulations. Preliminary efforts have been made to integrate pyCycle, a thermodynamic cycle analysis tool, to enable simultaneous optimization of hybrid propulsion system and vehicle parameters while taking full mission performance and constraints into account. This will improve current capabilities to assess impacts of electrified powertrain technologies on future aircraft designs.

Kenneth R. Lyons

Advancement of the General Aviation Synthesis Program Using Python to Enable Optimization-Based Hybrid-Propulsion Aircraft Design

In support of the Electrified Powertrain Flight Demonstrator and Advanced Air Transport Technologies projects at NASA, a new tool has been developed at NASA's Ames and Glenn Research Centers to enable coupled engine and airframe optimization and analysis. The new tool combines the engineering-level analysis methods and empirical models of the FORTRAN General Aviation Synthesis Program (GASP) with the Python-based OpenMDAO framework to provide a modular framework for efficient gradient-based optimization with the aim of incorporating new subsystem models for unconventional configurations. The tool has been verified against GASP analyses of several aircraft models and mission formulations. Preliminary efforts have been made to integrate pyCycle, a thermodynamic cycle analysis tool, to enable simultaneous optimization of hybrid propulsion system and vehicle parameters while taking full mission performance and constraints into account. This will improve current capabilities to assess impacts of electrified powertrain technologies on future aircraft designs.

Kenneth R Lyons

Advancement of the General Aviation Synthesis Program Using Python to Enable Optimization-Based Hybrid-Propulsion Aircraft Design

In support of Electrified Powertrain Flight Demonstrator and Advanced Air Transport Technologies programs at NASA, engineers at NASA Ames and NASA Glenn Research Centers have developed a new tool for coupled engine and airframe optimization and analysis. The new tool combines the engineering-level analysis methods of the FORTRAN General Aviation Synthesis Program (GASP) with the OpenMDAO framework to handle highly coupled problems that legacy tools struggle to optimize. The tool has been verified to match GASP with good agreement on a 737 MAX8 baseline vehicle closure problem, and preliminary efforts have been made to integrate the pyCycle thermodynamic cycle analysis tool for electrified engine optimization in the context of a vehicle optimization problem.

Kenneth R. Lyons

System and Method for Providing a Climate Data Analytic Services Application Programming Interface

A system, method and computer-readable storage devices for providing a climate data analytic services application programming interface. The system includes a programming library that enables client device software to invoke the capabilities of a climate data analytics system through requests to various services supported by the climate data analytics system, and also includes a client-side communications interface that enables the programming library's methods to interact with a climate data analytics system's server interface to obtain access to the capabilities of the system. In one implementation, the programming library is implemented in the Python programming language. The programming library can include basic utilities that call a single, server-side method implemented by one of the various services supported by the climate data analytics system, and extended utilities that call a series of basic utilities and/or other extended utilities that have been placed under programmatic control in order to create client-side convenience methods and workflows.

Schnase, John L.

Re-imagining a Stata/Python Combination

At last year's Stata Conference, I presented some ideas for combining Stata and the Python programming language within a single interface. Two methods were presented: in one, Python was used to automate Stata; in the other, Python was used to send simulated keystrokes to the Stata GUI. The first method has the drawback of only working in Windows, and the second can be slow and subject to character input limits. In this presentation, I will demonstrate a method for achieving interaction between Stata and Python that does not suffer these drawbacks, and I will present some examples to show how this interaction can be useful.

Fiedler, James

Stata Hybrids: Updates and Ideas

At last year's Stata conference I presented two projects for using Python with Stata: a plugin that embeds the Python programming language within Stata and code for using Stata data sets in Python. In this talk I will describe some small improvements being made to these projects, and I will present other ideas for combining tools with Stata. Some of these ideas use Python, some use JavaScript and a web browser.

Fieldler, James

Development and validation of a software for simulating γ-γ coincidence emission and detection probabilities

Gamma-gamma coincidence spectrometers have the potential to significantly enhance detection sensitivity for ultra-trace radionuclide measurements. The implementation of these spectrometers, however, is limited by the complexity of acquisition hardware, data processing and quantification. This work reports development of a novel radionuclide quantification software for γ-γ coincidence measurements. For any radionuclide, the software parses the Evaluated Nuclear Structure Data File (ENSDF) database, recursively simulating all possible γ-γ coincidence signatures and their respective emission and detection probabilities. Implemented using Python programming language, the software employs several strategies to boost overall computational performance. Since coincidence-based spectrometers are of notable interest in monitoring compliance for the Comprehensive Nuclear-Test-Ban Treaty (CTBT), the software’s execution was tested for 84 CTBT-relevant radionuclides. To date, the software has been experimentally validated for 15 radionuclides using the Advanced Radionuclide Gamma spectrOmeter (ARGO) at Pacific Northwest National Laboratory, USA (PNNL). Notably, the software can be operated in convergence mode, whereby coincidence detection efficiency’s convergence behavior can help avoid unreliable radionuclide activity estimates. With growing number of coincidence spectrometers worldwide, this paper aims to assist the radiation metrology community in developing similar software for their system.

46 INSTRUMENTATION RELATED TO NUCLEAR SCIENCE AND

Robust Automatic EXAFS First-Shell Fits

Extended X-ray absorption fine structure (EXAFS) is a widely used technique for atomic structure determination. Fourier transformation connects EXAFS in k space and R space. However, determining the appropriate k-range for the transformation can be challenging, but critical for the first-shell fit. In this study, we present an automatic method to determine the k-range using the Larch package and a Python program. The first step is to estimate spectral noise across a series of k-ranges with a fixed minimum value and identify the optimal maximum value in the k-range (k max ). The k max is determined by an empirical noise threshold that marks the point where the noise level in the Fourier transformed spectrum changes dramatically. Using the obtained k max value, the first shell is modeled to determine the minimum k value (k min ) by optimizing the background function through alignment of the spectrum with theory. The optimal k min corresponds to the point of the minimum R-factor, which quantifies the difference between the experimental and fitted spectrum. Our method was tested on various typical datasets and yielded suitable k-ranges for Fourier transformation and accurate first-shell fits. This approach helps avoid unreliable, irreproducible data analysis, especially for noisy data from diluted samples, and enables robust automatic first-shell EXAFS fitting.

EXAFS analysis

Python Measurement-Informed Modelling Method (PythonMIMM) v1.02

This Python program implements the calculations for electrical energy efficiency and electrical losses in the paper "Energy and power quality measurement for electrical distribution in AC and DC microgrid buildings" (https://www.sciencedirect.com/science/article/abs/pii/S0306261921015658). The inputs are metered voltage, current, or power data of meters located throughout the DC system. In the absence of metered data, the user must input some other information about the building such as the types of power converters or wire lengths. The program will build a loss model of the DC system based on metered data and electrical information. It will also generate an equivalent AC system and determine the losses and efficiency.

Gerber, Daniel [Lawrence Berkeley National Laborat

PYDICE

A new Python program has been created that calculates similarity metrics (E, ck), available as a web server. Users can post one or more Sensitivity Data Files (SDFs) to either calculate similarity metrics (returned as a JSON response packet) or to be converted into a different SDF format (returned as a zip file).

Holcomb, Andrew [Oak Ridge National Laboratory (OR

pyTCR: A tropical cyclone rainfall model for python

pyTCR is a climatology software package developed in the Python programming language. It integrates the capabilities of several legacy physical models and increases computational efficiency to allow rapid estimation of tropical cyclone (TC) rainfall consistent with the large-scale environment. Specifically, pyTCR implements a horizontally distributed and vertically integrated model [Zhu et al., 2013] for simulating rainfall driven by TCs. Along storm tracks, rainfall is estimated by computing the cross-boundary-layer, upward water vapor transport caused by different mechanisms including frictional convergence, vortex stretching, large-scale baroclinic effect (i.e., wind shear), topographic forcing, and radiative cooling [Lu et al., 2018]. The package provides essential functionalities for modeling and interpreting spatio-temporal TC rainfall data. pyTCR requires a limited number of model input parameters, making it a convenient and useful tool for analyzing rainfall mechanisms driven by TCs. To sample rare (most intense) rainfall events that are often of great societal interest, pyTCR adapts and leverages outputs from a statistical-dynamical TC downscaling model [Lin et al., 2023] capable of rapidly generating a large number of synthetic TCs given a certain climate. As a result, pyTCR significantly reduces computational effort and improves the efficiency in capturing extreme TC rainfall events at the tail of the distributions from limited datasets. Furthermore, the TC downscaling model is forced entirely by large-scale environmental conditions from reanalysis data or coupled General Circulation Models (GCMs), simplifying the projection of TC-induced rainfall and wind speed under future climate using pyTCR. Finally, pyTCR can be coupled with hydrological and wind models to assess risks associated with independent and compound events (e.g., storm surges and freshwater flooding).

54 ENVIRONMENTAL SCIENCES

PyDislocDyn: A Python code for calculating dislocation drag and other crystal properties

PyDislocDyn is a suite of python programs designed to perform various calculations for dislocation dynamics in the continuum limit. In particular, one of its main purposes is to calculate dislocation drag from phonon wind. Additional features include the averaging of elastic constants for polycrystals, the calculation of the dislocation field including its limiting velocities, and the calculation of dislocation self-energy and line tension.

36 MATERIALS SCIENCE

Los Alamos National Laboratory R&D Intern

This report details the responsibilities, outcomes, and project details of a summer R&D internship at Los Alamos National Laboratory (LANL). LANL is a multidisciplinary laboratory that focuses on current cutting-edge research in many fields such as national security, engineering, materials science, computational modeling, and advanced manufacturing. The goal of the internship project was to work with lab engineers and resources to develop an energy absorbing structure for high-velocity impact applications. The successful development of this technology and methodology would not only positively impact future project funding but also contribute to the laboratory's commitment to solve national security challenges through simultaneous excellence. Such devices would also support efforts surrounding the research and development of energy absorbing structures and would provide new vital information backed by experimentation. Different computational and modeling methods were used to design these structures, in addition to qualitative background information provided by past literature. The resultant designs were successfully tested, and the test results were successfully quantified. From these results, new computational methods were developed through python programming and modeling to predict ideal materialistic properties for these structures given a sufficiently defined application.

36 MATERIALS SCIENCE

AutoSAC-Automated Sample Activation Calculation on VULCAN

AutoSAC is an automated python program to conduct sample activation calculation immediately after neutron scattering experiment on VULCAN. AutoSAC takes account of sample dimensions, compositions, forms, sample environments, neutron beam configurations, neutron scattering history, and proton charged resolved beam power etc., and uses a simplified method to rapidly estimate the radioactivity at end of beam or after. It generates a draft report per sample and repository of radioactivity per measurement and provides feedback of current radioactivity and decay time back to a neutron proposal Slack channel to inform users immediately on sample handling. It also utilizes either the sample note field in EPICS or sample composition or thickness correction and takes slack prompt or command to conduct post-beam SAC by demand. The program can be shared to be used in other beamlines at spallation neutron source with modified instrument configurations including instrument specific characteristic beam fluxes.

An, Ke [Oak Ridge National Laboratory (ORNL), Oak

The M-Integral for Computing Stress Intensity Factors in Generally Anisotropic Materials

The objective of this project is to develop and demonstrate a capability for computing stress intensity factors in generally anisotropic materials. These objectives have been met. The primary deliverable of this project is this report and the information it contains. In addition, we have delivered the source code for a subroutine that will compute stress intensity factors for anisotropic materials encoded in both the C and Python programming languages and made available a version of the FRANC3D program that incorporates this subroutine. Single crystal super alloys are commonly used for components in the hot sections of contemporary jet and rocket engines. Because these components have a uniform atomic lattice orientation throughout, they exhibit anisotropic material behavior. This means that stress intensity solutions developed for isotropic materials are not appropriate for the analysis of crack growth in these materials. Until now, a general numerical technique did not exist for computing stress intensity factors of cracks in anisotropic materials and cubic materials in particular. Such a capability was developed during the project and is described and demonstrated herein.

Warzynek, P. A.

Multiscale Simulations of Magnetic Island Coalescence

We describe a new interactive parallel Adaptive Mesh Refinement (AMR) framework written in the Python programming language. This new framework, PyAMR, hides the details of parallel AMR data structures and algorithms (e.g., domain decomposition, grid partition, and inter-process communication), allowing the user to focus on the development of algorithms for advancing the solution of a systems of partial differential equations on a single uniform mesh. We demonstrate the use of PyAMR by simulating the pairwise coalescence of magnetic islands using the resistive Hall MHD equations. Techniques for coupling different physics models on different levels of the AMR grid hierarchy are discussed.

Dorelli, John C.

Utilizing Commercial Hardware and Open Source Computer Vision Software to Perform Motion Capture for Reduced Gravity Flight

Long duration space travel to Mars or to an asteroid will expose astronauts to extended periods of reduced gravity. Since gravity is not present to aid loading, astronauts will use resistive and aerobic exercise regimes for the duration of the space flight to minimize the loss of bone density, muscle mass and aerobic capacity that occurs during exposure to a reduced gravity environment. Unlike the International Space Station (ISS), the area available for an exercise device in the next generation of spacecraft is limited. Therefore, compact resistance exercise device prototypes are being developed. The NASA Digital Astronaut Project (DAP) is supporting the Advanced Exercise Concepts (AEC) Project, Exercise Physiology and Countermeasures (ExPC) project and the National Space Biomedical Research Institute (NSBRI) funded researchers by developing computational models of exercising with these new advanced exercise device concepts. To perform validation of these models and to support the Advanced Exercise Concepts Project, several candidate devices have been flown onboard NASAs Reduced Gravity Aircraft. In terrestrial laboratories, researchers typically have available to them motion capture systems for the measurement of subject kinematics. Onboard the parabolic flight aircraft it is not practical to utilize the traditional motion capture systems due to the large working volume they require and their relatively high replacement cost if damaged. To support measuring kinematics on board parabolic aircraft, a motion capture system is being developed utilizing open source computer vision code with commercial off the shelf (COTS) video camera hardware. While the systems accuracy is lower than lab setups, it provides a means to produce quantitative comparison motion capture kinematic data. Additionally, data such as required exercise volume for small spaces such as the Orion capsule can be determined. METHODS: OpenCV is an open source computer vision library that provides the ability to perform multi-camera 3 dimensional reconstruction. Utilizing OpenCV, via the Python programming language, a set of tools has been developed to perform motion capture in confined spaces using commercial cameras. Four Sony Video Cameras were intrinsically calibrated prior to flight. Intrinsic calibration provides a set of camera specific parameters to remove geometric distortion of the lens and sensor (specific to each individual camera). A set of high contrast markers were placed on the exercising subject (safety also necessitated that they be soft in case they become detached during parabolic flight); small yarn balls were used. Extrinsic calibration, the determination of camera location and orientation parameters, is performed using fixed landmark markers shared by the camera scenes. Additionally a wand calibration, the sweeping of the camera scenes simultaneously, was also performed. Techniques have been developed to perform intrinsic calibration, extrinsic calibration, isolation of the markers in the scene, calculation of marker 2D centroids, and 3D reconstruction from multiple cameras. These methods have been tested in the laboratory side-by-side comparison to a traditional motion capture system and also on a parabolic flight.

Biodynamics