Skip to main content

Stretched Exponential decay function curve fitting with GNUPLOT

Following is the GNUPLOT script to plot the data and to perform the Stretched exponential decay curve fitting with time-series data.

The stretched exponential function
also called the Kohlrausch–Williams–Watts (KWW) function.


gnuplot << EOF
reset
set terminal pngcairo  background "#ffffff" enhanced font "Times-New-Roman-Bold,10" fontscale 1.0 size 500, 500
set key on b c inside horizontal
set output 'Data.png'
set title "Stretched exponential curve"
set xlabel "Time" rotate parallel
set ylabel "AU" rotate parallel
set style line 1  lt 1 dt 1 pi 0 ps 1 # lt = color; pt = point type; dt = dash type; ps = size 
set style line 2  lt 2 dt 1 pi 0 ps 1

g(x) =  a * exp(-(x/t)**b)
fit g(x) "data.xvg" u (column(1)):(column(2)) via a,t,b
set xtic

set label 1 sprintf("g(x) =%3.7f * exp(-(x/%3.7f)**(%3.7f))",a,t,b) at graph 0.10,0.95 font "arialbd,8"
chi2=(FIT_STDFIT*FIT_STDFIT)
set label 2 sprintf("{/Symbol c}^2 = %.7f", chi2)  at graph 0.65,0.63 font "arialbd,8" @chi2
set table "FexpDecayFit-stretched.dat"
p g(x), "data.xvg" u (column(1)):
(column(2))
unset table
p g(x) ls 2 t "
Stretched ex-fit", "data.xvg" u (column(1)):(column(2)) w l ls 1 lw 3 t "Data"
EOF

Comments

Most Viewed Post

How to keep chain ID / IDs in GROMACS?

In GROMACS , while converting pdb file (monomer or multimer) into .gro file, it do not preserve the chain ID information. Due to the lack of chain ID information, pdb file retrieved from .gro file at any stage of the simulation has missing chain IDs and pdb file can not be visualized properly in PYMOL / RASMOL . There are two ways to convert .gro file into .pdb Lets say your protein name is xyz.pdb 1] gmx editconf -f xyz.gro -o xyz.pdb 2] gmx trjconv -f  xyz.gro -o xyz.pdb -s xyz.tpr Only ' trjconv ' will retrieve the chain ID information for all the chains. and not ' editconf '. If you have monomer protein and wish to assign any chain ID then following command will be of your interest: gmx editconf -f xyz.gro -o xyz.pdb -label [ chain-ID ]

GNUPLOT: How to draw trend line?

How to draw trend line in the GNUPLOT? If you like to plot graphs in gnuplot and dont know how to plot trendline then here you are. Follow the steps mentioned below... 1. You should have a files with X and Y values 2. Open GNUPLOT (Operating system dosen't change anything here. It works on all systems) 3. Type the command in the gnuplot terminal Lets say I have a file for eg. '1.txt' p '1.txt' u 1:2 w d title '', '1.txt' u 1:2 smooth acsplines title '1.txt' OR p '1.txt' u 1:2 w d title '', '1.txt' u 1:2 smooth bezier title '1.txt' It will plot as below...

MD convert (xtc to dcd)

CATDCD program can be used to convert one file format to another file format. For example: How to convert trajectory output of GROMACS .xtc format into NAMD .dcd format ==== /path/to/catdcd -o /path/to/save/file/abc.dcd -xtc /input/path/to/save/file/abc.xtc ==== How to install CATDCD? Follow the link-   https://www.ks.uiuc.edu/Development/MDTools/catdcd/ Download the catdcd-X.Xx.tar.gz Extract all files from the tar. Locate the catdcd file. It should be in directory :  catdcd-4.0b/LINUXAMD64/bin/catdcd4.0/ Source the catdcd in your bashrc: export PATH="/path/to/catdcd/directory/:$PATH"

Python : Turtle tree

Turtle module can be used to draw some very nice patterns in Python. Following are some examples with code. ==================== import turtle import random t = turtle.Turtle( shape = "circle" ) t.lt( 90 ) lv = 14 l = 120 s = 30 t.color( 'indigo' ) t.width(lv) t.penup() t.bk(l) t.pendown() t.fd(l) def draw_tree ( l , level ): width = t.width() # save the current pen width t.width(width * 3.0 / 4.0 ) # narrow the pen width l = 3.0 / 4.0 * l #t.color(R,G,B) #provide the RGB numbers t.color(random.random(), random.random(), random.random()) t.lt(s) t.fd(l) if level < lv: draw_tree(l, level + 1 ) t.color(random.random(), random.random(), random.random()) t.bk(l) t.rt( 2 * s) t.fd(l) if level < lv: draw_tree(l, level + 1 ) t.color(random.random(), random.random(), random.random()) t.bk(l) t.lt(s) t.width(width) # restore the previous pen width t.speed( "fastest" ) draw_tree(l, 5 ) turtle.done() ===========

USA COVID Tracking state-level COVID-19 case testing data

 

Science News

Enter your email address:

PhD Vacancy Bioinformatics

PhD Vacancy Chemoinformatics