Skip to content
Tool for calculation of relaxation kinetics
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
relax.py

README.md

Relax

Summary:

A small tool for calculating non-linear relaxation fits from arbitrary time-resolved experiments

Authors:

Ben Barad

Available Relaxation Kinetics Functions:

  • Single Step Relaxation: y = A*(1-e-Bx)+C
  • Two Step Relaxation: y = A*(1-e-Bx)+C*(1-e-Dx)+E
  • Three Step Relaxation: y = A*(1-e-Bx) + C*(1-e-Dx) + E*(1-e-Fx) + G

Example Usage:

import numpy as np
from relax import relaxation_fit, single_step_relaxation

x = [1,2,5,10,15,25,35,60,90, 200, 500, 1000, 10000, 1000000, 10000000000]
y = [25*(1-np.exp(-5*i))+2 for i in x]

parameters, covariances, y_calc = relaxation_fit(x, y, relaxation_function = single_step_relaxation, initial_guess=[18, 11, 10])

print(parameters) 
# Ideally this should converge to 25., 5., 2. for this example - more data points will improve convergence.

Requirements:

  • Python >= 3.6
  • Numpy
  • Scipy
You can’t perform that action at this time.