Message Boards Message Boards

0
|
300 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Errors in code for fission yield analysis across different patterns

Posted 12 days ago

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:

Resolved

I have resolved this issue. The cause was in the loop index configuration.

The following code: For[gxIndex = 1, gxIndex <= Length[gxValues], gxIndex++,

was replaced with: For[gxIndex = statnum, gxIndex <= endnum, gxIndex++,

By properly setting statnum and endnum, the loop now correctly reflects the calculation range, and all patterns work as expected. I apologize for any confusion caused and hope this solution helps others facing a similar issue.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract