From adc47422c447f43e80ba7b1c1b24e84c613695ec Mon Sep 17 00:00:00 2001 From: Kelvin Davis <273degreeskelvin@gmail.com> Date: Fri, 18 May 2018 14:33:30 +1000 Subject: [PATCH] Added latex and markdown copies --- wk11/week11.md | 49 ++++++++++++++++++++++++++ wk11/week11.tex | 93 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 wk11/week11.md create mode 100644 wk11/week11.tex diff --git a/wk11/week11.md b/wk11/week11.md new file mode 100644 index 0000000..e7dcc6a --- /dev/null +++ b/wk11/week11.md @@ -0,0 +1,49 @@ +# Simulating Time + +In this section we use Cellular Automata to show how different updating methods can drastically affect the execution of a program. + +The cellular automata model takes a vector $\mathbf{x}_t = (x_{t,1} \dots x_{t,n})$ where $x_{t,i} \in \{0,1\}$ as the current state and returns another vector $\mathbf{x}_{t+1}$. The next state of a cell $x_{t+1, i}$ is dependent on its current state $x_{t, i}$ and the state of the cells adjacent to it $x_{t, i-1}$ and $x_{t, i+1}$ based on a set of rules for the form $f : \{0,1\}^3 \to \{0,1\}$. + +We are using the rule set + +\begin{eqnarray*} +f(1,1,1) & = & 1\\ +f(1,0,0) & = & 1\\ +\text{otherwise }f(\_,\_,\_) & = & 0 +\end{eqnarray*} + +## Why do different patterns appear with different update rules? + +There are 6 updating schemes: + +1. Synchronous - updates cells all at once for each time step +2. Random Independent - picks a cell at random to update +3. Random Order - creates a random order to update cells for each time step +4. Clocked - the cells update at a fixed interval but the intervals vary from cell to cell +5. Cyclic - updates the cells one at a time from left to right +6. Self-synchronising - initially updated at random, but by interacting with their neighbours, they gradually become synchronised + +The synchronous method updates all the cells at once for each time-step. As shown this results in a plot that is consistent. +The Random Independent method allows any cell to be updated at any time + +## A common mistake in writing programs to run simulation models is to scan through an array updating each cell in turn, based on the current values of its neighbours. Which of the update schemes demonstrated corresponds to this? + + +The cycle option corresponds to updating each cell based on the current state of its neighbours. This can be verified by looking at the pattern produced be the bottom-middle plot in the figure. When the updating is done synchronously, the plot results in consistent parallel, diagonal lines, however when the cycle method is used, it can be seen that the updating is not dependent on $x_{t, i-1}$ but rather $x_{t+1, i-1}$. +That and all of the other options incorporate an aspect of randomness which then results in sparse plots due to only two out of the eight possible rules being active i.e. $$\dfrac{\sum_{x\in\{0,1\}^3}{f(x)}}{|\{0,1\}^3|} = \dfrac{2}{8}$$ + + +## Suggest cases where the clock scheme or random asynchronous updating might bean appropriate way to model a system in the real world? + +In cases where we are modelling systems over continuous time, then the clock scheme or random asynchronous updating would be appropriate to use. These might be systems like + + +# Sensitivity analysis - critical mass in a nuclear + +In this experiment, we model a chain reaction by nuclear fission and aim to see how the density of atoms affects the systems ability to create a runaway chain reaction. Specifically we are interested in find the critical mass as measured in density that leads to chain reactions. We simulate the system at varying densities between 0% and 20% and use the graphs showing the energy released from the system over time to gauge how where the runaway reaction occurs. + + + +We take measurements of the energy released at densities of 0%, 5%, 8%, 10%, 11%, 12%, 13%, 15%, 17% and 20%, sampling at shorter intervals of density closer to the density at which the maximum reading of the energy released exceeds 10 . + +This breakout first happens at 12, and so we deem this to be the critical density of the system. diff --git a/wk11/week11.tex b/wk11/week11.tex new file mode 100644 index 0000000..d7852e2 --- /dev/null +++ b/wk11/week11.tex @@ -0,0 +1,93 @@ +\section{Simulating Time}\label{simulating-time} + +In this section we use Cellular Automata to show how different updating +methods can drastically affect the execution of a program. + +The cellular automata model takes a vector +\(\mathbf{x}_t = (x_{t,1} \dots x_{t,n})\) where \(x_{t,i} \in \{0,1\}\) +as the current state and returns another vector \(\mathbf{x}_{t+1}\). +The next state of a cell \(x_{t+1, i}\) is dependent on its current +state \(x_{t, i}\) and the state of the cells adjacent to it +\(x_{t, i-1}\) and \(x_{t, i+1}\) based on a set of rules for the form +\(f : \{0,1\}^3 \to \{0,1\}\). + +We are using the rule set + +\begin{eqnarray*} +f(1,1,1) & = & 1\\ +f(1,0,0) & = & 1\\ +\text{otherwise }f(\_,\_,\_) & = & 0 +\end{eqnarray*} + +\subsection{Why do different patterns appear with different update +rules?}\label{why-do-different-patterns-appear-with-different-update-rules} + +There are 6 updating schemes: + +\begin{enumerate} +\def\labelenumi{\arabic{enumi}.} +\tightlist +\item + Synchronous - updates cells all at once for each time step +\item + Random Independent - picks a cell at random to update +\item + Random Order - creates a random order to update cells for each time + step +\item + Clocked - the cells update at a fixed interval but the intervals vary + from cell to cell +\item + Cyclic - updates the cells one at a time from left to right +\item + Self-synchronising - initially updated at random, but by interacting + with their neighbours, they gradually become synchronised +\end{enumerate} + +The synchronous method updates all the cells at once for each time-step. +As shown this results in a plot that is consistent. The Random +Independent method allows any cell to be updated at any time + +\subsection{A common mistake in writing programs to run simulation +models is to scan through an array updating each cell in turn, based on +the current values of its neighbours. Which of the update schemes +demonstrated corresponds to +this?}\label{a-common-mistake-in-writing-programs-to-run-simulation-models-is-to-scan-through-an-array-updating-each-cell-in-turn-based-on-the-current-values-of-its-neighbours.-which-of-the-update-schemes-demonstrated-corresponds-to-this} + +The cycle option corresponds to updating each cell based on the current +state of its neighbours. This can be verified by looking at the pattern +produced be the bottom-middle plot in the figure. When the updating is +done synchronously, the plot results in consistent parallel, diagonal +lines, however when the cycle method is used, it can be seen that the +updating is not dependent on \(x_{t, i-1}\) but rather \(x_{t+1, i-1}\). +That and all of the other options incorporate an aspect of randomness +which then results in sparse plots due to only two out of the eight +possible rules being active i.e. +\[\dfrac{\sum_{x\in\{0,1\}^3}{f(x)}}{|\{0,1\}^3|} = \dfrac{2}{8}\] + +\subsection{Suggest cases where the clock scheme or random asynchronous +updating might bean appropriate way to model a system in the real +world?}\label{suggest-cases-where-the-clock-scheme-or-random-asynchronous-updating-might-bean-appropriate-way-to-model-a-system-in-the-real-world} + +In cases where we are modelling systems over continuous time, then the +clock scheme or random asynchronous updating would be appropriate to +use. These might be systems like + +\section{Sensitivity analysis - critical mass in a +nuclear}\label{sensitivity-analysis---critical-mass-in-a-nuclear} + +In this experiment, we model a chain reaction by nuclear fission and aim +to see how the density of atoms affects the systems ability to create a +runaway chain reaction. Specifically we are interested in find the +critical mass as measured in density that leads to chain reactions. We +simulate the system at varying densities between 0\% and 20\% and use +the graphs showing the energy released from the system over time to +gauge how where the runaway reaction occurs. + +We take measurements of the energy released at densities of 0\%, 5\%, +8\%, 10\%, 11\%, 12\%, 13\%, 15\%, 17\% and 20\%, sampling at shorter +intervals of density closer to the density at which the maximum reading +of the energy released exceeds 10 . + +This breakout first happens at 12, and so we deem this to be the +critical density of the system.