1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
ResearchMethods/wk11/week11.md
2018-05-18 14:33:30 +10:00

50 lines
3.7 KiB
Markdown

# 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 <!--list some systems that change asynchronously-->
<!--Make a distinction between systems that systems where the agents update at fixed rates and systems where the agents update randomly-->
# 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.
<!--Add figure here-->
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 <!--what?-->.
This breakout first happens at 12, and so we deem this to be the critical density of the system.