Optimizing Execution Time for Linear Code in Mathematica with a P4 Processor

  • Thread starter Thread starter Amar.alchemy
  • Start date Start date
  • Tags Tags
    Mathematica Time
AI Thread Summary
The execution time for the provided Mathematica code on a P4 processor is significantly impacted by the large upper limit of the loop, which is 47,888,755,200. The code is linear, meaning its execution time scales with the number of iterations. A suggested approach is to test the code with a smaller range, such as 10,000 iterations, to estimate the execution time for the larger loop. By calculating the time taken for the smaller loop and scaling it accordingly, a more accurate estimate can be derived. The original code may take an impractical amount of time to execute due to the high iteration count.
Amar.alchemy
Messages
78
Reaction score
0
Kindly tell me how much time it may take to execute the below code in Mathematica software in a P4 Processor. Because I executed the below for nearly 5 mins but still it didn't display answer.

For[i = 1, i <= 47888755200, i++, If[i == 47888755100, Print]]
 
Mathematics news on Phys.org
Amar.alchemy said:
Kindly tell me how much time it may take to execute the below code in Mathematica software in a P4 Processor. Because I executed the below for nearly 5 mins but still it didn't display answer.

For[i = 1, i <= 47888755200, i++, If[i == 47888755100, Print]]


I think we can assume this code is linear. So, what you have to do is:
For[i = 1, i <= 10000, i++, If[i == x, Print]]

Where x is (10000/47888755100)*47888755200. Count the time with a function that gives you the time it takes, the time for your computation would be something like t0*47888755200/10000.


Greetz,
Littlepig
 
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Back
Top