## 4 Findings and Accuracy  
The results of the finished code applied to the nine sets of testing data will now be discussed and compared to the comparative results that were derived from the initially provided two methods, as well as the briefly mentioned average method that wa derived as an additional part of this project. Figure 5 acts as a qualitative comparison of the original simple processing methods of the maximum energy determination to the described gradient method (as well as the aforementioned inefficient average method). These data were the result of processing of the four methods on the first shot shown in Figure 3. As can be seen, the gradient method calculates a deviation from the reference value of 4.2 nanoseconds, compared to the original smallest deviation of 0.092 microseconds (energy distribution calculation) showing a drastically increased accuracy. This pattern was observed across all of the training and testing datasets that were gathered. Figure 4: Voltage gradient at each point within the region of interest of Figure 3 shot 1. Dataset size = 40,000 points; range value = 200 points. A drastic decrease in the noise and a clear rising edge can be seen acting as an estimate of the maximum proton energy. Table 1 shows the predicted manually gathered values and calculated values for five of the testing shots. As can be clearly seen, in the time domain a constant high level of accuracy is maintained regardless of S/N ratio, which was significantly higher for the first three shots in comparison to the latter two (a comparison to that seen in Figure 3 can be made). The accuracy was calculated based on the total deviation of the algorithmically selected point from the point that was chosen by eye as a fraction of the overall dataset size within the time domain. Over the 15 training sets, the calculated answer deviated from the manually gathered answer by an average of 0.24% of the dataset, showing a consistently reliable level of accuracy. The deviation was noticeably higher on average for lower S/N ratio shots with a direct proportionality between the two, as can be seen in the data of Table 1 by noting that the shots are arranged in order of decreasing S/N ratio. This is trivial as a more noise-dominant dataset would provide larger complications for the data processing algorithm. It is worth noting that these results are presented in the time domain as opposed to the energy domain. Despite the energy domains more distinct relevance to the project as a whole, the time domain was chosen to display the project results due to a larger consistency across datasets. As a result of the squared component that is present within \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Shot No.**} & \begin{tabular}{c} **By-Eye** \\ **Estimate** \\ **Time/\(\mu\)s** \\ \end{tabular} & \begin{tabular}{c} **Algorithm** \\ **Calculated** \\ **Time/\(\mu\)s** \\ \end{tabular} & \
\begin{tabular}{c} **By-Eye** \\ **Estimate** \\ **Energy/KeV** \\ \end{tabular} &
\begin{tabular}{c} **Algorithm** \\ **Calculated** \\ **Energy/KeV** \\ \end{tabular} & \multirow{2}{*}{**Accuracy \%**} \\ \hline
1 & 0.206 & 0.202 & 3.966 & 4.125 & 0.042 \\ \hline
2 & 0.229 & 0.221 & 3.207 & 3.454 & 0.088 \\ \hline
3 & 0.206 & 0.191 & 3.967 & 4.656 & 0.163 \\ \hline
4 & 0.414 & 0.434 & 0.522 & 0.897 & 0.212 \\ \hline
5 & 0.314 & 0.279 & 1.709 & 2.163 & 0.368 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Gradient-method calculated predictions of shortest time-of-arrival and corresponding max. proton energies for a number of the training datasets, along with the corresponding equivalent energies. Shots arranged in order of decreasing S/N ratio. The accuracy was calculated from the deviation between estimate and algorithm answers as a percentage of full dataset size. Figure 5: The point determined as the shortest time-of-flight (maximum proton energy) for codes original simplified methods compared to the newly designed algorithms for a single training dataset (Figure 3 shot 1).