Skip to content
Permalink
Browse files

new plugin for thin cylindrical objects with a cylindrial profile wit…

…h a smooth radial profile
  • Loading branch information...
Kohlbrecher committed Aug 5, 2019
1 parent f2fdafe commit a4e70662fc94eca8751f7981122e313622e417f5
Showing with 273,671 additions and 269,204 deletions.
  1. BIN CHANGES.txt
  2. +0 −1,003 data/Chain data Luo Zhi/XX35EtOH_085_sub.dat
  3. +0 −3,621 data/Chain data Luo Zhi/first.test.sas
  4. BIN doc/images/form_factor/BoucherSphere/PcsBoucher2Cyl.png
  5. BIN doc/images/form_factor/BoucherSphere/PcsBoucherCyl.png
  6. BIN doc/images/form_factor/BoucherSphere/ProfileBoucher2Cyl.png
  7. BIN doc/images/form_factor/BoucherSphere/ProfileBoucherCyl.png
  8. BIN doc/images/form_factor/anisotropic/BoucherCyl.opju
  9. +115 −30 doc/manual/SASfit_Regularization_of_FredholmIntegrals.tex
  10. +2 −1 doc/manual/SASfit_ch2_planar.tex
  11. +11 −12 doc/manual/SASfit_ch2_polymers_micelles.tex
  12. +1 −0 doc/manual/SASfit_pluginsFF_cylindrical_obj.tex
  13. +2 −2 doc/manual/SASfit_pluginsFF_nonparticular.tex
  14. +156 −2 doc/manual/SASfit_pluginsFF_thin_objects.tex
  15. +1,676 −1,654 doc/manual/sasfit.aux
  16. +15 −0 doc/manual/sasfit.bbl
  17. +32 −15 doc/manual/sasfit.bib
  18. +1 −1 doc/manual/sasfit.blg
  19. +1,157 −1,120 doc/manual/sasfit.log
  20. +368 −376 doc/manual/sasfit.out
  21. BIN doc/manual/sasfit.pdf
  22. +269,536 −260,914 doc/manual/sasfit.synctex
  23. +2 −2 doc/manual/sasfit.tex
  24. +380 −383 doc/manual/sasfit.toc
  25. +1 −0 sasfit.vfs/lib/app-sasfit/tcl/sasfit_main.tcl
  26. +7 −0 sasfit.vfs/lib/app-sasfit/tcl/sasfit_structural.tcl
  27. +2 −2 src/plugins/boucherprofile/sasfit_ff_boucher_profiles2.c
  28. +7 −12 src/plugins/thin_objects/sasfit_ff_pcs_homogeneouscyl.c
  29. +3 −2 src/sasfit_old/include/sasfit.h
  30. +197 −52 src/sasfit_old/sasfit_extrapol.c
BIN +870 Bytes (100%) CHANGES.txt
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -231,8 +231,10 @@ \section{Expectation Maximization (EM)}
\end{align}
with $\lambda^{\max} \simeq 4$ so that $1\leq \lambda^{(k)}\leq \lambda^{\max}$.

Another more efficient method to accelerate the convergence rate of the EM iteration scheme is the so called Anderson acceleration \cite{Anderson1965} to solve fixed point problems (see also \cite{Walker2011,Toth2015}), which also has been suggested for the EM iteration scheme \cite{Henderson2019}. In \SASfit several fixed point accelerations are supplied by making use of the sundials library \cite{Hindmarsh2005}, which supplies next to the Anderson acceleration several other very efficient algorithms to speed up the convergence rate for finding a fixed point like GMRES \cite{Saad1986}, FGMRES \cite{Saad1993}, Bi-CGStab \cite{Vorst1992} or TFQMR \cite{Freund1993}. In \cite{Biggs1997, Biggs1995} an acceleration process has been suggested basing on vector extrapolation and does not require an extra evaluation of the fixed point operator $\mathcal{O}_\mathrm{EM}$ in eq.\ \ref{eq:LucyRichardsonInversionMethod}. The method just need to remember one or two previous solution vectors for calculating either the first or additionally the second derivative for guessing the next virtual solution vector, which is then used as an input vector for the next step of the fixed point iteration. The algorithm is described in the algorithm \ref{Biggs_Andersen}.
\begin{algorithm}
Another more efficient method to accelerate the convergence rate of the EM iteration scheme is the so called Anderson acceleration \cite{Anderson1965} to solve fixed point problems (see also \cite{Walker2011,Toth2015}), which also has been suggested for the EM iteration scheme \cite{Henderson2019}. In \SASfit several fixed point accelerations are supplied by making use of the sundials library \cite{Hindmarsh2005}, which supplies next to the Anderson acceleration several other very efficient algorithms to speed up the convergence rate for finding a fixed points like GMRES \cite{Saad1986}, FGMRES \cite{Saad1993}, Bi-CGStab \cite{Vorst1992} or TFQMR \cite{Freund1993}.

In \cite{Biggs1997, Biggs1995} an acceleration process has been suggested basing on vector extrapolation and does not require an extra evaluation of the fixed point operator $\mathcal{O}_\mathrm{EM}$ in eq.\ \ref{eq:LucyRichardsonInversionMethod}. The method just needs to remember one or two previous solution vectors for calculating either the first or additionally the second derivative for guessing the next virtual solution vector, which is then used as an input vector for the next step of the fixed point iteration. The algorithm is described in the algorithm \ref{Biggs_Andersen}.
\begin{algorithm}[thb]
\caption{Biggs-Andersen fixed point problem acceleration of order $o=0,1,2$ }\label{Biggs_Andersen}
\begin{algorithmic}[1]
\Procedure{update\_vectors}{$\mathbf{g}^{(n-2)}$,$\mathbf{g}^{(n-1)}$,$\mathbf{x}^{(n+1)}$,$\mathbf{x}^{(n)}$,$\mathbf{x}^{(n-1)}$,$\mathbf{x}^{(n-2)}$}
@@ -272,7 +274,8 @@ \section{Expectation Maximization (EM)}
\EndProcedure
\end{algorithmic}
\end{algorithm}
~\\

\clearpage

\subsection{EM with linear and non-linear smoothing operator}~\\

@@ -304,7 +307,7 @@ \subsection{EM with linear and non-linear smoothing operator}~\\
~\\
\subsection{EM with maximum entropy regularization and constant or adaptive prior}~\\
The Lucy\hyp{}Richardson method \cite{Richardson1972,Lucy1974} has been extended by an additional penalty function,
namely the entropy, by \cite{Lucy1994}. He introduces two variants, how the maximum entropy penalty can be introduced in the iteration algorithm by knowing either a fixed or assuming an adaptive prior for the solution vector. The entropy $S$ is given by
namely the entropy, by Lucy \cite{Lucy1994}. He introduces two variants, how the maximum entropy penalty can be introduced in the iteration algorithm by knowing either a fixed or assuming an adaptive prior for the solution vector. The entropy $S$ is given by
\begin{align}
S&= \sum_{j=0}^{N-1} -x_j\ln\left(x_j/m_j\right) +x_j-m_j
\end{align}
@@ -332,32 +335,14 @@ \subsection{EM with maximum entropy regularization and constant or adaptive prio


\section{Linear least square regularization (LLS)}

\subsection{LLS regularization with identity matrix as penalty term}~\\

\subsection{LLS regularization with first derivative matrix as penalty term}~\\

\subsection{LLS regularization with second derivative matrix as penalty term}

\section{Non-negative linear least square regularization (NNLLS)}\label{sec:NNLLS}

\subsection{NNLLS regularization with identity matrix as penalty term}~\\

\subsection{NNLLS regularization with first derivative matrix as penalty term}~\\

\subsection{NNLLS regularization with second derivative matrix as penalty term}~\\

\section{Maximum entropy method (MEM)}
entropy $S$:
\begin{align}
S&= \sum_{j=0}^{N-1} -x_j\ln\left(x_j/m_j\right) +x_j-m_j
\end{align}
with $\mathbf{m}$ being the prior estimate of $\mathbf{x}$.

\subsection{Jacobian and Hessian of mean square of the weighted deviations $\chi^2$}

\begin{align}
\chi^2 &= \left\| \hat{\mathbf{A}}\mathbf{x}-\mathbf{b}\right\|_w^2 \\
\label{sec:LLS}
Linear least square regularization has been implemented using the GNU scientific library (\texttt{gsl}). It supplies routines to solve ill-posed problems including a regularization term in the least squares minimization
\begin{align}\label{eq:LLSreg}
\chi^2 &= || \mathbf{b} - \hat{\mathbf{A}}\mathbf{x} ||_{w}^2 + \lambda^2 || \hat{\mathbf{L}} \mathbf{x} ||^2
\end{align}
Here $|| \dots ||_{w}^2$ denotes the weighted sum of squared residuals
\begin{align}\label{eq:wSumSR}
\left\| \hat{\mathbf{A}}\mathbf{x}-\mathbf{b}\right\|_W^2
&= \left(\mathbf{x}^T\hat{\mathbf{A}}^T\hat{\mathbf{w}}^T-\mathbf{b}^T\hat{\mathbf{w}}^T\right)\left(\hat{\mathbf{w}}\hat{\mathbf{A}}\mathbf{x}-\hat{\mathbf{w}}\mathbf{b}\right)\\
&= \mathbf{x}^T\hat{\mathbf{A}}^T\hat{\mathbf{w}}^T\hat{\mathbf{w}}\hat{\mathbf{A}}\mathbf{x}-2 \mathbf{x}^T\hat{\mathbf{A}}^T\hat{\mathbf{w}}^T\hat{\mathbf{w}}\mathbf{b}+\mathbf{b}^T\hat{\mathbf{w}}^T\hat{\mathbf{w}}\mathbf{b}
\end{align}
@@ -372,6 +357,106 @@ \subsection{Jacobian and Hessian of mean square of the weighted deviations $\chi
\end{pmatrix}
\end{align}
where $\Delta b_i$ are the experimental errors (standard deviation, Gaussian error or root-mean-square error) of the measured quantities $b_i$.
$\hat{\mathbf{L}}$ describes the penalty contribution and $\lambda$
is the regularization parameter. To determine a suitable value for it automatically several routines are supplied in the \texttt{gsl} library. Several choices for the penalty term $\hat{\mathbf{L}}$ are supplied
In the simples case the penalty term is the identity matrix $\hat{\mathbf{L}} = \hat{\mathbf{I}}$ so that the overall length of the solution vector is also tried to be minimized. As a second choice for the penalty term is the first-order discrete derivative operator \cite{Donatelli2014}
\begin{align}\label{eq:first_derivative_penalty}
\hat{\mathbf{L}}_\mathrm{1^{st}} &=
\begin{pmatrix}
-1 & 1 & & \\
& \ddots & \ddots & \\
& & -1 & 1
\end{pmatrix} \in \mathbb{R}^{(N-1)\times N}
\end{align}
Since nonsingular regularization matrices are easier to handle than singular
ones a common approach is to use small perturbations.
If the perturbation is small enough the smoothing property is not deteriorated
significantly. With a small diagonal element $\epsilon > 0$
\begin{align}\label{eq:first_derivative_penalty_plus_epsilon}
\hat{\mathbf{L}}_\mathrm{1^{st}} &=
\begin{pmatrix}
\epsilon & & & \\
-1 & 1 & & \\
& \ddots & \ddots & \\
& & -1 & 1
\end{pmatrix} \mbox{ or } \hat{\mathbf{L}}_\mathrm{1^{st}} =
\begin{pmatrix}
-1 & 1 & & \\
& \ddots & \ddots & \\
& & -1 & 1 \\
& & & \epsilon \\
\end{pmatrix} \in \mathbb{R}^{N\times N}
\end{align}
The additional element $\epsilon$ forces either the
first or last element to have small magnitude.
A further common regularization matrix is the discrete second-order derivative \cite{Donatelli2014}
operator
\begin{align}\label{eq:second_derivative_penalty}
\hat{\mathbf{L}}_\mathrm{2^{n}} &=
\begin{pmatrix}
-1 & 2 & -1 & & \\
& \ddots & \ddots & \ddots & \\
& & -1 & 2 & -1
\end{pmatrix} \in \mathbb{R}^{(N-2)\times N}
\end{align}
Also for this case a nonsingular squared matrix can be used as an approximation by adding one row at the top an one row at the bottom and assuming either Dirichlet boundary conditions or Neumann boundary conditions
\begin{align}\label{eq:second_derivative_penalty_plus_DrichletNeumann}
\hat{\mathbf{L}}_\mathrm{2^{nd}}^\mathrm{DD} &=
\begin{pmatrix}
2 & -1 & & & \\
-1 & 2 & -1 & & \\
& \ddots & \ddots & \ddots & \\
& & -1 & 2 & -1 \\
& & & -1 & 2 \\
\end{pmatrix} \in \mathbb{R}^{N\times N}\\
\mbox{or} \nonumber \\
\hat{\mathbf{L}}_\mathrm{2^{nd}}^\mathrm{NN} &=
\begin{pmatrix}
1 & -1 & & & \\
-1 & 2 & -1 & & \\
& \ddots & \ddots & \ddots & \\
& & -1 & 2 & -1 \\
& & & -1 & 1 \\
\end{pmatrix} \in \mathbb{R}^{N\times N}
\end{align}
Also mixed boundary condition with Dirichlet boundary condition at the left end point and the Neumann boundary condition at the
right one or vice versa.
\begin{align}\label{eq:second_derivative_penalty_plus_mixedDrichletNeumann}
\hat{\mathbf{L}}_\mathrm{2^{nd}}^\mathrm{ND} &=
\begin{pmatrix}
2 & -1 & & & \\
-1 & 2 & -1 & & \\
& \ddots & \ddots & \ddots & \\
& & -1 & 2 & -1 \\
& & & -1 & 1
\end{pmatrix} \in \mathbb{R}^{N\times N} \\
\mbox{or} \nonumber\\
\hat{\mathbf{L}}_\mathrm{2^{nd}}^\mathrm{DN} &=
\begin{pmatrix}
1 & -1 & & & \\
-1 & 2 & -1 & & \\
& \ddots & \ddots & \ddots & \\
& & -1 & 2 & -1 \\
& & & -1 & 2
\end{pmatrix} \in \mathbb{R}^{N\times N}
\end{align}

\section{Non-negative linear least square regularization (NNLLS)}\label{sec:NNLLS}
The non-negative linear least square solver used here is taken from \cite{Lawson1995a} and are also available at netlib under
\url{http://www.netlib.org/lawson-hanson/} as Fortran source code which has been translated to C by \hyperref[https://www.netlib.org/f2c/]{f2c}. \SASfit is using this routine to solves the same ill-posed problems including a regularization term as in eq.\ \ref{eq:LLSreg} of section \ref{sec:LLS} just with an additional constrain of non-negativity.


\clearpage
\section{Maximum entropy method (MEM)}
entropy $S$:
\begin{align}
S&= \sum_{j=0}^{N-1} -x_j\ln\left(x_j/m_j\right) +x_j-m_j
\end{align}
with $\mathbf{m}$ being the prior estimate of $\mathbf{x}$.

\subsection{Jacobian and Hessian of mean square of the weighted deviations $\chi^2$}



Jacobian of $\chi^2$
\begin{align}
@@ -134,9 +134,10 @@ \subsection{LayeredCentroSymmetricXS}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\clearpage
\subsection{BiLayerGauss \cite{Pabst2000}}
\subsection{BiLayerGauss}
\label{sect:BiLayerGauss}
~\\
This model has been described in detail in \cite{Pabst2000}.
\begin{figure}[htb]
\begin{center}
\includegraphics[width=0.4\textwidth]{BiLayers.png}
@@ -4,10 +4,10 @@ \section{Polymers and Micelles}

\clearpage

\subsection{Unified Exponential Power Law according to Beaucage \cite{beaucage95,beaucage96}}
\subsection{Unified Exponential Power Law according to Beaucage}
\label{sect:Beaucage}
~\\

The model is described in \cite{beaucage95,beaucage96}.
\begin{figure}[htb]
\begin{center}
\includegraphics[width=0.952\textwidth]{Beaucage.png}
@@ -340,7 +340,7 @@ \subsubsection{Micelles with a homogeneous core and Gaussian chains on the surfa

\vspace{5mm}

\subsubsection{\bf Spherical core:} \label{sect:SphericalMicelles}
\subsubsection{Spherical core:} \label{sect:SphericalMicelles}
\vspace{5mm}
\begin{align}
P_\text{core}(q,R_\text{core}) &= \Phi^2(qR_\text{core}) \\
@@ -481,7 +481,7 @@ \subsubsection{\bf Spherical core:} \label{sect:SphericalMicelles}
into the core is mimicked by $d\sim 1$ for $R_\text{core}\gg R_g$
\end{description}

\clearpage \noindent \subsubsection{\bf ellipsoidal core with
\clearpage \noindent \subsubsection{ellipsoidal core with
semi-axis $(R,R,\epsilon R)$:} \label{sect:ELLMicelles}
\vspace{5mm}
\begin{align}
@@ -641,7 +641,7 @@ \subsubsection{\bf Spherical core:} \label{sect:SphericalMicelles}

\clearpage
\noindent
\subsubsection{\bf cylindrical core with radius $R_\text{core}$ and height $H$:}
\subsubsection{cylindrical core with radius $R_\text{core}$ and height $H$:}
\label{sect:CylMicelles}
~\\
\begin{align}
@@ -801,8 +801,7 @@ \subsubsection{\bf cylindrical core with radius $R_\text{core}$ and height $H$:}

\clearpage
\noindent
\subsubsection{\bf wormlike micelles with cylindrical cross-section with radius $R_\text{core}$,
Kuhn-length $l$ and contour length $L$:}
\subsubsection{wormlike micelles with circular cross-section:}
\label{sect:WormLikeMicelles}
~\\
The form factors for a worm-like micelles are approximated by the form factor of the Kholodenko-worm
@@ -813,7 +812,7 @@ \subsubsection{\bf wormlike micelles with cylindrical cross-section with radius
P_\text{core}(q,R_\text{core},l,L) &= P_\text{worm}(q,l,L) P_\text{cs}(q,R_\text{core},d,R_g)
\label{eq:wormlikeFF}
\end{align}
the contributiion of the worm-like conformation of the micelle $P_\text{worm}(q,l,L)$ is described
the contribution of the worm-like conformation of the micelle $P_\text{worm}(q,l,L)$ is described
by the formula of Kholodenko for worm-like structures given in eq.\ \ref{eq:Kholodenko}.
The contribution of the cross-section $P_\text{cs}$ is the same as for rod-like micelles and
given by
@@ -965,7 +964,7 @@ \subsubsection{\bf wormlike micelles with cylindrical cross-section with radius

\clearpage
\noindent
\subsubsection{\bf micelles with rod-like core:}
\subsubsection{micelles with rod-like core:}
\label{sect:RodLikeMicelles}
~\\
The form factors for micelles with a rod-like core are an approximations of the form factors of micelles
@@ -1063,7 +1062,7 @@ \subsubsection{\bf micelles with rod-like core:}

\clearpage
\subsubsection{Micelles with a homogeneous core
and a corona with decaying density profile .
and a corona with decaying density profile
of the form $\varphi(r)\varpropto r^{-\alpha}$}~\\

\begin{figure}[htb]
@@ -1168,7 +1167,7 @@ \subsubsection{Micelles with a homogeneous core
\vspace{5mm}

\noindent
\subsubsection{\bf spherical core:}
\subsubsection{spherical core:}
\label{sect:SPHERE+R_ma}~\\

\begin{align}
@@ -1324,7 +1323,7 @@ \subsubsection{\bf spherical core:}
\vspace{5mm}

\noindent
\subsubsection{\bf rodlike core:}
\subsubsection{rodlike core:}
\label{sect:ROD+R_ma}~\\
In case of a rod-like micelle the form factor can be separated in two terms $I(q) =
P_H(q)P_\text{cs}(q)$ as already in shown in eq. \ref{eq:rodlikeFF}. The cross-term contribution to the scattering
@@ -489,6 +489,7 @@ \subsection{Random oriented cylindrical shell with elliptical cross-section}
\end{figure}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage

@@ -233,7 +233,7 @@ \subsubsection{clipped random fields} ~\\

\vspace{5mm}

\underline{Input Parameters for model \texttt{CRW 2}, \texttt{CRW 3}, \texttt{CRW 4}, \texttt{CRW 5}:}\\
\underline{Input Parameters for models \texttt{CRW 2}, \texttt{CRW 3}, \texttt{CRW 4}, \texttt{CRW 5}:}\\
\begin{description}
\item[\texttt{scale}] scaling factor for the intensity
\item[\texttt{d}] quasi-periodic distance $d$
@@ -245,7 +245,7 @@ \subsubsection{clipped random fields} ~\\

\underline{Note:}
\begin{itemize}
\item for the models 2 and 3 $r_m\neq\xi$, otherwise \SASfit returns an error message.
\item for the models 2 and 3 $r_c\neq\xi$, otherwise \SASfit returns an error message.
\item Instead of assuming a two-point correlation function, one also can try to inverse the scattering data back into the spectral function $f(q)$ which e.g.\ has been realised in the software \texttt{SAXSMorph} \cite{Ingham2010}.
\end{itemize}

0 comments on commit a4e7066

Please sign in to comment.
You can’t perform that action at this time.