Skip to main content

This package is an implementation of the FPEX0 algorithm, a data-driven de-smearing method for DSC signals.

Project description

FPEX0 Python

Authors: Michael Strik and Andreas Sommer at the Interdisciplinary Center for Scientific Computing (IWR), University of Heidelberg.

This package gives a Python implementation of the FPEX0 method
for data-driven de-smearing of DSC signals presented in the paper

Sommer, Andreas; Hohenauer, Wolfgang; Barz, Tilman:
Data-driven de-smearing of DSC signals.
J Therm Anal Calorim (2022).
https://doi.org/10.1007/s10973-022-11258-y

A Matlab version of FPEX0 is available at https://github.com/andreassommer/fpex0

Installing the package

The fpex0 package can be installed via pip:

pip install fpex0

Running an example

The software comes with an example implemented in fpex0.example.exampleFit(), that can be run by:

import fpex0
fpex0.example.exampleFit()

It will import measurements, build a setup and execute the algorithm.
After about 20 steps it should give a solution near by:

  p = [-0.9555,  0.03284, 0.2862, 3.4171, 2.5246, 43.0456, 131.8116, 3.5925, 0.1893]

Extrapolating your own data

The heart of the package are the function fpex0.fit() and the class fpex0.Setup. Setup holds your measurements and all problem-related configurations, e.g. your initial distribution and its inital parameters. Then fit() uses your setup to fit the Fokker-Planck evolution to the measurements as an optimization problem.
Reading the source code of exampleFit() and exampleSetup() should give a good understanding how the software can be used. We also recommend reading about sympy symbolic functions if not familiar.

Data processing

The functions described above assume baseline corrected data, so raw measurements must be processed. The submodules CP, baseline can do that for you.
Processing consists of two parts:

  • calculating heat capacities,
  • detecting a baseline and subtracting it.

Both of it is done by addCP(), it will also do some previous data preparation.
As there is no code example, we will explain its usage:

  1. Create a DSC_Data object and load measurements
dsc_data = DSC_Data()
dsc_data.T = T
dsc_data.dsc = dsc
dsc_data.rate = rate
  1. Process
dsc_data = addCP(dsc_data)
  1. Create fpex0 setup and import your data
FPEX0setup = Setup(gridObj, parametersObj, integrationObj, FPdriftFcn, FPdiffusionFcn, IniDistFcn)
FPEX0setup.importDSCobj(dsc_data)

Now you can modify the setup and finally extrapolate your data via

fit = fpex0.fit(FPEX0setup)

Note that both addCP() and importDSCobj() can also take lists of DSC_Data objects:

dsc_data = addCP([dsc_data1, dsc_data2, dsc_data3])
# now dsc_data holds a list
FPEX0setup.importDSCobj(dsc_data)

If you want to skip one of the steps, check for

  • CP_DIN11357() and CP_sapphire_DIN11357() (heat capacities),
  • subtractBaseline() and getBaseline() (baseline).

These sets of functions can execute the raw single steps.

About the implementation

This is a Python version of Andreas Sommer's matlab implementation, which can be found at https://github.com/andreassommer/fpex0.

The Fokker-Planck equation is solved as an ODE via method of lines, using scipy's solve_ivp with BDF method as a default. This is basically a python version of matlab ode15s.
The initial distribution, drift and diffusion are then fitted to the measurement data via an optimizer, by default scipy's least_squares (which is also currently the only option).
Other optimizers and integrators can be implemented by the user, if compatible to the interplay of fpex0.fit(), residual() and simulate(). However, the software is designed around the method of lines, so using another method to solve Fokker-Planck will require significant adjustments.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fpex0-0.9.1.tar.gz (699.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fpex0-0.9.1-py3-none-any.whl (178.5 kB view details)

Uploaded Python 3

File details

Details for the file fpex0-0.9.1.tar.gz.

File metadata

  • Download URL: fpex0-0.9.1.tar.gz
  • Upload date:
  • Size: 699.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for fpex0-0.9.1.tar.gz
Algorithm Hash digest
SHA256 e71e738baefba007d9d803cc22c22da413ed1064beeeefab9303442849628446
MD5 3099d5ee29422ff0735b4f164f5ee971
BLAKE2b-256 c72fe65e333b211d2f25ef422f0e4ec25babf343fb3f6af9a46fea1296c37fee

See more details on using hashes here.

File details

Details for the file fpex0-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: fpex0-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 178.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for fpex0-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53841d92b98a31f9a9dbf7033fd34488a8ee1f2430cbe3c8a99c1f67d20520eb
MD5 3ac16560cab09707cda2c2e3211384fd
BLAKE2b-256 a2ea167dc68ef7b4287bda6e4d3454e9ff4046fd8e69cb9e5a90687c8b8ce589

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page