Mathematica NMinimize Program Running Slow - What's Wrong?
- Context: Mathematica
- Thread starter shafieza_garl
- Start date
-
- Tags
- Mathematica
Click For Summary
Discussion Overview
The discussion revolves around a Mathematica program using NMinimize that is running slowly. Participants are exploring potential coding issues, particularly focusing on the definitions of functions and the structure of integrals within the code.
Discussion Character
- Technical explanation
- Debate/contested
- Mathematical reasoning
Main Points Raised
- One participant reports that their NMinimize program is taking a long time to solve and seeks help with the coding problem.
- Another participant suggests sharing the code using specific formatting to facilitate analysis.
- A participant provides the original code and highlights the use of several parameters and functions defined through integrals.
- One participant recommends changing the assignment operator from = to := for delayed assignments in the definitions of functions R, F, and H to ensure proper substitution of variables.
- This same participant rewrites the code using NIntegrate instead of Integrate, suggesting that it may improve performance for numerical solutions.
- Another participant identifies that the calculation of H[x0, x1] + H[x1, x2] + H[x2, x3] is significantly contributing to the slow performance of the minimization process.
- This participant notes that changing variable names and simplifying expressions did not yield significant improvements in execution time.
- Concerns are raised about the structure of the nested integrals and the potential for optimizing them, though uncertainty remains about the correctness of these modifications.
Areas of Agreement / Disagreement
Participants express differing views on the causes of the slow performance, with some focusing on the definition of the function H and others on the overall structure of the code. There is no consensus on a definitive solution or approach to resolve the performance issues.
Contextual Notes
Participants note that the numerical integration may have inherent challenges, and the specific behavior of the function H is not oscillating or discontinuous, which raises questions about its computational efficiency.
Similar threads
- · Replies 2 ·
- · Replies 2 ·
- · Replies 4 ·
- · Replies 5 ·
- · Replies 1 ·
- · Replies 9 ·
- · Replies 3 ·
- · Replies 5 ·
- · Replies 1 ·
- · Replies 11 ·