Message Boards Message Boards

2
|
935 Views
|
13 Replies
|
6 Total Likes
View groups...
Share
Share this post:

FindMinimum code working on V9 but not V14

Posted 4 months ago

The attached code works in Mathematica 9 (see attached M9).

But it doesn't work in Mathematica 14 (see M14).

M9 and M14 are exactly the same, but the results are different when you calculate it in Mathematica 9 and Mathematica 14.

The difference is in the FindMinimum command.

The last part of the program, data500 - data20, checks the answer, but in Mathematica 9, it is almost 0, and FindMinimum is functioning normally.

In contrast, in Mathematica 14, data500 - data20 is not 0, and FindMinimum is not functioning normally.

How should I modify FindMinimum to get the same calculation results as in Mathematica 9 in order to run this program in Mathematica 14?

Attachments:
13 Replies

The calculations using FindMinimum in Mathematica ver.9-11.2 can be verified in Mathematica ver.14 as well. The attached "U235 Checking the solution" shows the calculations performed in Mathematica ver.14 using the solution obtained from Mathematica ver.11.2. When the obtained solution is substituted back into the original equation and the difference is calculated, it becomes nearly 0, confirming that the calculation is correct.

Attachments:

Professor Gianluca Gorni,

Thank you for your response.

I have also recalculated and here are my findings:

  1. I calculated U235NEW revision1 using both ver14 and ver11.2, but it did not converge, so I believe the solution is likely incorrect. (I apologize. My previous response was my mistake.)

  2. I calculated U235OLD revision1 using ver11.2, and it converged, so I believe this is likely correct.

  3. I calculated U235OLD revision1 using ver14, but I could not obtain the correct solution.

Thank you very much for performing various calculations for me.

I have made the calculations of the minimum point again, and it seems correct. The old solution U235OLD is probably wrong. I cannot say for sure, because you do not report the full solution. I cannot say more, because I am not an expert in numerical optimization. I enclose the notebook with my calculations and comments.

Attachments:
POSTED BY: Gianluca Gorni

Professor Gianluca Gorni,

I apologize.

I was mistaken. The question below was incorrect.

The correct question is as follows:

The attached U235OLD is the result calculated with Ver11.2, and the curve is mountain-shaped. The attached U235NEW is the result calculated with Ver14, and the curve is valley-shaped.

Since the coefficient of x² is 1 and the coefficient of x is approximately 92 (the atomic number of U), both calculations should be correct.

Could you please revise the calculation in the attached U235NEW to make the curve mountain-shaped?

I would appreciate your guidance.

Below is the incorrect question:

I have tried various calculations based on the code you provided.

As a result, when I used the same code to perform calculations and plot graphs in Version 11.2, as shown in the attached "Calculation of U235 (ver11.2)," the graph appeared mountain-shaped.

However, when I used the exact same code to perform calculations and plot graphs in Version 14, as shown in the attached "Calculation of U235 (ver14)," the graph appeared valley-shaped.

I would greatly appreciate it if you could kindly instruct me on how to make the graph appear mountain-shaped in Version 14, as it did in Version 11.2.

Thank you very much for your assistance.

Attachments:

Professor Gianluca Gorni,

Thank you for attaching the materials.

I immediately calculated the attached file you sent, and it computed correctly and converged.

However, there are some slight differences from the calculation results of Mathematica Ver9, which concerns me. I would like to try various things myself.

I wanted to express my gratitude promptly.

Yes, here is the notebook with my code.

Attachments:
POSTED BY: Gianluca Gorni

Professor Gianluca Gorni,

Thank you for your response.

I tried to perform the calculations you taught me using Mathematica ver14, but I couldn't get it to work properly.

I'm sorry to trouble you, but could you please attach the file with your calculations?

Thank you in advance.

I just discovered that FindMinimum works fine after the change of variables k[n,m]->1/j[n,m]:

oldVars = Flatten[z];
newVars = oldVars /. k -> j;
changeOfVars = Thread[oldVars -> 1/newVars];
sol = FindMinimum[Total[w^2] /. changeOfVars, newVars]
sol /. (j[n__] -> v_) :> (k[n] -> 1/v)

We should check if the solution coincides with the one in version 9.

POSTED BY: Gianluca Gorni

Question Regarding Execution of FindMinimum Function Program

Program Overview The attached Mathematica code performs the following physics calculations for nuclear fission:

  1. Calculation Objectives: Computation of charge distribution of fission fragments Determination of initial distance (effective fission distance) between two fission fragments at the moment of fission Calculation of excitation energy possessed by each fission fragment

  2. Data Source: Fission yield data from JENDL5 (Japanese Evaluated Nuclear Data Library version 5)

  3. Target Nuclides: Np237 Pu239 Pu242 U235 U238

Current Issues 1. Version Compatibility Problems: Mathematica 9.011.2: Functions correctly Mathematica 11.3 and later: Computation fails Mathematica 14: Still nonfunctional

  1. Specific Problems: Optimization calculations cannot be executed due to changes in FindMinimum function specifications Traditional calculation methods no longer work in current versions

Technical Questions To enable calculations in Mathematica 14 environment: 1. How should the FindMinimum function settings be modified? 2. What alternative approaches are possible?

Thank you for your response. The solution for k in Version 9 has no particular significance. I apologize, but please look at the new attachment "U235". This η20 represents the distance (fm) between two fission fragments immediately after nuclear fission. For example, η20[atomic number 28, atomic number 64] indicates that the distance between these two fission fragments is 0.930472 fm. Additionally, this calculation can be performed in Mathematica versions 9 through 11.2. Correct solutions cannot be obtained in later versions.

Note: "fm" refers to femtometer, which is a unit of length commonly used in nuclear physics (1 fm = 10⁻¹⁵ meters).

Attachments:
Posted 1 month ago

I don't have version 9. What is the minimum value and are the solutions for the k's in version 9?

POSTED BY: Updating Name

This code performs important nuclear fission physics calculations. Specifically:

Purpose: - Uses nuclear fission yield data from JENDL-5 (Japanese Evaluated Nuclear Data Library version 5) - Calculates initial distance between two fission fragments at the moment of fission (effective fission distance) - Targets actinide nuclides (Np-237, Pu-239, Pu-240, U-235, U-238)

Issue: - Calculations work properly in Mathematica versions 9 to 11.2 - Cannot perform calculations in Mathematica 11.3 and later due to changes in FindMinimum specifications - Same issue exists in current Mathematica 14

Technical Question: How can we make FindMinimum function in the current version?

The goal is to make these important nuclear physics calculations executable in Mathematica 14.

The previous code was too long. I've revised it to just the bare minimum.

The attached code works in Mathematica 9 (see attached simple M9).

But it doesn't work in Mathematica 14 (see simple M14).

simpleM9 and simpleM14 are exactly the same, but the results are different when you calculate it in Mathematica 9 and Mathematica 14.

The difference is in the FindMinimum command.

The last part of the program, g - y, checks the answer, but in Mathematica 9, it is almost 0, and FindMinimum is functioning normally.

In contrast, in Mathematica 14,g - y is not 0, and FindMinimum is not functioning normally.

How should I modify FindMinimum to get the same calculation results as in Mathematica 9 in order to run this program in Mathematica 14?

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