Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.o
src/*.o
*.mod
src/*.mod
src/*.out


Binary file removed report/figures/fig_1.pdf
Binary file not shown.
Binary file added report/figures/mag_t1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added report/figures/mag_t3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added report/figures/mag_vs_temp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
202 changes: 62 additions & 140 deletions report/report.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,147 +10,69 @@

\begin{document}

\title{Manuscript Title:\\with Forced Linebreak}% Force line breaks with \\
\author{Ann Author}
\date{\today}% It is always \today, today, but you can specify other dates manually
\title{Modeling Ising}
\author{Scott O'Connor}
\date{\today}
\maketitle

\begin{abstract}
An article usually includes an abstract, a concise summary of the work
covered at length in the main body of the article.
\end{abstract}


\section{First-level heading} %Title for the section
\label{sec:level1} %Label for the section, to be used for referencing in other parts of the document

This sample document demonstrates some common uses of \LaTeX\ in documents you'll write for ICCP. Further information can be found online at the \href{http://en.wikibooks.org/wiki/LaTeX}{\LaTeX\ wikibook} or in the distribution documentation.

When we refer to commands in this example file, they always have their required formal arguments in normal \TeX{} format. In this format, \verb+#1+, \verb+#2+, etc. stand for required author-supplied arguments to commands. For example, in \verb+\section{#1}+ the \verb+#1+ stands for the title text of the author's section heading, and in \verb+\title{#1}+ the \verb+#1+ stands for the title text of the paper.

Line breaks in section headings at all levels can be introduced using \textbackslash\textbackslash. A blank input line tells \TeX\ that the paragraph has ended.

\subsection{\label{sec:level2} Second-level heading: Formatting}

This file may be formatted in either the \texttt{preprint} or \texttt{reprint} style. \texttt{reprint} format mimics final journal output. The paper size may be specified with the option \texttt{letter}. These options are inserted in the square brackets inside the \texttt{\textbackslash documentclass[]\{article\}} command.

\section{Math and Equations}
Inline math may be typeset using the \verb+$+ delimiters. Bold math symbols may be achieved using the \verb+bm+ package and the \verb+\bm{#1}+ command it supplies. For instance, a bold $\alpha$ can be typeset as \verb+$\bm{\alpha}$+ giving $\bm{\alpha}$. Fraktur and Blackboard (or open face or double struck) characters should be typeset using the \verb+\mathfrak{#1}+ and \verb+\mathbb{#1}+ commands respectively. Both are supplied by the \texttt{amssymb} package. For
example, \verb+$\mathbb{R}$+ gives $\mathbb{R}$ and \verb+$\mathfrak{G}$+ gives $\mathfrak{G}$

In \LaTeX\ there are many different ways to display equations, and a few preferred ways are noted below. Displayed math will center by default. Use the class option \verb+fleqn+ to flush equations left.

Below we have numbered single-line equations; this is generally the most common type of equation in \LaTeX:
\begin{equation}
\label{eq:one} %Label for the equation, to be used for referencing in other parts of the document
i \hbar \frac{\partial \Psi}{\partial t} = -\frac{\hbar^2}{2m}\nabla^2 \psi + U(\mathbf{x}) \psi
\end{equation}

When the \verb+\label{#1}+ command is used [cf. input for Eq.~(\ref{eq:one})], the equation can be referred to in text without knowing the equation number that \TeX\ will assign to it. Just use \verb+\ref{#1}+, where \verb+#1+ is the same name that was used in the \verb+\label{#1}+ command.

Unnumbered single-line equations can be typeset using the \verb+equation*+ environment:
\begin{equation*}
\hat{f}(\xi) = \int_{-\infty}^\infty f(x) e^{-2\pi i x \xi} \, \mathrm{d}x
\end{equation*}

\subsection{Multiline equations}

You'll generally want to use the \verb+align+ environment for multiline equations. Use the \verb+\nonumber+ command at the end of each line (again denoted with \textbackslash\textbackslash) to avoid assigning a number, or \verb+align*+ to disable numbering entirely:
\begin{align}
\sin(2\theta) &= 2 \sin(\theta) \cos(\theta) \nonumber \\
&= \frac{2\tan(\theta)}{1 + \tan^2(\theta)}
\end{align}
Note how alignment occurs at the (unprinted) \verb+&+ character.

Do not use \verb+\label{#1}+ on a line of a multiline equation if \verb+\nonumber+ is also used on that line. Incorrect cross-referencing will result. Notice the use \verb+\text{#1}+ for using a Roman font within a math environment.

\section{Cross-referencing}
\LaTeX\ will automatically number such things as sections, footnotes, equations, figure captions, and table captions for you. In order to reference them in text, use the \verb+\label{#1}+ and \verb+\ref{#1}+ commands\footnote{Check out the \texttt{cleveref} (one r) package, too!}. To reference a particular page, use the \verb+\pageref{#1}+ command.

The \verb+\label{#1}+ should appear within the section heading (or immediately after), within the footnote text, within the equation, or within the table or figure caption. The \verb+\ref{#1}+ command is used in text at the point where the reference is to be displayed. Some examples: Section~\ref{sec:level1} on page~\pageref{sec:level1}, Table~\ref{tab:table1}, and Fig.~\ref{fig:epsart}.
\begin{figure}[b]
\centering
\includegraphics{figures/fig_1}% Imports a figure - does not automatically scale
\caption{\label{fig:epsart} A figure caption. The figure captions are automatically numbered.}
\end{figure}

\section{Floats: Figures, Tables, etc.}
Figures (images) and tables are usually allowed to ``float'', which means that their placement is determined by \LaTeX, while the document is being typeset.

Use the \texttt{figure} environment for a figure, the \texttt{table} environment for a table. In each case, use the \verb+\caption+ command within to give the text of the figure or table caption along with the \verb+\label+ command to provide a key for referring to this figure or table. Insert an image using either the \texttt{graphics} or \texttt{graphix} packages, which define the \verb+\includegraphics{#1}+ command. (The two packages differ in respect of the optional arguments used to specify the orientation, scaling, and translation of the image.) To create an alignment, use the \texttt{tabular} environment.

\begin{table}
\centering
\begin{tabular}{ |l|l|l| }
\hline
\multicolumn{3}{ |c| }{Team sheet} \\
\hline
Goalkeeper & GK & Paul Robinson \\ \hline
\multirow{4}{*}{Defenders} & LB & Lucus Radebe \\
& DC & Michael Duburry \\
& DC & Dominic Matteo \\
& RB & Didier Domi \\ \hline
\multirow{3}{*}{Midfielders} & MC & David Batty \\
& MC & Eirik Bakke \\
& MC & Jody Morris \\ \hline
Forward & FW & Jamie McMaster \\ \hline
\multirow{2}{*}{Strikers} & ST & Alan Smith \\
& ST & Mark Viduka \\
\hline
\end{tabular}
\caption{\label{tab:table1}A table, demonstrating the use of the \texttt{multirow} package for spanning rows and columns.}
\end{table}

The best place for the \texttt{figure} or \texttt{table} environment is immediately following its first reference in text; this sample document illustrates this practice for Fig.~\ref{fig:epsart}, which shows a figure that is small enough to fit in a single column. In exceptional cases, you will need to move the float earlier in the document: \LaTeX's float placement algorithms need to know about a full-page-width float sooner.

The content of a table is typically a \texttt{tabular} environment, giving rows of type in aligned columns. Column entries separated by \verb+&+'s, and
each row ends with \textbackslash\textbackslash. The required argument for the \texttt{tabular} environment specifies how data are aligned in the columns.
For instance, entries may be centered, left-justified, right-justified, aligned on a decimal point.

Extra column-spacing may be be specified as well, although \LaTeX sets this spacing so that the columns fill the width of the table. Horizontal rules are typeset using the \verb+\hline+ command. Rows with that columns span multiple columns can be typeset using the \verb+\multicolumn{#1}{#2}{#3}+ command (for example, see the first row of Table~\ref{tab:table1}).

\appendix

\section{Appendixes}

To start the appendixes, use the \verb+\appendix+ command. This signals that all following section commands refer to appendixes instead of regular sections. Therefore, the \verb+\appendix+ command should be used only once---to setup the section commands to act as appendixes. Thereafter normal section commands are used. The heading for a section can be left empty. For example,
\begin{verbatim}
\appendix
\section{}
\end{verbatim}
will produce an appendix heading that says ``APPENDIX A'' and
\begin{verbatim}
\appendix
\section{Background}
\end{verbatim}
will produce an appendix heading that says ``APPENDIX A: BACKGROUND'' (note that the colon is set automatically).

If there is only one appendix, then the letter ``A'' should not appear. This is suppressed by using the star version of the appendix command (\verb+\appendix*+ in the place of \verb+\appendix+).

\section{A little more on appendixes}

Observe that this appendix was started by using
\begin{verbatim}
\section{A little more on appendixes}
\end{verbatim}

Note the equation number in an appendix:
\begin{equation}
E^2=p^2c^2 + m^2c^4.
\end{equation}

\subsection{\label{app:subsec}A subsection in an appendix}

You can use a subsection or subsubsection in an appendix. Note the numbering: we are now in Appendix~\ref{app:subsec}.

Note the equation numbers in this appendix, produced with the subequations environment:
\begin{subequations}
\begin{align}
E^2 &= m^2c^4 \quad \text{(rest)}, \label{appa} \\
E^2 &= m^2c^4 + p^2 c^2 \quad \text{(relativistic)}, \label{appb} \\
E^2 &\approx p^2 c^2 \quad \text{(ultrarelativistic)} \label{appc}
\end{align}
\end{subequations}
They turn out to be Eqs.~(\ref{appa}), (\ref{appb}), and (\ref{appc}).
\begin{abstract}
The ising model is used in this program as a way to predict the behavior of magnetic material as it is effected by temperature.
\end{abstract}

\section{Program Explained}
\subsection{}
The first thing this model does is calculate the Hamiltonian.
This is done by summing the states of each location in the Lattice
\begin{equation}
H(\sigma) = - \sum_{i=1} \sigma_i \sigma_j
\end{equation}
For a 2D case there are four possible nearest neighbor interations: the cell above, below, left and right.
The lattice currently implimented is zeropadded. This allows for the ability to sum over the non-zero padded portion of the lattice and not have to worry about the boundries.

After the intial calacluaiton of the hamiltonian, a monte carlo simulation is performed on the lattice. In the monte carlo routine, random bits are selected, and a metropolis test is performed
The metropolis test will determined if a bit should be fliped or not.

\begin{equation}
\Delta E = 2 \sigma_i (\sigma_{above} + \sigma_{below} + \sigma_{left} \sigma_{right})
\end{equation}

\begin{equation}
X \sim [(0,1)]< e^{-\beta \Delta E}
\end{equation}


\section{Plots}
%Plotting normalized magnetization vs various temperatures, the magnetization goes to zero around 2.2. This is consistant with how the model should perform
\begin{figure}[b]
\centering
\includegraphics{figures/mag_vs_temp.jpg}
\caption{\label{fig:mag_vs_temp}Normalize Magnetization and various temperatures}
\end{figure}

%Plotting the magnetization over a million iterations in a 100 by 100 lattice when the temperature is temp=1, results in a net magnetization.

\begin{figure}[b]
\centering
\includegraphics{figures/mag_t1.jpg}
\caption{\label{fig:mag_T1p} Magnetization over a million iterations at temp=1}
\end{figure}

%Plotting the same simulation as above, except that temp=3 results in a zero net magnetization.

\begin{figure}[b]
\centering
\includegraphics{figures/mag_t3.jpg}
\caption{\label{fig:mag_T3p} Magnetization over a million iterations at temp=3}
\end{figure}

\section{Energy at Different Temperatures}

\subsection{\label{sec:level2} Temperature at 2}

\subsection{\label{sec:level2} Temperature at 3}

\begin{conclusion}
The results of the ising model are as expected. The magnetization goes to zero when temp=2.2. When the temperature is below this mark, the magntization hovers above zero. When the temperature is above zero the net magnetization goes to zero.
\end{conclusion}

\end{document}
5 changes: 5 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.out
*.o
*.mod
*.exe
*.swp
8 changes: 4 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FC = gfortran
FFLAGS = -Wall -Wextra -march=native -O3 -fimplicit-none
#FFLAGS += -pedantic -fbounds-check -fmax-errors=1 -g
FFLAGS += $(shell pkg-config --cflags plplotd-f95)
LDFLAGS = $(shell pkg-config --libs plplotd-f95)
LIBS =
#FFLAGS += $(shell pkg-config --cflags plplotd-f95)
#LDFLAGS = $(shell pkg-config --libs plplotd-f95)
BINDIR := bin

COMPILE = $(FC) $(FFLAGS)
LINK = $(FC) $(LDFLAGS)

TARGET = ising.exe # Name of final executable to produce
OBJS = plot.o ising.o # List of object dependencies
OBJS = global.o ising.o # List of object dependencies

$(TARGET): $(OBJS)
$(LINK) -o $@ $^ $(LIBS)
Expand Down
17 changes: 17 additions & 0 deletions src/dataread.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
%Plotting routine

load /hfield.out

data=hfield;
x=zeros(1,1000000);
y=zeros(1,1000000);
for i=1:1000000
x(1,i) = data(i,1);
y(1,i) = data(i,2);
end

figure(1);
plot(x,y)
title('Magnetization at temp=3')
xlabel('Iterations')
ylabel('Normalized Magnetization')
22 changes: 22 additions & 0 deletions src/global.f95
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module global

implicit none

integer :: t_avg,temp_points
integer :: latticeSize,iters,n1,n2
integer, allocatable :: lattice(:,:)
real(8) :: rand_loc(2)
real(8) :: rand_temp
real(8) :: temp_prob
integer :: rand_loc_int(2)
real(8) :: del_e
real(8) :: h(2)
real(8) :: j !magnetic coefficients
real(8) :: min_temp,max_temp
real(8) :: k !boltzman constant
real(8) :: B !combination of temp and boltzman

!Energy Variables
real(8) :: energy_sum !sum of total energy in lattice

end module global
Loading