3
$\begingroup$

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?

$\endgroup$
4
  • 2
    $\begingroup$ Show us the equations. There is no general possible solution on runtime estimates without the actual code and equations. $\endgroup$
    – m0nhawk
    Mar 14 '16 at 9:11
  • $\begingroup$ What's wrong with Timing ? Wrap all your code in a single Module if need be and run Timing on it. $\endgroup$
    – Trad Dog
    Mar 14 '16 at 9:17
  • 1
    $\begingroup$ @TradDog It measures, not estimates. $\endgroup$
    – Kuba
    Mar 14 '16 at 9:19
  • 3
    $\begingroup$ @Kuba I've heard of many experimental physicists who never knew the difference .) $\endgroup$ Mar 14 '16 at 9:23
4
$\begingroup$

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:

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.