I am working on a Mathematica program to analyze fission yield data of U-235. The program calculates results for 5 different patterns based on neutron incident energies. While the calculation works correctly for pattern = 3, it produces errors for other patterns such as pattern = 1.
Key errors include:
Union::normal: Nonatomic expression expected at position 1 in Union[vars12].
Part::take: Cannot take positions 6 through 42 in datax2.
FindMinimum::vloc: The variable Union[vars12] cannot be localized so that it can be assigned to numerical values.
The result Reff becomes undefined (Indeterminate) or infinite.
What might be causing these issues, and how can I modify the code to ensure correct calculations for all patterns?
Note:
When running the program on Mathematica version 11.3 or later, changes in the FindMinimum
function result in errors even for the previously working pattern. Therefore, I kindly request that this issue be evaluated on Mathematica version 11.2.
Attachments: