Tuesday, April 19, 2011

Sledgehammer

This is what you call modelling by sledge hammer. We set up a model and rather than investigate the parameter space via mathematical analysis, we set up some matlab code to run the code thousands of times over with slightly varied parameters, set up a LaTeX file with a forloop and print out the results. "Analysis" involves picking the best looking pictures.

[Download] approx 2mb

Codey-code: (beware of lame coding and possible redundant packages etc)

\usepackage{calc}
\usepackage{forloop}
\usepackage{tikz,pgf,pgfplots}
\usepackage{subfigure}
\usepackage[landscape,scale=0.8]{geometry}

\setlength{\parindent}{0pt}

%Used in forloop
\newcounter{xcount}

\begin{document}

\section{Simulations of Mallet PDE model}

\forloop[1]{xcount}{1}{\value{xcount}<104}{

\subsection{Simulation \arabic{xcount}}

Parameters for this simulation are: $\input{"simulations/params\arabic{xcount}.txt"}$

\begin{figure}[htbp]

\begin{tikzpicture}
\begin{axis}
\addplot file {"simulations/data_Iprop\arabic{xcount}.txt"};
\end{axis}
\end{tikzpicture}
\caption{Caption here with call to file if you want: $\protect\input{simulations/params\arabic{xcount}.txt}$}
\end{figure}

\clearpage

}

\end{document}

1 comment: