Programming Tips


Main programing steps
  1. Create a data structure corresponding to the Nuclei map
  2. Read the input file
  3. Find solutions and use them
  4. Display and plot

Put the classes into a matrix (see Figure 1) or dictionary/Hash map and create pointers to the nuclides for the different types of processes that can happen (alpha, beta min, beta plus decay and neutron absorption and fission), so for example β--decay of nuclei points to nuclei.

nuclear waste array of classes.JPG
Figure 1: Shows a small portion of the nuclei map built from classes

Create a method to read the file given. Have each nuclei as a class, you will also need the cross-section for absorption and fission, and the branching of the different decay modes (see figure 2).

nulear waste simulation class .JPG
Figure 2: Shows what a nuclei class should contain

Tip: remember that the file format defines the format of the values
Create a way to do all of the calculations needed for one time step and then use the new values in the next time step. Here you will also need to choose the unit of the time step and convert the half-life correspondingly (sec time step= sec half-life)
Tip: Keep the values for amount calculated and the amount present at the start of the time step separate AmountN and AmountN+1

There is a lot of different ways, for example display all the final values or plot some nuclei defined up front, have the values saved to a file in a spread sheet format. Have it displayed as a 2d matrix, containing the nuclei name and end amount.