• No se han encontrado resultados

A great advantage of our simulation compared to state-of-the-art systems is its scalability. To quantify this scalability multiple simulations were performed. Experiment 2 in Table 7.3 has been simulated both with a structured and unstructured simulation for multiple numbers of starting molecules to show how the simulator scales in time. Additional simulations were performed using a billion starting molecules to show changes in simulation speed and memory usage over the course of a simulation. The simulations were performed on a computer with an Intel i7-3770 CPU with a clock speed of 3.4 GHz and 8GB of RAM. The Java heap size was limited to 5.5GB.

Simulation time Figure 7.12 shows how the simulation time scales almost linearly with the number of initial molecules cT in the simulation. This is the case for both the structured and unstructured simulation. Furthermore note that the use of the low detail level for structured simulations decreases the simulation time. The differences between the simulation times of the low and high detail level are

not that large however, indicating that the extra abstraction introduced by the the usage of the low detail level is not necessary for successful simulation.

(a)Total simulation time for different numbers of initial molecules

cT.

(b)Total simulation time of structured simulation for different numbers of initial moleculescT.

Figure 7.12:Simulation times of both the structured and unstructured simulation. Figure 7.12b shows the differences in simulation time for the two detail levels defined in Section 5.2.4.

Simulation speed We also compared the simulation speed, in number of simulated reactions per second, of an unstructured simulation, a special unstructured simulation where we disabled deletion of empty molecule species, and structured simulations on both high and low detail.

Figure 7.13 shows how the simulation speed sharply decreases at the start of the simulation. This is caused by the increase in reactive centers in the mid-chain position, causing more reactions to be rejected, thus reducing the number of simulated reactions per second. This figure also shows that the number of non-empty molecule species peaks around the gel point. The simulation speed increases again after the gel point, as the number of molecule species decreases.

Further analysis of reaction rejection was performed. A total of 97.8%of the selected reactions was rejected, accounting for a total of roughly 86% of the simulation time. Making the simulation rejection-free could thus lead to a speedup of roughly 600%.

As expected the simulator used far more memory when not deleting empty molecule species and ran out of memory at around 52% conversion. However, the results of this incomplete simulation clearly show the relation between the number of tracked molecule species and simulation speed. Dips in speed are clearly visible when the BITs are doubled in size, as this doubling increases the time needed for sampling and updating the BITs. The outliers in simulation speed at the end of the simulation are presumably caused by the Java garbage collector, as more memory needs to be freed as the memory limit is approached.

Figure 7.13b shows the influence of detail level on the speed of a structured simulation. It is clear that the use of a lower detail level has no significant impact on the simulation speed, even though the number of unique structural models is greatly lowered. Furthermore note that the simulation ended at 23.5%conversion as that is when the maximum 3D model limitXof 999 was reached. The structured

(a)Simulation speed of unstructured simulation. (b)Simulation speed of structured simulation. Figure 7.13:Simulation speeds of both structured and unstructured simulation with a billion initial

moleculescT. Figure 7.13a shows how the simulation speed depends onK, the total number of different molecule species in the simulation. The reaction speed in these graphs is given in simulated reactions per second. For comparison the graph in this figure also shows the simulation speed of a simulation where non-empty species were not deleted, and the number of total molecule species K. Figure 7.13b shows the

differences in simulation speed for the two detail levels defined in Section 5.2.4 and the total number of structural models when using these detail levels.

Simulation memory usage The memory usage of both a unstructured and structured simulation is plotted against conversion in the graphs in Figure 7.14. The memory usage peaks at the start of the simulation. This is presumably partly caused by the higher simulation speed, meaning that more unreachable Java objects are created before the Java garbage collector frees up memory by deleting these. As simulation speed decreases, so does the memory usage. This is clearly visible in the memory usage of the structured simulation which lowers when the simulation speed decreases at around 8.5%conversion. As expected, the structured simulation consumes more memory and the memory usage seems to increase faster as the size of the structural models increases.

(a)Memory usage of unstructured simulation. (b)Memory usage of structured simulation. Figure 7.14:Memory usage of both the structured and unstructured simulation with a billion initial

moleculescT. This is the memory used as obtained from the Java Runtime Environ- ment and does not include reserved memory by the Java Virtual Machine.

Chapter 8

Conclusions and recommendations

8.1 Contributions and requirement fulfillment

The simulator described in this work fulfills the requirements listed in Section 1.4. We used a chemical model that combines our own model for intramolecular crosslinking, as discussed in Section 4.3.3, with the steric hindrance model by Tripathiet al., as presented in [28], thus fulfilling Requirement R 1. We also created a method to read and generate Excel files from program code, allowing for both easy simulation configuration by the user as well as effortless changes to the number of simulation parameters of our simulation. This was discussed in Section 6.2. As one of our simulation parameters was a function that converts a molecule to the interaction volume of that molecule, a parser for such mathematical equations was created. As the user can thus change all necessary simulation parameters, we consider Requirement R 2 fulfilled.

This parser was further extended for the extraction of data from the simulation, so it allows the user to describe which properties to obtain from a set of molecules. This allows for the calculation of mass polydispersity, molecular weight distributions, average polymer size and crosslink density, as we have shown in Sections 6.3 and 7.1.1. We also created a time and memory efficient structural model, which can be converted to 3D molecule models, as described in Section 5.4. This covers all necessary output types to fulfill Requirement R 3. As mentioned in Section 6.3.2, data points are calculated at fixed conversion intervals, thus giving multiple data points over the course of a simulation and fulfilling Requirement R 5.

The last requirement, R 4, has also been fulfilled, as shown in Section 7.4. Efficient scaling was achieved by our novel approach of tracking molecular reactivities rather than reaction rates, as described in Section 5.2.2. These reactivities were tracked using Binary Indexed Trees (BITs). The use of binary trees is not uncommon in KMC simulations [95]. However, the use of BITs, which have lower memory usage than regular binary trees, is a novel approach.