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

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(). Running it will import example measurements, build an example setup and execute the algorithm.
After about 20 steps it should give a solution near by (rounded):

  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 diffusion function and its inital parameters. Then fit() uses your setup to fit the Fokker-Planck evolution to your measurements as an optimization problem. The example fit and used example functions should give a good understanding how the software is used. Please also read about sympy symbolic functions if not familiar.

Data processing

The functions described above assume baseline corrected data, so raw measurements must be processed. The modules CP, baseline can do that for you.
The processing consists of two parts: (1) calculating heat capacities, (2) detecting a baseline and subtracting it.
Both of it is done by addCP() plus some previous data preparation. As there is no code example, we 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 extrapolate your data.

If you want to skip part (1) or (2), check for CP_DIN11357(), getBaseline(), subtractBaseline() or the source code of addCP().

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 solve_ivp with BDF method as a default. That 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 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.tar.gz (681.3 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-py3-none-any.whl (178.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fpex0-0.9.tar.gz
  • Upload date:
  • Size: 681.3 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.tar.gz
Algorithm Hash digest
SHA256 07d5dff729daf6484d75592c5d155c7bbcd2c03f1daa304f022307c04df45c51
MD5 56bef49220a958090df2b08f7c62706b
BLAKE2b-256 4511cf2b99c956c9059b06b161a447c288c844a5fd6f5f1417bc203cb99f6dcb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fpex0-0.9-py3-none-any.whl
  • Upload date:
  • Size: 178.2 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-py3-none-any.whl
Algorithm Hash digest
SHA256 75a4c4f98b17a10f1a431c3399d609c492b70ae538f86ce9a0d90215c06e531d
MD5 db739c6ec59f1a30c6b402400e185a40
BLAKE2b-256 9d735a1819d3b1654cc9e92018848e0e30e434144b53359d5c4b4db2d8310d30

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