Engineering PapersSearch

SEARCH · Engineering Papers

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

Oscilloscope Data Push Program

This paper details the development of a Python program designed to automate the data acquisition and conversion for an oscilloscope for the purposes of a one-off/temporary data acquisition system for users that readily need data, and do not have the option of obtaining a Data Acquisition (DAQ) solution. Creating DAQ systems for analyzing a system requires expensive electronics and a dedicated team of engineers for support. Traditionally, manual data collection and processing are time consuming and prone to error. By automating these processes, the cost, efficiency and accuracy of data handling are improved upon. This project involves the creation of a program that interacts with the oscilloscope. During this interaction, there are various functions being performed such as the acquisition of waveform data via floating points, generating plots with the acquired wave points, and storing of floating points in a CSV file format for future reference and plotting purposes. While the initial aim of the project included continuous logging to a cloud database, this was deferred due to time constraints. The results portrayed an almost-instant rate of data collection with a buffer time, showcasing the potential for further integration and real-time data processing.

Osei-Tutu, Jason

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

pvplr-python: Python package implementation of PVplr for Performance Loss Rate (PLR) analysis

Due to software fragmentation, PV system modeling teams can be limited to language specific packages, preventing cross-sectional analysis of different modeling techniques and workflows. To this end, PVplr, a popular PV performance modeling R software package, has been ported to the Python programming language. To verify and test the robustness of the port, NSRDB data has been used to simulated PV installations at native resolution (~2 million Sites), with a variety of degradation rates, degradation patterns, and modules. Performance Ratios were calculated using the ported functions from pvplr-python and compared against Rdtools YoY values. Due to the complicated nature of degradation, a new metric has been proposed to quantify the performance loss of a system. The cumulative production loss, is the total amount of energy lost due to the degrading performance of the system. Cumulative production loss alleviates the problems with fitting linear functions to non-linear degradation. Cumulative Production loss was shown to better estimate the total lost revenue for non-linear degradation patterns. $XbX + UTC$ was found to most accurately predict the total lost revenue in simulated systems.

Kumar, Suraj

Oscilloscope Data Push Program

Data acquisition (DAQ) is a complex and costly process. Creating DAQ systems for analyzing a system requires expensive electronics and a dedicated team of engineers for support, posing a challenge for users who readily need data. This project is a proof of concept to create a temporary or one-off DAQ system using equipment commonly available to every team. We aim to automate the data acquisition process from the Rohde \& Schwarz RTO 1044 oscilloscope, convert the acquired binary data into floating point values, and store the results in a CSV file format. By developing a Python program to handle these tasks, we seek to reduce the manual effort involved in data collection, significantly increasing efficiency.

Osei-Tutu, Jason

Control And Optimization Modular Modeling Application For Nuclear Deployment

The purpose of the COMMAND code is to provide a flexible, scalable tool for use in developing, integrating, and testing the technologies necessary for achieving autonomous operations of advanced nuclear reactors. The code enables users to efficiently implement custom simulations and experiments by combining key methods from different software modules. These modules are focused on: modeling and simulation tools, such as nuclear simulation tools used for high-fidelity modeling (e.g., Reactor Excursion and Leak Analysis Program [RELAP5-3D] and Monte Carlo N-Particle [MCNP]); machine learning and optimization tools (e.g., anomaly detection and data-driven modeling techniques); advanced control in its digital, high-performance, and supervisory control forms (e.g., proportional integral derivative (PID) control and model predictive control (MPC); and integration with hardware through industrial communication protocols. To ensure flexibility and scalability, COMMAND was designed to be both modular—the software “pieces” all inherit from generic building blocks and can be combined and connected to create complicated simulations—and high performing—designed for parallel processing, enabling simulations and experiments to take advantage of multi-core computers, servers, and nodes. The code is written in the Python programming language due to the language's popularity, active community, and open-source and cross-platform nature. Maintaining consistency with other simulation tools used within the nuclear energy community, users implement simulations and experiments through text input files, which define components, parameters, connections, etc., through lines of text. Given that COMMAND is written in Python, these input files are native Python scripts, and so use the standard Python structure and formatting. This also enables users to take advantage of Python's extensive package library to develop custom capabilities for their specific use cases.

Faber, Jacob [Idaho National Laboratory (INL), Ida

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

pymcnp v1

This is a software package that makes it easier to handle MCNP, a neutron transport simulation toolkit, simulations. It helps with reading and writing output from MCNP and modifying the input files programmatically. Furthermore, it also allows the visualization of input geometry and of the results. Pymcnp provides access to these features using the Python programming language.

Persaud, Arun

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