Skip to content

Commit

Permalink
peak plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Kohlbrecher committed May 7, 2016
1 parent dbe0067 commit aebb470
Show file tree
Hide file tree
Showing 24 changed files with 939 additions and 70 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,6 @@
0.94.8 2016-MM-DD
- reading ascii data from ALV-5000 for DLS-analysis

0.94.7 2016-04-25 0.94.7 2016-04-25
- implementation of another cumulant formula for DLS - implementation of another cumulant formula for DLS
- Bug-fix in the unit conversion routine - Bug-fix in the unit conversion routine
Expand Down
11 changes: 7 additions & 4 deletions Readme_source.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ sasfit-core (core functionality of the sasfit program,
not complete, in progress) not complete, in progress)


Requirements: Requirements:
- Cmake >=2.8.0 (http://www.gnu.org/software/gsl/) - Cmake >=3.5.0 (http://www.gnu.org/software/gsl/)
- GSL library (http://www.gnu.org/software/gsl/) - C and C++ compiler (e.g. gcc)
(for Windows: http://gnuwin32.sourceforge.net/packages/gsl.htm) - standard compression software like bzip2, zip, tar, gz
- Tcl >=8.4 for sasfit-core




Author Information: Author Information:
Expand All @@ -43,6 +42,10 @@ For license information see COPYING.txt.
Documentation Documentation
============= =============


A paper about SASfit has been published in
J. Appl. Cryst. (2015). 48, 1587-1598
doi:10.1107/S1600576715016544

Documentation is provided in HTML format in the directory Documentation is provided in HTML format in the directory
<your-sasfit-source-directory>/doc/html/ <your-sasfit-source-directory>/doc/html/


Expand Down
4 changes: 2 additions & 2 deletions doc/manual/SASfit_ch2_polymers_micelles.tex
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ \subsection{Star polymer with Gaussian statistic according to


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\subsection{Polydisperse star polymer with Gaussian statistics \cite{burchard74}} \subsection{Polydisperse star polymer with Gaussian statistics \cite{Burchard74}}
\label{sect:PolydisperseStar} \label{sect:PolydisperseStar}
~\\ ~\\
\begin{figure}[htb] \begin{figure}[htb]
Expand All @@ -375,7 +375,7 @@ \subsection{Polydisperse star polymer with Gaussian statistics \cite{burchard74}
\end{figure} \end{figure}


For a Schulz–Flory (most probable) distribution (Schulz–Zimm distribution For a Schulz–Flory (most probable) distribution (Schulz–Zimm distribution
with $z = 1$) for the mass distribution of the arms, Burchard \cite{burchard74} has given the form factor: with $z = 1$) for the mass distribution of the arms, Burchard \cite{Burchard74} has given the form factor:
\begin{align} \begin{align}
I_\text{PolydisperseStar}(Q) &= I_0 I_\text{PolydisperseStar}(Q) &= I_0
\frac{1+\frac{u^2}{3 f}}{\left(1+\frac{u^2(f +1)}{6 f }\right)^2} \frac{1+\frac{u^2}{3 f}}{\left(1+\frac{u^2(f +1)}{6 f }\right)^2}
Expand Down
37 changes: 29 additions & 8 deletions doc/manual/SASfit_ch4.tex
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ \section{Log-Normal distribution}


\clearpage \clearpage
\section{Schulz-Zimm (Flory) distribution} \section{Schulz-Zimm (Flory) distribution}
\label{sec:SchulzZimm}


\begin{figure}[htb] \begin{figure}[htb]
\begin{center} \begin{center}
Expand Down Expand Up @@ -207,6 +208,7 @@ \section{Gamma distribution}
When $k$ is large, the gamma distribution closely approximates a normal distribution When $k$ is large, the gamma distribution closely approximates a normal distribution
with the advantage that the gamma distribution has density only for positive real with the advantage that the gamma distribution has density only for positive real
numbers. For small values of $k$ the distribution becomes a right tailed distribution. numbers. For small values of $k$ the distribution becomes a right tailed distribution.
The gamm distribution is equivalent to the Schulz-Zimm distribution (sec.\ \ref{sec:SchulzZimm}), which is using the mean value instead of $\theta=x_\mathrm{mean}/k$ for the parametrization. Also the Pearson III \ref{sec:PearsonIIIdist} is just another name for this distribution.


The $m^\text{th}$ moment $\langle X^m\rangle$ of the size distribution is given by The $m^\text{th}$ moment $\langle X^m\rangle$ of the size distribution is given by
\begin{align} \begin{align}
Expand Down Expand Up @@ -256,6 +258,7 @@ \section{Gamma distribution}


\clearpage \clearpage
\section{PearsonIII distribution} \section{PearsonIII distribution}
\label{sec:PearsonIIIdist}


The Pearson distribution is a family of probability distributions The Pearson distribution is a family of probability distributions
that are a generalisation of the normal distribution. The Pearson that are a generalisation of the normal distribution. The Pearson
Expand Down Expand Up @@ -317,23 +320,40 @@ \section{Gauss distribution}
\text{erf}\left(\frac{R_0}{\sqrt{2}\sigma}\right) \right) \text{erf}\left(\frac{R_0}{\sqrt{2}\sigma}\right) \right)
\end{align} \end{align}
\end{subequations} \end{subequations}
$c_\text{Gauss}$ is choosen so that $\int_0^\infty\! $c_\text{Gauss}$ is chosen so that $\int_0^\infty\!
\text{Gauss}(R,\sigma,R_0)\,dR = N$ \text{Gauss}(R,\sigma,R_0)\,dR = N$


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\clearpage \clearpage
\section{Generalized exponential distribution (GEX)} \section{Generalized exponential distribution (GEX)}


\begin{subequations} The generalised exponential distribution is a three parameter distribution.
\begin{align} \begin{align}
\text{GEX}(R,\beta,\lambda,\gamma))&= N \text{GEX} (x,\beta,\lambda,\gamma) &= N \frac{\abs{\beta}}{\gamma} \left(\frac{x}{\gamma}\right)^{\lambda+1}
\frac{\beta}{\gamma}\left(\frac{x}{\gamma}\right)^{\lambda+1} \frac{e^{-(x/\gamma)^\beta}}{\Gamma\left( \frac{\lambda+2}{\beta} \right)} \\
\frac{e^{-(x/\gamma)^{\beta}}}{\Gamma \left( {\frac \text{GEX}(x,\beta,p,\gamma) &= N
{\lambda+2}{\beta}} \right)} \frac{\abs{\beta}}{\gamma}\left(\frac{x}{\gamma}\right)^{p-1}
\frac{e^{-(x/\gamma)^{\beta}}}{\Gamma \left( {\frac{p}{\beta}} \right)}
\end{align}
For $\lambda+2=p=\beta$ it will transform in the Weibull distribution (eq.\ \ref{eq:Weibull}). For $\beta=1$ one yields the Schulz-Zimm distribution (eq.\ \ref{eq:SZn(M)}) or the equivalent gamma distribution (eq.\ \ref{eq:GammaDistr}). In The limit $\beta \rightarrow 0$ the GEX distribution transforms into a Lognormal distribution.
The mode $x_\mathrm{mode}$, mean $x_\mathrm{mean}$, and variance $\sigma^2$ of this distribution are given by
\begin{align}
x_\mathrm{mode} &= \gamma \left( \frac{\lambda+1}{\beta}\right)^\frac{1}{\beta} \\
x_\mathrm{mean} &=
\begin{cases}
\gamma \Gamma\left(\frac{\lambda+3}{\beta}\right)/\Gamma\left(\frac{\lambda+2}{\beta}\right) & \mbox{for } \beta > 0 \wedge \lambda > -3 \\
\mbox{undefined} & \mbox{otherwise}
\end{cases} \\
\sigma^2 &=
\begin{cases}
\gamma^2 \left(
\frac{\Gamma\left(\frac{\lambda+4}{\beta}\right)}{\Gamma\left(\frac{\lambda+2}{\beta}\right)} -
\left(\frac{\Gamma\left(\frac{\lambda+3}{\beta}\right)}{\Gamma\left(\frac{\lambda+2}{\beta}\right)}\right)^2
\right)& \mbox{for } \beta > 0 \wedge \lambda > -3 \\
\mbox{undefined} & \mbox{otherwise}
\end{cases}
\end{align} \end{align}
\end{subequations}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\clearpage \clearpage
Expand Down Expand Up @@ -458,6 +478,7 @@ \section{Weibull distribution}
\label{fig:Weibull} \label{fig:Weibull}
\end{figure} \end{figure}
\begin{align} \begin{align}
\label{eq:Weibull}
\text{Weibull}(R,\alpha,\lambda,\mu) = \text{Weibull}(R,\alpha,\lambda,\mu) =
\frac{N \lambda}{\alpha} \frac{N \lambda}{\alpha}
\left(\frac{R-\mu}{\alpha}\right)^{\lambda-1} \left(\frac{R-\mu}{\alpha}\right)^{\lambda-1}
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/SASfit_history.tex
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
\item a first version of a plugin for ordered mesoscopic and nano structures. \item a first version of a plugin for ordered mesoscopic and nano structures.
The plugin is providing a part of the structure factors available The plugin is providing a part of the structure factors available
in the software package "scatter" from S. Förster. in the software package "scatter" from S. Förster.
\item plugin of a radial profile for a sphere resulting in a Porod law both below and above Q^-4 \item plugin of a radial profile for a sphere resulting in a Porod law both below and above $Q^{-4}$ (\texttt{Boucher Sphere})
\end{itemize} \end{itemize}
\item[2014-12-14] \SASfit 0.94.6 \item[2014-12-14] \SASfit 0.94.6
\begin{itemize} \begin{itemize}
Expand Down
7 changes: 3 additions & 4 deletions doc/manual/SASfit_pluginsFF_spheres_shells.tex
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -764,8 +764,7 @@ \subsection{BoucherSphere, radial profile for a sphere resulting in a Porod law
\end{align} \end{align}
By this normalisation the excess scattering length is for all $\alpha$ equal to the one of a homogeneous sphere with a scattering contrast $\Delta\eta$, i.e. $\beta_\mathrm{sp}=\Delta\eta \frac{4}{3}\pi R^3$. By this normalisation the excess scattering length is for all $\alpha$ equal to the one of a homogeneous sphere with a scattering contrast $\Delta\eta$, i.e. $\beta_\mathrm{sp}=\Delta\eta \frac{4}{3}\pi R^3$.


To get feeling which part of the spherical contributes most to the scattering ones can define To get a feeling which part of the spherical scattering length density profile contributes most to the scattering it is convenient to define a fractional relative excess scattering length according to \cite{Boucher1983} which reads as
a fractional relative excess scattering length according to \cite{Boucher1983} which reads as
\begin{align} \begin{align}
Z(x) = & \frac{ Z(x) = & \frac{
\int_{0}^{x}\! \left( 1-{\frac {{r}^{2}}{{R}^{2}}} \right) ^{\frac{\alpha}{2}-2} 4\pi\,{r}^{2}\,{\rm d}r \int_{0}^{x}\! \left( 1-{\frac {{r}^{2}}{{R}^{2}}} \right) ^{\frac{\alpha}{2}-2} 4\pi\,{r}^{2}\,{\rm d}r
Expand Down Expand Up @@ -798,7 +797,7 @@ \subsection{BoucherSphere, radial profile for a sphere resulting in a Porod law
&= \beta \left(\frac{2}{QR}\right)^{\frac{\alpha-1}{2}} J_{\frac{\alpha-1}{2}}(QR) \, \Gamma\left(\frac{\alpha+1}{2}\right) \nonumber \\ &= \beta \left(\frac{2}{QR}\right)^{\frac{\alpha-1}{2}} J_{\frac{\alpha-1}{2}}(QR) \, \Gamma\left(\frac{\alpha+1}{2}\right) \nonumber \\
&= \beta \;_0F_1\left(\frac{\alpha+1}{2};-\tfrac{(QR)^2}{4}\right) &= \beta \;_0F_1\left(\frac{\alpha+1}{2};-\tfrac{(QR)^2}{4}\right)
\end{align} \end{align}
making use of the fact that the bessel function can be expressed in terms of generalised hypergeometric functions $J_\alpha(x)=\frac{(\frac{x}{2})^\alpha}{\Gamma(\alpha+1)} \;_0F_1 (\alpha+1; -\tfrac{x^2}{4})$. The scattering amplitude simplifies in case of $\alpha=4$ exactly the one of a homogenous spherical shell and in case of $\alpha=2$ to an infinitesimal thin spherical shell. For the scattering intensity $I(Q) = F^2(Q)$ we get in the Porod limit $Q\rightarrow\infty$ making use of the fact that the bessel function can be expressed in terms of generalised hypergeometric functions $J_\alpha(x)=\frac{(\frac{x}{2})^\alpha}{\Gamma(\alpha+1)} \;_0F_1 (\alpha+1; -\tfrac{x^2}{4})$. The scattering amplitude simplifies in case of $\alpha=4$ exactly the one of a homogenous sphere and in case of $\alpha=2$ to an infinitesimal thin spherical shell. For the scattering intensity $I(Q) = F^2(Q)$ we get in the Porod limit $Q\rightarrow\infty$
\BE \BE
\lim_{Q\rightarrow\infty} I(Q)= \lim_{Q\rightarrow\infty} F^2(Q) = \lim_{Q\rightarrow\infty} I(Q)= \lim_{Q\rightarrow\infty} F^2(Q) =
\beta^2 \frac{2^{\alpha-1}}{\pi} \Gamma^2\left(\frac{\alpha+1}{2}\right) \frac{1}{(QR)^\alpha} \beta^2 \frac{2^{\alpha-1}}{\pi} \Gamma^2\left(\frac{\alpha+1}{2}\right) \frac{1}{(QR)^\alpha}
Expand All @@ -825,7 +824,7 @@ \subsection{BoucherSphere, radial profile for a sphere resulting in a Porod law
\begin{description} \begin{description}
\item[\texttt{R}] radius $R$ \item[\texttt{R}] radius $R$
\item[\texttt{alpha}] shape parameter of the profile $\alpha$, which is also equal to the potential law at large $Q$-values \item[\texttt{alpha}] shape parameter of the profile $\alpha$, which is also equal to the potential law at large $Q$-values
\item[\texttt{Delta\_eta}] average scattering length density so that the excess scattering length corresponds to that one of a homogeneous sphere with contrast $\Delta\eta$ \item[\texttt{Delta\_eta}] is the average scattering length density so that the excess scattering length corresponds to the one of a homogeneous sphere with contrast $\Delta\eta$
\end{description} \end{description}


\noindent\underline{Note for model \texttt{BoucherSphere2} and \texttt{Boucher profile}:} \noindent\underline{Note for model \texttt{BoucherSphere2} and \texttt{Boucher profile}:}
Expand Down
6 changes: 0 additions & 6 deletions doc/manual/sasfit.bbl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ B~Boucher, P~Chieux, P~Convert, and M~Tournarie.
order in the amorphous metallic alloy tbcu 3.54. order in the amorphous metallic alloy tbcu 3.54.
\newblock {\em Journal of Physics F: Metal Physics}, 13(7):1339, 1983. \newblock {\em Journal of Physics F: Metal Physics}, 13(7):1339, 1983.


\bibitem{burchard74}
W.~Burchard.
\newblock Statistics of star-shaped molecules. i. stars with polydisperse side
chains.
\newblock {\em Macromolecules}, 7:835--841, 1974.

\bibitem{Burchard1996} \bibitem{Burchard1996}
W.~Burchard, E.~Michel, and V.~Trappe. W.~Burchard, E.~Michel, and V.~Trappe.
\newblock Conformational properties of multiply twisted ring systems and \newblock Conformational properties of multiply twisted ring systems and
Expand Down
51 changes: 51 additions & 0 deletions doc/manual/sasfit.bib
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4210,4 +4210,55 @@ @Article{Burchard1974
timestamp = {2016.04.20}, timestamp = {2016.04.20},
} }
@Article{Jakes1991,
author = {Jaromír Jakeš},
title = {A simple method of estimation of the polydispersity index of narrow molecular weight distributions by using quasielastic light scattering data},
year = {1991},
journal = {Collect. Czech. Chem. Commun.},
volume = {56},
issue = {8},
pages = {1642-1652},
doi = {http://dx.doi.org/10.1135/cccc19911642},
owner = {kohlbrecher},
timestamp = {2016.05.06},
}
@Article{Jakes1986,
author = {Jakeš, Jaromir and Saudek, Vladimir},
title = {Empirical molecular weight distribution functions as determined from gel permeation chromatography data},
year = {1986},
journal = {Makromol. Chem.},
volume = {187},
number = {9},
month = sep,
pages = {2223--2234},
issn = {0025-116X},
url = {http://dx.doi.org/10.1002/macp.1986.021870919},
abstract = {Two- and three-parameter functions commonly used for the description
of the molecular weight distribution of polymers were determined
from gel permeation chromatography data for 80 water-soluble samples
of polymers derived from glutamic acid. Two methods were applied:
the moment method in which two or three different molecular weight
averages are used, and a least squares adjustment method using the
whole chromatogram. Convergence difficulties observed in the past
were overcome, and a fully automated computer procedure was developed.
The moment method, although virtually the only one still in use,
often gives inexact results: sometimes the type of two-parameter
distribution is wrongly assigned, or the description of experimental
data cannot be improved by adding yet another parameter. On the other
hand, in all cases under study the least squares method gave a function
which describes the real distribution within the limits of experimental
error. Although the majority of samples could be described by employing
one of the common two-parameter functions, the more general three-parameter
function, encompassing all two-parameter ones as special cases, has
the advantage of wider applicability. It is shown that the standard
gel permeation chromatography data often cannot provide reliable
values of higher molecular weight moment averages, including Mz.
Hence, it may be inferred that in the description of the experimental
molecular weight distribution curves the least squares method should
be preferred over the moment method.},
owner = {kohlbrecher},
timestamp = {2016.05.06},
}
@Comment{jabref-meta: databaseType:biblatex;} @Comment{jabref-meta: databaseType:biblatex;}
Binary file modified doc/manual/sasfit.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions sasfit.vfs/lib/app-sasfit/tcl/sasfit_addfiles.tcl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ frame .openfile.layout2
frame .openfile.layout3 frame .openfile.layout3


set format [tk_optionMenu .openfile.layout1.format tmpsasfit(actualdatatype) \ set format [tk_optionMenu .openfile.layout1.format tmpsasfit(actualdatatype) \
Ascii BerSANS] Ascii BerSANS ALV5000]
.openfile.layout1.format configure -highlightthickness 0 .openfile.layout1.format configure -highlightthickness 0
label .openfile.layout1.label -text "File Format:" -highlightthickness 0 label .openfile.layout1.label -text "File Format:" -highlightthickness 0
pack .openfile.layout1.label .openfile.layout1.format -side left -fill x pack .openfile.layout1.label .openfile.layout1.format -side left -fill x
Expand Down Expand Up @@ -785,13 +785,13 @@ set w .addfile.lay1
frame .addfile.layout3 frame .addfile.layout3


set format [tk_optionMenu $w.layout1.format tmpsasfit(actualdatatype) \ set format [tk_optionMenu $w.layout1.format tmpsasfit(actualdatatype) \
Ascii BerSANS] Ascii BerSANS ALV5000]
$w.layout1.format configure -highlightthickness 0 $w.layout1.format configure -highlightthickness 0
label $w.layout1.label -text "File Format:" \ label $w.layout1.label -text "File Format:" \
-width 12 -highlightthickness 0 -width 12 -highlightthickness 0
button $w.layout1.option -text "Options..." -command ReadOptionsCmd \ button $w.layout1.option -text "Options..." -command ReadOptionsCmd \
-highlightthickness 0 -pady 1m -highlightthickness 0 -pady 1m
button $w.layout1.read -text "Read File" \ button $w.layout1.read -text "Read file" \
-command { -command {
global tmpsasfit global tmpsasfit
set tmpfnlist $tmpsasfit(filename) set tmpfnlist $tmpsasfit(filename)
Expand Down
Loading

0 comments on commit aebb470

Please sign in to comment.