skip to main content

Title: pyUserCalc: A Revised Jupyter Notebook Calculator for Uranium-Series Disequilibria in Basalts
Meaningful analysis of uranium-series isotopic disequilibria in basaltic lavas relies on the use of complex forward numerical models like dynamic melting (McKenzie, 1985, 821x(85)90001-9) and equilibrium porous flow (Spiegelman & Elliott, 1993, 821x(93)90155-3). Historically, such models have either been solved analytically for simplified scenarios, such as constant melting rate or constant solid/melt trace element partitioning throughout the melting process, or have relied on incremental or numerical calculators with limited power to solve problems and/or restricted availability. The most public numerical solution to reactive porous flow, UserCalc (Spiegelman, 2000, https:// was maintained on a private institutional server for nearly two decades, but that approach has been unsustainable in light of modern security concerns. Here, we present a more long-lasting solution to the problems of availability, model sophistication and flexibility, and long-term access in the form of a cloud-hosted, publicly available Jupyter notebook. Similar to UserCalc, the new notebook calculates U-series disequilibria during time-dependent, equilibrium partial melting in a one-dimensional porous flow regime where mass is conserved. In addition, we also provide a new disequilibrium transport model which has the same melt transport model as UserCalc, but approximates rate-limited diffusive exchange of nuclides between solid and melt using linear kinetics. The degree of disequilibrium during transport is controlled by a Damköhler number, allowing the full spectrum of equilibration models from complete fractional melting (Da = 0) to equilibrium transport (Da = ∞).  more » « less
Award ID(s):
Author(s) / Creator(s):
Date Published:
Journal Name:
Earth and space science
Medium: X
Sponsoring Org:
National Science Foundation
More Like this
  1. Recent numerical predictions of turbulent boundary layers subject to very strong Favorable Pressure Gradient (FPG) with high spatial/temporal resolution, i.e. Direct Numerical Simulation (DNS), have shown a meaningful weakening of the Reynolds shear stresses with a lengthy logarithmic behavior [1,2]. In the present study, assessment of the Shear Stress Transport and Spalart-Allmaras turbulence models (hence- forth SST and SA, respectively) in Reynolds-averaged Navier-Stokes (RANS) simulations is performed. The main objective is to evaluate the ability of popular turbulence models in capturing the characteristic features present during the quasi-laminarization phenomenon in highly accelerating turbulent boundary layers. A favorable pressure gradient is prescribed by a top converging surface (sink flow) with an approximately constant acceleration parameter of K = 4 . 0 ×10 −6 . Validation of RANS results is carried out by means of a large DNS dataset [1]. Generally speaking, the SA turbulence model has demonstrated the best compromise between accuracy and quick adaptation to the turbulent inflow conditions. Turbulence models properly captured the increasing trend of the freestream and friction velocity in highly accelerated flows; however, they fail to reproduce the decreasing behavior of the skin friction coefficient, which is typical in early stages of the quasi-laminarization process. Both models have shown deficient predictions of the decreasing and logarithmic behavior of Reynolds shear stresses as well as significantly overpredicted the production of Turbulent Kinetic Energy (TKE) in turbulent boundary layers subject to very strong FPG. 
    more » « less
  2. Obeid, Iyad Selesnick (Ed.)
    Electroencephalography (EEG) is a popular clinical monitoring tool used for diagnosing brain-related disorders such as epilepsy [1]. As monitoring EEGs in a critical-care setting is an expensive and tedious task, there is a great interest in developing real-time EEG monitoring tools to improve patient care quality and efficiency [2]. However, clinicians require automatic seizure detection tools that provide decisions with at least 75% sensitivity and less than 1 false alarm (FA) per 24 hours [3]. Some commercial tools recently claim to reach such performance levels, including the Olympic Brainz Monitor [4] and Persyst 14 [5]. In this abstract, we describe our efforts to transform a high-performance offline seizure detection system [3] into a low latency real-time or online seizure detection system. An overview of the system is shown in Figure 1. The main difference between an online versus offline system is that an online system should always be causal and has minimum latency which is often defined by domain experts. The offline system, shown in Figure 2, uses two phases of deep learning models with postprocessing [3]. The channel-based long short term memory (LSTM) model (Phase 1 or P1) processes linear frequency cepstral coefficients (LFCC) [6] features from each EEG channel separately. We use the hypotheses generated by the P1 model and create additional features that carry information about the detected events and their confidence. The P2 model uses these additional features and the LFCC features to learn the temporal and spatial aspects of the EEG signals using a hybrid convolutional neural network (CNN) and LSTM model. Finally, Phase 3 aggregates the results from both P1 and P2 before applying a final postprocessing step. The online system implements Phase 1 by taking advantage of the Linux piping mechanism, multithreading techniques, and multi-core processors. To convert Phase 1 into an online system, we divide the system into five major modules: signal preprocessor, feature extractor, event decoder, postprocessor, and visualizer. The system reads 0.1-second frames from each EEG channel and sends them to the feature extractor and the visualizer. The feature extractor generates LFCC features in real time from the streaming EEG signal. Next, the system computes seizure and background probabilities using a channel-based LSTM model and applies a postprocessor to aggregate the detected events across channels. The system then displays the EEG signal and the decisions simultaneously using a visualization module. The online system uses C++, Python, TensorFlow, and PyQtGraph in its implementation. The online system accepts streamed EEG data sampled at 250 Hz as input. The system begins processing the EEG signal by applying a TCP montage [8]. Depending on the type of the montage, the EEG signal can have either 22 or 20 channels. To enable the online operation, we send 0.1-second (25 samples) length frames from each channel of the streamed EEG signal to the feature extractor and the visualizer. Feature extraction is performed sequentially on each channel. The signal preprocessor writes the sample frames into two streams to facilitate these modules. In the first stream, the feature extractor receives the signals using stdin. In parallel, as a second stream, the visualizer shares a user-defined file with the signal preprocessor. This user-defined file holds raw signal information as a buffer for the visualizer. The signal preprocessor writes into the file while the visualizer reads from it. Reading and writing into the same file poses a challenge. The visualizer can start reading while the signal preprocessor is writing into it. To resolve this issue, we utilize a file locking mechanism in the signal preprocessor and visualizer. Each of the processes temporarily locks the file, performs its operation, releases the lock, and tries to obtain the lock after a waiting period. The file locking mechanism ensures that only one process can access the file by prohibiting other processes from reading or writing while one process is modifying the file [9]. The feature extractor uses circular buffers to save 0.3 seconds or 75 samples from each channel for extracting 0.2-second or 50-sample long center-aligned windows. The module generates 8 absolute LFCC features where the zeroth cepstral coefficient is replaced by a temporal domain energy term. For extracting the rest of the features, three pipelines are used. The differential energy feature is calculated in a 0.9-second absolute feature window with a frame size of 0.1 seconds. The difference between the maximum and minimum temporal energy terms is calculated in this range. Then, the first derivative or the delta features are calculated using another 0.9-second window. Finally, the second derivative or delta-delta features are calculated using a 0.3-second window [6]. The differential energy for the delta-delta features is not included. In total, we extract 26 features from the raw sample windows which add 1.1 seconds of delay to the system. We used the Temple University Hospital Seizure Database (TUSZ) v1.2.1 for developing the online system [10]. The statistics for this dataset are shown in Table 1. A channel-based LSTM model was trained using the features derived from the train set using the online feature extractor module. A window-based normalization technique was applied to those features. In the offline model, we scale features by normalizing using the maximum absolute value of a channel [11] before applying a sliding window approach. Since the online system has access to a limited amount of data, we normalize based on the observed window. The model uses the feature vectors with a frame size of 1 second and a window size of 7 seconds. We evaluated the model using the offline P1 postprocessor to determine the efficacy of the delayed features and the window-based normalization technique. As shown by the results of experiments 1 and 4 in Table 2, these changes give us a comparable performance to the offline model. The online event decoder module utilizes this trained model for computing probabilities for the seizure and background classes. These posteriors are then postprocessed to remove spurious detections. The online postprocessor receives and saves 8 seconds of class posteriors in a buffer for further processing. It applies multiple heuristic filters (e.g., probability threshold) to make an overall decision by combining events across the channels. These filters evaluate the average confidence, the duration of a seizure, and the channels where the seizures were observed. The postprocessor delivers the label and confidence to the visualizer. The visualizer starts to display the signal as soon as it gets access to the signal file, as shown in Figure 1 using the “Signal File” and “Visualizer” blocks. Once the visualizer receives the label and confidence for the latest epoch from the postprocessor, it overlays the decision and color codes that epoch. The visualizer uses red for seizure with the label SEIZ and green for the background class with the label BCKG. Once the streaming finishes, the system saves three files: a signal file in which the sample frames are saved in the order they were streamed, a time segmented event (TSE) file with the overall decisions and confidences, and a hypotheses (HYP) file that saves the label and confidence for each epoch. The user can plot the signal and decisions using the signal and HYP files with only the visualizer by enabling appropriate options. For comparing the performance of different stages of development, we used the test set of TUSZ v1.2.1 database. It contains 1015 EEG records of varying duration. The any-overlap performance [12] of the overall system shown in Figure 2 is 40.29% sensitivity with 5.77 FAs per 24 hours. For comparison, the previous state-of-the-art model developed on this database performed at 30.71% sensitivity with 6.77 FAs per 24 hours [3]. The individual performances of the deep learning phases are as follows: Phase 1’s (P1) performance is 39.46% sensitivity and 11.62 FAs per 24 hours, and Phase 2 detects seizures with 41.16% sensitivity and 11.69 FAs per 24 hours. We trained an LSTM model with the delayed features and the window-based normalization technique for developing the online system. Using the offline decoder and postprocessor, the model performed at 36.23% sensitivity with 9.52 FAs per 24 hours. The trained model was then evaluated with the online modules. The current performance of the overall online system is 45.80% sensitivity with 28.14 FAs per 24 hours. Table 2 summarizes the performances of these systems. The performance of the online system deviates from the offline P1 model because the online postprocessor fails to combine the events as the seizure probability fluctuates during an event. The modules in the online system add a total of 11.1 seconds of delay for processing each second of the data, as shown in Figure 3. In practice, we also count the time for loading the model and starting the visualizer block. When we consider these facts, the system consumes 15 seconds to display the first hypothesis. The system detects seizure onsets with an average latency of 15 seconds. Implementing an automatic seizure detection model in real time is not trivial. We used a variety of techniques such as the file locking mechanism, multithreading, circular buffers, real-time event decoding, and signal-decision plotting to realize the system. A video demonstrating the system is available at: The final conference submission will include a more detailed analysis of the online performance of each module. ACKNOWLEDGMENTS Research reported in this publication was most recently supported by the National Science Foundation Partnership for Innovation award number IIP-1827565 and the Pennsylvania Commonwealth Universal Research Enhancement Program (PA CURE). Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the official views of any of these organizations. REFERENCES [1] A. Craik, Y. He, and J. L. Contreras-Vidal, “Deep learning for electroencephalogram (EEG) classification tasks: a review,” J. Neural Eng., vol. 16, no. 3, p. 031001, 2019. [2] A. C. Bridi, T. Q. Louro, and R. C. L. Da Silva, “Clinical Alarms in intensive care: implications of alarm fatigue for the safety of patients,” Rev. Lat. Am. Enfermagem, vol. 22, no. 6, p. 1034, 2014. [3] M. Golmohammadi, V. Shah, I. Obeid, and J. Picone, “Deep Learning Approaches for Automatic Seizure Detection from Scalp Electroencephalograms,” in Signal Processing in Medicine and Biology: Emerging Trends in Research and Applications, 1st ed., I. Obeid, I. Selesnick, and J. Picone, Eds. New York, New York, USA: Springer, 2020, pp. 233–274. [4] “CFM Olympic Brainz Monitor.” [Online]. Available: [Accessed: 17-Jul-2020]. [5] M. L. Scheuer, S. B. Wilson, A. Antony, G. Ghearing, A. Urban, and A. I. Bagic, “Seizure Detection: Interreader Agreement and Detection Algorithm Assessments Using a Large Dataset,” J. Clin. Neurophysiol., 2020. [6] A. Harati, M. Golmohammadi, S. Lopez, I. Obeid, and J. Picone, “Improved EEG Event Classification Using Differential Energy,” in Proceedings of the IEEE Signal Processing in Medicine and Biology Symposium, 2015, pp. 1–4. [7] V. Shah, C. Campbell, I. Obeid, and J. Picone, “Improved Spatio-Temporal Modeling in Automated Seizure Detection using Channel-Dependent Posteriors,” Neurocomputing, 2021. [8] W. Tatum, A. Husain, S. Benbadis, and P. Kaplan, Handbook of EEG Interpretation. New York City, New York, USA: Demos Medical Publishing, 2007. [9] D. P. Bovet and C. Marco, Understanding the Linux Kernel, 3rd ed. O’Reilly Media, Inc., 2005. [10] V. Shah et al., “The Temple University Hospital Seizure Detection Corpus,” Front. Neuroinform., vol. 12, pp. 1–6, 2018. [11] F. Pedregosa et al., “Scikit-learn: Machine Learning in Python,” J. Mach. Learn. Res., vol. 12, pp. 2825–2830, 2011. [12] J. Gotman, D. Flanagan, J. Zhang, and B. Rosenblatt, “Automatic seizure detection in the newborn: Methods and initial evaluation,” Electroencephalogr. Clin. Neurophysiol., vol. 103, no. 3, pp. 356–362, 1997. 
    more » « less
  3. Abstract. Plume-SPH provides the first particle-based simulation ofvolcanic plumes. Smoothed particle hydrodynamics (SPH) has several advantagesover currently used mesh-based methods in modeling of multiphase freeboundary flows like volcanic plumes. This tool will provide more accurateeruption source terms to users of volcanic ash transport anddispersion models (VATDs), greatly improving volcanic ash forecasts. The accuracy ofthese terms is crucial for forecasts from VATDs, and the 3-D SPH modelpresented here will provide better numerical accuracy. As an initial effortto exploit the feasibility and advantages of SPH in volcanic plume modeling,we adopt a relatively simple physics model (3-D dusty-gas dynamic modelassuming well-mixed eruption material, dynamic equilibrium and thermodynamicequilibrium between erupted material and air that entrained into the plume,and minimal effect of winds) targeted at capturing the salient features of avolcanic plume. The documented open-source code is easily obtained andextended to incorporate other models of physics of interest to the largecommunity of researchers investigating multiphase free boundary flows ofvolcanic or other origins.

    The Plume-SPH code ( also incorporates several newly developed techniques inSPH needed to address numerical challenges in simulating multiphasecompressible turbulent flow. The code should thus be also of general interestto the much larger community of researchers using and developing SPH-basedtools. In particular, the SPHε turbulence model is used to capturemixing at unresolved scales. Heat exchange due to turbulence is calculated bya Reynolds analogy, and a corrected SPH is used to handle tensile instabilityand deficiency of particle distribution near the boundaries. We alsodeveloped methodology to impose velocity inlet and pressure outlet boundaryconditions, both of which are scarce in traditional implementations of SPH.

    The core solver of our model is parallelized with the message passinginterface (MPI) obtaining good weak and strong scalability using novel techniquesfor data management using space-filling curves (SFCs), object creationtime-based indexing and hash-table-based storage schemes. These techniques areof interest to researchers engaged in developing particles in cell-typemethods. The code is first verified by 1-D shock tube tests, then bycomparing velocity and concentration distribution along the central axis andon the transverse cross with experimental results of JPUE (jet or plume thatis ejected from a nozzle into a uniform environment). Profiles of severalintegrated variables are compared with those calculated by existing 3-D plumemodels for an eruption with the same mass eruption rate (MER) estimated forthe Mt. Pinatubo eruption of 15 June 1991. Our results are consistent withexisting 3-D plume models. Analysis of the plume evolution processdemonstrates that this model is able to reproduce the physics of plumedevelopment.

    more » « less
  4. The granitic water-saturated solidus (G-WSS) is the lower temperature limit of magmatic mineral crystallization. The accepted water-saturated solidus for granitic compositions was largely determined >60 years ago1. More recent advances in experimental petrology, improved analytical techniques, and recent observations that granitic systems can remain active or spend a significant proportion of their lives at conditions below the traditional G-WSS2–5 necessitate a careful experimental investigation of the near-solidus regions of granitic systems. Natural and synthetic starting materials were melted at 10 kbar and 900°C with 48 wt% H2O to produce hydrous glasses for subsequent experiments at lower PT conditions used to locate the G-WSS. We performed crystallization experiments and melting experiments at temperatures ranging from 575 to 800°C and 1, 6, 8, and 10 kbar on 12 granitoid compositions. First, we ran a series of isothermal crystallization experiments along each isobar at progressively lower temperatures until runs completely crystallized to identify apparent solidus temperatures. Geochemical analyses of quenched glass compositions demonstrate that progressive crystallization drives all starting compositions towards silica-rich, water-saturated rhyolitic/granitic melts (e.g., ~7578 wt% SiO2). After identifying the apparent solidus temperatures at which the various compositions crystallized, we then ran series of reversal-type melting experiments. With the goal of producing rocks with hydrous equilibrium microstructures, we crystallized compositions at temperatures ~10°C below the apparent solidus identified in crystallization experiments, and then heated isobarically to conditions that produced ~20% melt during the crystallization experiments. Importantly, crystallization experiments and heating experiments at the same PT conditions produced similar proportions of melt, crystals, and vapor. A time-series of experiments 230 days at PT conditions previously identified to produce ~10% to 20% melt did not reveal any kinetic effects on melt crystallization. Experiments at 6 to 10 kbar crystallized/melted at temperatures close to the published G-WSS. However, at lower pressures where the published G-WSS is strongly curved in PT space, all compositions investigated contained melt to temperatures ~75 to 100°C below the accepted G-WSS. The similarity of crystallization temperatures for the higher-pressure experiments to previously published results, similar phase proportions in melting and crystallization experiments, and the lack of kinetic effects on crystallization collectively suggest that our lower pressure constraints on the G-WSS are accurate. The new experimental results demonstrating that the lower-pressure G-WSS is significantly lower than unanimously accepted estimates will help us to better understand the storage conditions, evolution, and potential for eruption in mid- to upper-crustal silicic magmatic systems. (1) Tuttle, O.; Bowen, N. Origin of Granite in the Light of Experimental Studies in the System NaAlSi3O8–KAlSi3O8–SiO2–H2O; Geological Society of America Memoirs; Geological Society of America, 1958; Vol. 74. (2) Rubin, A. E.; Cooper, K. M.; Till, C. B.; Kent, A. J. R.; Costa, F.; Bose, M.; Gravley, D.; Deering, C.; Cole, J. Rapid Cooling and Cold Storage in a Silicic Magma Reservoir Recorded in Individual Crystals. Science 2017, 356 (6343), 1154–1156. (3) Andersen, N. L.; Jicha, B. R.; Singer, B. S.; Hildreth, W. Incremental Heating of Bishop Tuff Sanidine Reveals Preeruptive Radiogenic Ar and Rapid Remobilization from Cold Storage. Proceedings of the National Academy of Sciences 2017, 114 (47), 12407–12412. (4) Ackerson, M. R.; Mysen, B. O.; Tailby, N. D.; Watson, E. B. Low-Temperature Crystallization of Granites and the Implications for Crustal Magmatism. Nature 2018, 559 (7712), 94–97. (5) Glazner, A. F.; Bartley, J. M.; Coleman, D. S.; Lindgren, K. Aplite Diking and Infiltration: A Differentiation Mechanism Restricted to Plutonic Rocks. Contributions to Mineralogy and Petrology 2020, 175 (4). 
    more » « less
  5. The MELNHE study looks at patterns of resource limitation through nutrient manipulations in three study sites in New Hampshire: Bartlett Experimental Forest, Hubbard Brook Experimental Forest, and Jeffers Brook, located in the White Mountain National Forest. The investigation is monitoring stem diameter, leaf area, sap flow, foliar chemistry, leaf litter production and chemistry, foliar nutrient resorption, root biomass and production, mycorrhizal associations, soil respiration, heterotrophic respiration, N and P availability, N mineralization, soil phosphatase activity, soil carbon and nitrogen, nutrient uptake capacity of roots, and mineral weathering. This data set includes phosphate, nitrate and ammonium availability measured using resin exchange strips. Additional detail on the MELNHE project, including a datatable of site descriptions and a pdf file with the project description and diagram of plot configuration can be found in this data package: These data were gathered as part of the Hubbard Brook Ecosystem Study (HBES). The HBES is a collaborative effort at the Hubbard Brook Experimental Forest, which is operated and maintained by the USDA Forest Service, Northern Research Station. The following papers describe and make use of these data: Fisk MC, Ratliff TJ, Goswami S, Yanai RD. 2014. Synergistic soil response to nitrogen plus phosphorus fertilization in hardwood forests. Biogeochemistry 118:195-204. Goswami S, Fisk MC, Vadeboncoeur MA, Johnston M, Yanai RD, and Fahey TJ. 2018. Phosphorus limitation of aboveground production in northern hardwood forests. Ecology 99: 438-449. Shan S, Fisk MC, Fahey TJ. 2018. Contrasting effects of N on rhizosphere processes in two northern hardwood species. Soil Biology and Biochemistry 126: 219-227. Shan S, Devens H, Fahey TJ, Yanai RD, Fisk MC. 2022. Fine root growth increases in response to nitrogen addition in phosphorus-limited northern hardwood forests. Ecosystems, Gonzales KE, Yanai RD, Fahey TJ, Fisk MC. 2023. Evidence for P limitation in eight northern hardwood stands: Foliar concentrations and resorption by three tree species in a factorial N by P addition experiment. Forest Ecology and Management 529: 120696. Li S, Fisk MC, Yanai RD, Fahey TJ. 2023. Co-limitation of root growth by nitrogen and phosphorus in early successional northern hardwood forest. Ecosystems. https://10.1007/s10021-023-00869-7 
    more » « less