There are two parts to this code. First is the figures and calculations after. (Indicated by the two comments). But when I run them they appeared in the reverse order.
\subsection*{Figures}
\begin{center}
%should appear first
\begin{figure}[ht]
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{../figures/Ptime.jpg}
\caption{Pressure vs Step}
\vspace{4ex}
\end{subfigure}
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{../figures/temptime.jpg}
\caption{Temperature vs Step}
\vspace{4ex}
\end{subfigure}
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{../figures/KEtime.jpg}
\caption{Kinetic Energy vs Step}
\end{subfigure}
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{../figures/PEtime.jpg}
\caption{Potential Energy vs Step}
\end{subfigure}
\caption{}
\end{figure}
\end{center}
%should appear next
\textit{Calculation of Self Diffusion Coefficient}
\begin{equation*}
\begin{split}
\text{slope} & = 0.0021 \\
\text{Self Diffusion Coeff} & =\frac{1}{6}\times \text{(Slope of MSD at long time)}\\
& = \frac{1}{6} \times \text{0.0021}\\
& = \SI{3.5e-4} {\text{LJ units}}
\end{split}
\end{equation*}
\text{Considering the LJ liquid to be liquid Ar, we have $\sigma = 0.34 \textit{ nm}$, $\frac{\epsilon}{k_B}=120 \textit{ K}$. }\\
\text{$\therefore \frac{{(L^*)}^2}{t^*}=\frac{{L^2}/{\sigma^2}}{t\sqrt{\frac{\epsilon}{m\sigma^2}}}\implies \frac{L^2}{t}= (\sigma^3\sqrt{m/\epsilon}) \frac{(L^*)^2}{t^*} \implies \frac{L^2}{\epsilon}=\num{2.49e-31}\frac{(L^*)^2}{t^*}$}
\linebreak
\begin{equation*}
\begin{split}
\text{Diffusion Coefficient in SI Units} &= \num{3.5e-4}\times \SI{2.489e-31}{\meter^2 /\second}\\
&=\SI{8.7e-34}{\meter^2 /\second}
\end{split}
\end{equation*}
[ht]
after\begin{figure}
is what you need to experiment with. Theh
is a soft "here" thet
is a "top" (as in top of the page). If it is ok, try changing thet
to ab
(bottom), or try changing theh
to aH
(a "hard" here). – Emil Vatai Nov 27 '19 at 8:31[htp]
and work from there. The H has its uses but should not be used in a normal document – daleif Nov 27 '19 at 9:04{figure}
environment is allowed to float to where TeX thinks is best. If you don't want that, you don't need to use the{figure}
environment. A longer answer would be tex.stackexchange.com/q/39017/107497 and everything that links to it. – Teepeemm Jan 30 '20 at 16:12