Engineering Papers⌕ Search

SEARCH · Engineering Papers

Results for “PYTHON”

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

PyCCE: A python package for custer correlation expansion simulations of spin qubit dynamics.

PyCCE, an open-source Python library for simulating the dynamics of spin qubits in a spin bath, is presented using the cluster-correlation expansion (CCE) method. PyCCE includes modules to generate realistic spin baths, employing coupling parameters computed from first principles with electronic structure codes, and enables the user to run simulations with either the conventional or generalized CCE method. Three use cases of the Python library are illustrated: the calculation of the Hahn-echo coherence time of the nitrogen-vacancy in diamond; the calculation of the coherence time of the basal divacancy in silicon carbide at avoided crossings; and the calculation for magnetic field orientation-dependent dynamics of a shallow donor in silicon. The complete documentation, downloadable tutorials, and installation instructions are available at https://pycce.readthedocs.io/en/latest/.

coherence↗

Python Codebase and Jupyter Notebooks - Applications of Machine Learning Techniques to Geothermal Play Fairway Analysis in the Great Basin Region, Nevada

Git archive containing Python modules and resources used to generate machine-learning models used in the "Applications of Machine Learning Techniques to Geothermal Play Fairway Analysis in the Great Basin Region, Nevada" project. This software is licensed as free to use, modify, and distribute with attribution. Full license details are included within the archive. See "documentation.zip" for setup instructions and file trees annotated with module descriptions.

Brown, Stephen↗

FSVPy: A python-based package for fluorescent streak velocimetry (FSV)

Predictive constitutive equations that connect easy-to-measure transport properties (e.g., viscosity and conductivity) with system performance variables (e.g., power consumption and efficiency) are needed to design advanced thermal and electrical systems. In this work, we explore the use of fluorescent particle-streak analysis to directly measure the local velocity field of a pressure-driven flow, introducing a new Python package (FSVPy) to perform the analysis. Fluorescent streak velocimetry combines high-speed imaging with highly fluorescent particles to produce images that contain fluorescent streaks, whose length and intensity can be related to the local flow velocity. By capturing images throughout the sample volume, the three-dimensional velocity field can be quantified and reconstructed. We demonstrate this technique by characterizing the channel flow profiles of several non-Newtonian fluids: micellar Cetylpyridinium Chloride solution, Carbopol 940, and Polyethylene Glycol. We then explore more complex flows, where significant acceleration is created due to microscale features encountered within the flow. We demonstrate the ability of FSVPy to process streaks of various shapes and use the variable intensity along the streak to extract position-specific velocity measurements from individual images. Thus, we demonstrate that FSVPy is a flexible tool that can be used to extract local velocimetry measurements from a wide variety of fluids and flow conditions.

Mechanics↗

Python package for machine-readable access to PDG data (PDG Python API) v0.1

This Python package implements a high-level interface to access the data published by the Particle Data Group (PDG) in the Review of Particle Physics (the "Review"). The Particle Data Group is an international collaboration led by the PDG group at LBNL. The PDG summarizes the established knowledge in the field of particle physics in a single publication, the Review of Particle Physics. The Review is published and updated online (see https://pdg.lbl.gov) each year, and published in a scientific journal every other year. It is currently licensed under a CC BY-NC 4.0 license. In 2021 PDG was designated by the Office of Science as a SC PuRe Data Resource. The Review is one of the most highly cited publications in the field of particle physics. The PDG Python API is part of PDG's efforts to make all data provided in the Review available in machine-readable format. This data includes the PDG world averages (or best limits) on particle masses, widths or lifetimes, branching fractions, magnetic moments, form factors, coupling constant ratios, and searches, as well as particle quantum numbers. It also includes detailed information on how PDG arrived at its averages, such as e.g. tables of published measurements with comments and footnotes, information on the consistency of published measurements, and detailed fit information.

Beringer, Juerg↗

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↗

Improving Runtime Performance of Tensor Computations using Rust From Python

In this work, we investigate improving the runtime performance of key computational kernels in the Python Tensor Toolbox (pyttb), a package for analyzing tensor data across a wide variety of applications. Recent runtime performance improvements have been demonstrated using Rust, a compiled language, from Python via extension modules leveraging the Python C API—e.g., web applications, data parsing, data validation, etc. Using this same approach, we study the runtime performance of key tensor kernels of increasing complexity, from simple kernels involving sums of products over data accessed through single and nested loops to more advanced tensor multiplication kernels that are key in low-rank tensor decomposition and tensor regression algorithms. In numerical experiments involving synthetically generated tensor data of various sizes and these tensor kernels, we demonstrate consistent improvements in runtime performance when using Rust from Python over 1) using Python alone, 2) using Python and the Numba just-in-time Python compiler (for loop-based kernels), and 3) using the NumPy Python package for scientific computing (for pyttb kernels).

97 MATHEMATICS AND COMPUTING↗

Python-Based Scientific Analysis and Visualization of Precipitation Systems at NASA Marshall Space Flight Center

At NASA Marshall Space Flight Center (MSFC), Python is used several different ways to analyze and visualize precipitating weather systems. A number of different Python‐based software packages have been developed, which are available to the larger scientific community. The approach in all these packages is to utilize pre‐existing Python modules as well as to be object‐oriented and scalable. The first package that will be described and demonstrated is the Python Advanced Microwave Precipitation Radiometer (AMPR) Data Toolkit, or PyAMPR for short. PyAMPR reads geolocated brightness temperature data from any flight of the AMPR airborne instrument over its 25‐year history into a common data structure suitable for user‐defined analyses. It features rapid, simplified (i.e., one line of code) production of quick‐look imagery, including Google Earth overlays, swath plots of individual channels, and strip charts showing multiple channels at once. These plotting routines are also capable of significant customization for detailed, publication‐ready figures. Deconvolution of the polarization‐varying channels to static horizontally and vertically polarized scenes is also available. Examples will be given of PyAMPR's contribution toward real‐time AMPR data display during the Integrated Precipitation and Hydrology Experiment (IPHEx), which took place in the Carolinas during May‐June 2014. The second software package is the Marshall Multi‐Radar/Multi‐Sensor (MRMS) Mosaic Python Toolkit, or MMM‐Py for short. MMM‐Py was designed to read, analyze, and display three‐dimensional national mosaicked reflectivity data produced by the NOAA National Severe Storms Laboratory (NSSL). MMM‐Py can read MRMS mosaics from either their unique binary format or their converted NetCDF format. It can also read and properly interpret the current mosaic design (4 regional tiles) as well as mosaics produced prior to late July 2013 (8 tiles). MMM‐Py can easily stitch multiple tiles together to provide a larger regional or national picture of precipitating weather systems. Composites, horizontal and vertical crosssections, and combinations thereof are easily displayed using as little as one line of code. MMM‐Py can also write to the native MRMS binary format, and sub‐sectioning of tiles (or multiple stitched tiles) is anticipated to be in place by the time of this meeting. Thus, MMM‐Py also can be used to power the creation of custom mosaics for targeted regional studies. Overlays of other data (e.g., lightning observations) are easily accomplished. Demonstrations of MMM‐Py, including the creation of animations, will be shown. Finally, Marshall has done significant work to interface Python‐based analysis routines with the U.S. Department of Energy's Py‐ART software package for radar data ingest, processing, and analysis. One example of this is the Python Turbulence Detection Algorithm (PyTDA), an MSFC‐based implementation of the National Center for Atmospheric Research (NCAR) Turbulence Detection Algorithm (NTDA) for the purposes of convective‐scale analysis, situational awareness, and forensic meteorology. PyTDA exploits Py‐ART's radar data ingest routines and data model to rapidly produce aviation‐relevant turbulence estimates from Doppler radar data. Work toward processing speed optimization and better integration within the Py‐ART framework will be highlighted. Python‐based analysis within the Py‐ART framework is also being done for new research related to intercomparison of ground‐based radar data with satellite estimates of ocean winds, as well as research on the electrification of pyrocumulus clouds.

Lang, Timothy J.↗

PythonFOAM: In-situ data analyses with OpenFOAM and Python

Here, we outline the development of a general-purpose Python-based data analysis tool for OpenFOAM. Our implementation relies on the construction of OpenFOAM applications that have bindings to data analysis libraries in Python. Double precision data in OpenFOAM is cast to a NumPy array using the NumPy C-API and Python modules may then be used for arbitrary data analysis and manipulation on flow-field information. We highlight how the proposed wrapper may be used for an in-situ online singular value decomposition (SVD) implemented in Python and accessed from the OpenFOAM solver PimpleFOAM. Here, 'in-situ' refers to a programming paradigm that allows for a concurrent computation of the data analysis on the same computational resources utilized for the partial differential equation solver. In addition, to demonstrate parallel deployments, we deploy a distributed SVD, which collects snapshot data across the ranks of a distributed simulation to compute the global left singular vectors. Crucially, both OpenFOAM and Python share the same message passing interface (MPI) communicator for this deployment which allows Python objects and functions to exchange NumPy arrays across ranks. Subsequently, we provide scaling assessments of this distributed SVD on multiple nodes of Intel Broadwell and KNL architectures for canonical test cases such as the large eddy simulations of a backward facing step and a channel flow at friction Reynolds number of 395. Finally, we demonstrate the deployment of a deep neural network for compressing the flow-field information using an autoencoder to demonstrate an ability to use state-of-the-art machine learning tools in the Python ecosystem.

97 MATHEMATICS AND COMPUTING↗

pvlib python: 2023 project update

pvlib python is a community-developed, open-source software toolbox for simulating the performance of solar photovoltaic (PV) energy components and systems. It provides reference implementations of over 100 empirical and physics-based models from the peer-reviewed scientific literature, including solar position algorithms, irradiance models, thermal models, and PV electrical models. In addition to individual low-level model implementations, pvlib python provides high-level workflows that chain these models together like building blocks to form complete “weather-to-power” photovoltaic system models. It also provides functions to fetch and import a wide variety of weather datasets useful for PV modeling. pvlib python has been developed since 2013 and follows modern best practices for open-source python software, with comprehensive automated testing, standards-based packaging, and semantic versioning. Its source code is developed openly on GitHub and releases are distributed via the Python Package Index (PyPI) and the conda-forge repository. pvlib python’s source code is made freely available under the permissive BSD-3 license. Here we (the project’s core developers) present an update on pvlib python, describing capability and community development since our 2018 publication (Holmgren, Hansen, & Mikofski, 2018).

14 SOLAR ENERGY↗

Mathematical solutions in internal dose assessment: A comparison of Python-based differential equation solvers in biokinetic modeling

Abstract In biokinetic modeling systems employed for radiation protection, biological retention and excretion have been modeled as a series of discretized compartments representing the organs and tissues of the human body. Fractional retention and excretion in these organ and tissue systems have been mathematically governed by a series of coupled first-order ordinary differential equations (ODEs). The coupled ODE systems comprising the biokinetic models are usually stiff due to the severe difference between rapid and slow transfers between compartments. In this study, the capabilities of solving a complex coupled system of ODEs for biokinetic modeling were evaluated by comparing different Python programming language solvers and solving methods with the motivation of establishing a framework that enables multi-level analysis. The stability of the solvers was analyzed to select the best performers for solving the biokinetic problems. A Python-based linear algebraic method was also explored to examine how the numerical methods deviated from an analytical or semi-analytical method. Results demonstrated that customized implicit methods resulted in an enhanced stable solution for the inhaled 60 Co (Type M) and 131 I (Type F) exposure scenarios for the inhalation pathway of the International Commission on Radiological Protection (ICRP) Publication 130 Human Respiratory Tract Model (HRTM). The customized implementation of the Python-based implicit solvers resulted in approximately consistent solutions with the Python-based matrix exponential method ( expm ). The differences generally observed between the implicit solvers and expm are attributable to numerical precision and the order of numerical approximation of the numerical solvers. This study provides the first analysis of a list of Python ODE solvers and methods by comparing their usage for solving biokinetic models using the ICRP Publication 130 HRTM and provides a framework for the selection of the most appropriate ODE solvers and methods in Python language to implement for modeling the distribution of internal radioactivity.

61 RADIATION PROTECTION AND DOSIMETRY↗

Flexible Integration of Diverse HVAC Technologies in EnergyPlus via Python-Enabled Workflows

Analysis of advanced controls and novel system types is often not directly feasible in building energy simulation tools. Various techniques extend building energy simulation tool capabilities to allow the use of user-defined scripts and programs, but these approaches have limitations. The EnergyPlus Python plugin offers users new flexibility to use EnergyPlus to call an external Python module at specific points in the simulation, as well as to use Python to call EnergyPlus functionality through an application programming interface (API). This paper presents four case studies leveraging the EnergyPlus Python plugin to facilitate analysis of advanced controls and system types. The use of the Python plugin offers greater modularity and flexibility relative to previous approaches, is less error prone, and is simpler for users to adopt. The Python plugin allows EnergyPlus to be used in a more flexible manner and to accommodate the expanding realm of energy modeling applications.

32 ENERGY CONSERVATION, CONSUMPTION, AND UTILIZATI↗

PyOMP: Multithreaded Parallel Programming in Python

We know that Python is a widely used language in scientific computing. When the goal is high performance, however, Python lags far behind low-level languages such as C and Fortran. To support applications that stress performance, Python needs to access the full capabilities of modern CPUs. That means support for parallel multithreading. In this paper, we describe PyOMP, a system that enables OpenMP in Python. Programmers write code in Python with OpenMP, Numba generates code that compiles to LLVM, and the resulting programs run with performance that approaches that from code written with C and OpenMP. In this paper we provide an update on the PyOMP project and explain how to install it and use it to write parallel multithreaded code in Python.

97 MATHEMATICS AND COMPUTING↗

Demonstrating SolarPILOT’s Python API Through Heliostat Optimal Aimpoint Strategy Use Case

SolarPILOT is a software package that generates solar field layouts and characterizes the optical performance of concentrating solar power (CSP) tower systems. SolarPILOT was developed by the National Renewable Energy Laboratory (NREL) as a stand-alone desktop application but has also been incorporated into NREL’s1 System Advisor Model (SAM) in a simplified format. Prior means for user interaction with SolarPILOT have included the application’s graphical interface, the SAM routines with limited configurability, and through a built-in scripting language called “LK.” This paper presents a new, full-featured, Python-based application programmable interface (API) for SolarPILOT, which we hereafter refer to as CoPylot. CoPylot provides access to all SolarPILOT’s capabilities to generate and characterize power tower CSP systems seamlessly through Python. Supported capabilities include (i) creating and destroying a model instance with message reporting tools; (ii) accessing and setting any SolarPILOT variable including custom land boundaries for field layouts; (iii) programmatically managing receiver and heliostat objects with varied attributes for systems with multiple receiver or heliostat types; (iv) generating, assigning, and modifying solar field layouts including the ability to set individual heliostat locations, aimpoints, soiling rates, and reflectivity levels; (v) simulating solar field performance; (vi) returning detailed results describing performance of individual heliostats, the aggregate field, and receiver flux distribution; and, (vii) exporting Python-based model instances to multiple file formats. CoPylot enables Python users to perform detailed CSP tower analysis utilizing either the Hermite expansion technique (analytical) or the SolTrace ray-tracing engine. In addition to CoPylot’s functionality, Python users have access to the over 100,000 open-source libraries to develop, analyze, optimize, and visualize power tower CSP research. This enables CSP researchers to perform analysis that was previously not possible through SolarPILOT’s existing interfaces. This paper discusses the capabilities of CoPylot and presents a use case wherein we demonstrate optimal solar field aiming strategies.

41 EE - Solar Energy Technologies Office (EE-4S)↗

Demonstrating SolarPILOT's Python API Through Heliostat Optimal Aimpoint Strategy Use Case: Preprint

SolarPILOT is a software package that generates heliostat field layouts and characterizes the optical performance of concentrating solar power (CSP) tower systems. SolarPILOT was developed by the National Renewable Energy Laboratory (NREL) as a stand-alone desktop application but has also been incorporated into NREL's System Advisor Model (SAM) in a simplified format. Prior means for user interaction with SolarPILOT have included the application's graphical interface, the SAM routines with limited configurability, and through a built-in scripting language called "LK." This paper presents a new, full-featured Python-based application programmable interface (API) for SolarPILOT, which we hereafter refer to as CoPylot. CoPylot provides access to all SolarPILOT's capabilities to generate and characterize power tower CSP systems seamlessly through Python. Supported capabilities include (i) creating and destroying a model instances with message reporting tools; (ii) accessing and setting any SolarPILOT variable including custom land boundaries for field layout; (iii) programmatically managing receiver and heliostat objects with varied attributes for systems with multiple receiver or heliostat types; (iv) generating, assigning, and modifying heliostat field layouts including the ability to set individual heliostat locations, aimpoints, soiling rates, and reflectivity levels; (v) simulating heliostat field performance; (vi) returning detailed results describing performance of individual heliostats, the aggregate field, and receiver flux; and, (vii) exporting Python-based model instances to multiple file formats. CoPylot enables Python users to perform detailed tower CSP analysis utilizing either the Hermite expansion technique (analytical) or the SolTrace ray-tracing engine. In addition to CoPylot's functionality, Python users have access to the over 100,000 open-source libraries to develop, analyze, optimize, and visualize CSP tower research.

41 EE - Solar Energy Technologies Office (EE-4S)↗

Adapter Python IO (Adapter) v1.0

The Adapter Python IO software, in short Adapter or the Adapter software, encapsulates certain Python IO capabilities used for loading in and writing out data when performing analytical Python code runs. More specificcally, it provides a Python API to load data tables from various formats such as XLSX (MS Excel), CSV, and database, into Python code as Pandas DataFrames, as well as to write out tables into a database or CSV files. The Adapter software standardizes a way to point the code to one or multiple input files of one or multiple formats. Therefore, its main feature is the ability to convert data tables identified in one main and, optionally, one or more additional input files, into database tables and Pandas DataFrames for downstream usage in any compatible software. In addition to the loading capability, an instance of the Adapter IO object has the capability to write data out. If the write capability is invoked, all loaded tables are written as either a single database or a set of CSV files, or both, to a location specified in the dedicated input table.

Grahovac, Milica↗

SALSA_python (SALSython) v1

SALSA_python (Semi-Analytical Leakage Solutions for Aquifers) is a software that computed semi-analytical solutions for hydraulic head and brine leakage in multilayered aquifer–aquitard systems with geologic pressure forcing. It can simulate brine leakage into aquifers in a multi-aquifer-aquitard system with multiple injection and leaky wells. This situation is encountered in underground CO2 storage wherein brine leakage from pressurized reservoirs into aquifers is of concern. SALSA_python calls the original SALSA[1] subroutines in python by using the salsa2.so library. This enables the incorporation and coupling of SALSA computations into existing python-based codes and tools. SALSA_python is available for Linux and Mac operating systems. [1] Cihan, A., Oldenburg, C. M., & Birkholzer, J. T. (2022). Leakage from coexisting geologic forcing and injection-induced pressurization: A semi-analytical solution for multilayered aquifers with multiple wells. Water Resources Research, 58, e2022WR032343.

Bhuvankar, Pramod↗

Functionality of the Python Packages for the HERMES Mission

The Heliophysics Environmental and Radiation Measurement Experiment Suite (HERMES) is a set of four instruments that will fly on the Lunar Gateway, an orbital outpost which will support Artemis lunar operations. HERMES will focus on understanding the causes of space-weather variability as driven by the Sun and modulated by the magnetosphere. In this talk, we will discuss the open source approach of the HERMES Science Operation Center (SOC) team being implemented in a number of Python packages which all work together. We will describe the core package which contains Python interfaces for the loading, calibrating, plotting, validating, and saving of measurement data through Common Data Format (CDF) files making use of pycdf provided by spacepy. Each instrument also has a Python package developed using a package template and will provide specific calibration and processing functionality to each instrument. The packages make extensive use of the scientific Python ecosystem and maintain compatibility with PyHC standards. The abstraction of intricate, high heritage data formats, such as CDF files, in Python enables easier analysis and opens doors for greater participation in heliophysics science.

hermes↗