Skip to main content
1-Visitor
March 19, 2018
Solved

Question on how to count the number of iterations for an Mathcad equation

  • March 19, 2018
  • 9 replies
  • 4209 views

What command or operation i have to do in order to find the number of iterations performed for solving an Mathcad equation like f(x):=e^x-x       that has in the final the solution 0.5671?

 

I need to find the number of iterations in order to evaluate the efficiency of the solving method.

 

I searched a lot for this aspect and I'm surprised that nobody had this question until now.

Best answer by tubar

Thank you again. Now, the problem is solved for me.

 

In Mathcad Prime the Debugging function was not possible like for Mathcad 15 View> Toolbars> Debug     resulting Trace Window.

 

In fact the best version of Mathcad remains for me Mathcad 13 where the displayed equations weren't limited at the  length.   Today, especially in Symbolic Tool , when results a very long equation it will not be displayed unfortunately. However, it is another subject.

 

I attached the updated files from your suggestions. Maybe will benefit others in the future.

 

 

 

9 replies

25-Diamond I
March 19, 2018

Simply return a vector with both value of interest:

Unbenannt.PNG

tubar1-VisitorAuthor
1-Visitor
March 19, 2018

Thank you very much! It worked for both versions, Mathcad 15 and Mathcad Prime too.

 

 

Also, a history of the iterations it is possible to be presented?  For example, in Mathcad 15 exists a function Trace(x) that permits the view of the succesive values of the root x in a Trace Window.

 

However, in Mathcad Prime I cannot find the history of values of x in a Trace Window. I dont know why.

25-Diamond I
March 19, 2018

Prime is clearly inferior to Mathcad in many ways and is missing a lot of functionality compared to Mathcad.

The trace function simply is not implemented in Prime.

To return the history you'd like to see you could store all x-values in a vector and return that vector instead of the last calculated value.

Unbenannt.PNG

24-Ruby IV
March 19, 2018

In Mathcad 15 with the trace function:

bis.png

tubar1-VisitorAuthor
1-Visitor
March 19, 2018

Thank you. Indeed, the debugging functions are available in Mathcad 15 but Mathcad Prime missed this functionality.