Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: dJlars
  • Language: Python
  • Default Branch: main
  • Size: 1.83 MB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 3
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme Citation

README.md

DOI

Fourier generalized Polynomial Chaos Framework

This repository contains a framework for the Fourier generalized Polynomial Chaos (FgPC) method. The method combines the harmonic balance and the generalized Polynomial Chaos expansion to quantify uncertainties in limit cycle oscillations.

The FgPC coefficients of the used system are calculated, followed by a comparison of the FgPC with a Monte Carlo method. Moreover, a deflation technique may be employed to identify multiple solutions for the FgPC coefficients. Furthermore, a convergence study may be conducted.

The framework is applied to the Duffing oscillator as a benchmark example and to the model of the electrical system of the $\beta$ cell.

The relevant parameters are the harmonics $H$, the polynomial degree $N$ and the distribution of the uncertain parameter.

Further details are given in the publication [tbd].

Folder Structure

The initial four folders are dedicated for data management. - In the folder labeled 0_solutionData, the coefficients that were identified are stored according to the labeling convention for the system, H, N and distribution. The solutions utilized in the aforementioned publication can be found here. - 1_allSolData contains data with all solutions for all possible H and N. - 2_calculatedData contains data calculated during the execution of the program. - 3_results contains the plot results.

The FgPC folder contains classes that belong to the general FgPC framework.

The last two folders contain problem specific classes and functions.

Getting Started

All necessary packages are included in the requirements.txt file. It is advised that a virtual environment be installed using the pip package manager, and that the requisite packages be installed subsequently.

It is crucial to ensure that the modules fgPC, duffingFgPC and cellBiologyFgPC are installed. In the event that this is not the case, navigate to the directions FgPC, duffingFgPC and cellBiologyFgPC and run pip install -e ..

Inside the system folder (e.g. cellBiologyFgPC) there are two .yaml files with the settings for the system parameters.

Both main files contain similar steps for each system. Some parameters can be set in the settings sections to select certain calculations.

Basic Program Structure

The main file is structured in five sections: - Setup - FgPC - Sampling - Convergence - Plotting

Setup

In this section all essential parameters are configured to regulate the algorithm's behavior, e.g. including the initiation of a convergence study. In addition, two .yaml files are read, which contain all information pertinent to the system. For parameters that require specific attention, please refer to the .yaml files of the provided examples.

FgPC

Initially, an FgPC object is constructed. The method calFgPCSolution is responsible for calculating the FgPC coefficients. The initial guess is obtained by employing solve_ivp from the scipy library to calculate the stationary orbit and subsequently performing an FFT. The nonlinear system of equations is solved using the hybr method of scipy in order to obtain the FgPC coefficients.

Sampling

To demonstrate the precision of the FgPC, a Monte Carlo (MC) sampling is conducted. Initialization of the sampling model is the first step, as this controls all sampling and stochastic calculations. The samplingOfModels method returns two lists comprising Fourier coefficients. One list contains the MC sampling, and the other contains the FgPC sampling. The getStochastics method employs both lists to calculate the mean value over a single oscillation period and a 95 % sampling interval. Within this interval, 95 % of all samples are included. The difference between the FgPC and MC over one period is determined as well. Furthermore, the complex marginal distribution for given time points is calculated.

Convergence

As the relative root mean square error, which is related to the combination H and N, necessitates all combinations smaller than H and N, any missing solutions of the H and N combination are calculated by the method calFgPCSolutionMatrix. Subsequently, for each combination, the relative error for each variable is calculated and for the total error summed up by the method calcConvergenceMap.

Plotting

The results of the FgPC method are presented in the following plots. The convergence map and the magnitude of the FgPC coefficients are generated by the methods plotTotalConvergenceMap and plotCoeffMap, respectively. The method plottingResults plots the position and, if selected, velocity of each system variable with the FgPC solution, the difference between the FgPC and Monte Carlo solutions, and the marginal distribution of the FgPC solution at the given time points. The phase plot of the selected two variables is generated by the method getPhasePlots.

Building Your Own FgPC System

Both examples can be used as templates, depending on the problem at hand. If it is self-excited, then the cell biology problem is appropriate. If it is externally excited, then the Duffing example is the better choice. Mostly problem related functions like calculateElectricResiduum in the cell biology example have to be replaced.

Owner

  • Name: lars
  • Login: dJlars
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "de Jong"
  given-names: "Lars"
  orcid: "https://orcid.org/0009-0000-3232-7145"
title: "FgPC Framework"
version: 0.1
doi: 10.5281/zenodo.13359870
date-released: 2024-08-22
url: "https://doi.org/10.5281/zenodo.13359870"

GitHub Events

Total
  • Release event: 1
  • Watch event: 2
  • Push event: 1
  • Create event: 1
Last Year
  • Release event: 1
  • Watch event: 2
  • Push event: 1
  • Create event: 1