Group Abstract Group Abstract

Message Boards Message Boards

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

FindMinimum code working on V9 but not V14

Posted 1 year 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

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

Yes, here is the notebook with my code.

Attachments:
POSTED BY: Gianluca Gorni

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:

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
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.

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.

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?

Attachments:
Posted 10 months 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

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