Collapsed sandcastle model based on cellular automata

Based on cellular automata, the model of collapsed sandcastle can simulate the number of sand blocks falling. We assume that a part of the sand blocks disappear after each wave strikes the sandcastle. Meantime, due to the disappearance of the lower sand blocks, the upper sand blocks may collapse. We use cubes to simulate sand blocks and combine them into three-dimensional foundations of different shapes. We simulate the impact of triangle model, square model and octagon model with the same height and the same bottom area. By comparing the number of dropped squares, we guess that when the three-dimensional foundation is a cylinder, the number of sand blocks falling off is the least. In addition to considering the influence of the shape of the bottom, we also define the ratio of height to the length (or diameter) of the bottom kkCH . When the shape and volume of the bottom remain the same, kkCHdetermines the number of sand falling off. When kkCH = 1, the number of sand blocks falling off is the least. Finally, we summarize the paper: when the volume fraction of seawater is, the bottom of Sandberg tends to be round, and when kkCH = 1, the Sandberg is the most stable.


Introduction
The United States, with its large size and geographic variety, includes a varied topography [1]. On the US west coast, tourists enjoy the bright sunshine and beautiful sandy beaches. People get great joy and fulfillment from constructing sandcastles when they are at the beach. A sandcastle is a model castle made of sand [2]. The sandcastle by the sea will be eroded by the waves and tides, which are bound to collapse eventually. The paper is aimed to build the strongest sand castle which can last for the longest time on the seashore. We will consider the problem from aspects of the shape of the foundation and the ratio of the height of the sandcastle to the side length of the bottom.

Explanation of the wave-washing process
We use cellular automata [3] to simulate the impact of sandcastle foundations when waves pound the beach. We aggregate sand into cubes, which can conveniently represent different shaped foundations, in order to concretize the damage of the foundation. Firstly, we assume that the foundation is a cylinder with a regular shape, in which the shape of the ground surface can change. The ratio of the height H to the length of bottom edge C (or diameter) is CH , which can also be changed. First of all, we fix the height H and the length of bottom edge C. By changing the shape of the ground, we can obtain a more stable foundation. Then,we suppose that h is the highest height that can be washed out when the tide is rising. Every time the waves wash away n-tier of the cube, and the waves washing was divided into three sides.

Collapsed sandcastle model based on cellular automata
We use the superposition of the matrix to simulate the cube stacking model. We use '0' to indicate the existence of the cube while using '1' to indicate that the cube does not exist. Explore each layer of cubes affected by other cubes, as follows: for the remaining cubes except the cubes on the first layer, we consider the cube below it firstly. If this cube exists, the cube remains unchanged. If it disappears, we will consider the existence of the cross-type area cubes directly below, right and left. As the figure 1 shows:

Fig. 1: Distribution diagram of other cubes that affect the existence of cubes
We stipulate that when the count of falling cubes in '2', '3', '4', and '5' is above , this cube will fall. The possible distribution is shown in the figure 2:

Calculation about different shape of the bottom
Next, we start to discuss the shape of the ground. We propose three types of ground models, namely a triangle model, a square model and an octagon model. The matrix diagram of triangle foundation is shown in the figure 2 :   In order to control the area of the bottom surface to be equal, we select k = 9; n = 22; m = 43. Furthermore, we assume that the height H of the foundation is 20. Meanwhile, the highest height of the waves submerged is tenth layer. Firstly, we point the peak of the triangle toward the waves and the width of the impact surface is 43. Each layer will drop 6 cubes after each impact. Secondly, we point the obverse of the cube which has a square foundation towards the waves. Thus, the width of the impact surface is 22. Each layer will drop 3 cubes after each impact. The total width of the scouring surface is 44.Each layer will drop 4 cubes after each impact, which distribute on both sides of the foundation evenly. Thirdly, we point one of the sides of octagon towards the waves and the width of the impact surface will be 25. The layer will drop 3 cubes after each impact. The total width of the scouring surface is 18. Each layer will drop 2 cubes after each impact, which distribute on both sides of the foundation. According to the rule defined by the cell, that is the conditional test rule for each cube dropping, we simulate 100 times in each case with Matlab. In the end, calculate the number of dropped cubes N each time and the average of the results. Show the results with From the image, we can clearly find that the octagon has the fewest number of dropped cubes, followed by the square, and the triangle has the most. From this we can infer that when the shape of the bottom tends to be a circular, the stability is best.

Calculation about different
In this part, we take the bottom of the square as an example to explore the relationship between stability and kCH .Take a foundation with a square ground, which length is 21 and height is 21. We name this foundation as foundation-21. Then, take a foundation with a square ground, which length is 28 and height is 12. We name this foundation as foundation-28. At last, take a foundation with a square ground, which length is 14 and height is 47. We name this foundation as foundation-14. As shown in the figure 5:  Table 2 the value of kCH   parameter foundation-14 foundation-21 foundation-28 kCH 3.36 1 0.43 We assume that the height of waves is 10 and the waves scour the sand five times. For foundation-21, the width of the impact surface is 21. Each layer will drop 3 cubes after each impact. The width of the scouring surface is 21 2 = 42. Each layer will drop 4 cubes after each impact which distribute on both sides of the foundation evenly. And so on, we can infer the data of foundation-14 and foundation-28. According to the rule defined by the cell, that is the conditional test rule for each cube dropping, we simulate 100 times in each case with Matlab. In the end, calculate the number of dropped cubes N each time and the average of the results. Show the results with table 3: From this table, it can be known that the average value of the number of falling cubes of foundation-21 is 563.02. Followed by the foundation-21, the average value of foundation-14 is 665.29. The average value of foundation-28 is biggest, which reaches 721.58. Generally, the structural strength of foundation-21 is greatest. It indicates that when kCH is close to 1, the structural strength of the foundation is great. If kCH become larger or smaller, the structural strength decreases. During the 5 impacts, it is easily concluded that the maximum value can reach 1345 and the minimum value is only 296 for the foundation-14. What can be infered is that when kCH become large and the foundation is high, large-scale collapse is easy to occur. We can find from the standard deviation. The standard deviation of foundation-14 reaches 334.75, while the standard deviation of foundation-28 is only 45.04. The ratio has reached about 7.5 times. It can also be seen that the flatter the foundation, the less likely it is to collapse.

Summary
In summary, if the structure tends to be most stable, the bottom ground of the cube is circular and the ratio of the diameter to the height of the bottom surface is 1. At this time, the foundation of sandcastle is the most stable.