I am solving a system of 6 linear equations containing six unknowns using mathematica. It is taking too much time and still running after 3 hours. can I estimate the approximate running time? Is there any method to minimize the running time of a programme?
Asked
Active
Viewed 1,179 times
3
-
2Show us the equations. There is no general possible solution on runtime estimates without the actual code and equations. – m0nhawk Mar 14 '16 at 09:11
-
What's wrong with Timing ? Wrap all your code in a single Module if need be and run Timing on it. – Trad Dog Mar 14 '16 at 09:17
-
1@TradDog It measures, not estimates. – Kuba Mar 14 '16 at 09:19
-
3@Kuba I've heard of many experimental physicists who never knew the difference .) – Dr. belisarius Mar 14 '16 at 09:23
1 Answers
4
If your program is already running, there is no way to estimate when it will finish.
If you need to estimate the running time for a function which takes inputs of different sizes, start with small inputs for which the function finishes fast. Measure the time using Timing/AbsoluteTiming. Increase the size of the input, measure the time again. Obtain a few data points this way. Try to guess the complexity of the algorithm form the result and extrapolate to larger inputs.
How to minimize the running time of a program? This is answered here in great detail: