cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

How to count the number of iteration required for Convergence in a Solve block?

SushilGuhe
1-Newbie

How to count the number of iteration required for Convergence in a Solve block?

How to count the number of iteration required for Convergence in a Solve block?

Discription:

I have solved some nonlinear equations using Find command, but i want to know how many iteration it is taking to get to convergence?

Can any one help me out in doing this?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
MikeArmstrong
5-Regular Member
(To:SushilGuhe)

Yes, move the find function down the page a bit.

Mike

View solution in original post

27 REPLIES 27
MikeArmstrong
5-Regular Member
(To:SushilGuhe)

Is it possible to upload a worksheet?

Mike

Hello!

Try to use "debugging functions". To bring up the Debug toolbar, choose View> Toolbars> Debug.

VladimirN. wrote:

Hello!

Try to use "debugging functions". To bring up the Debug toolbar, choose View> Toolbars> Debug.

For the root function:

http://twt.mpei.ac.ru/ochkov/Mathcad_12/2_02a_Trace.gif

Hi VladimirVladimirN.

Thank you for reply!

As my MachCad version is 10.0, there is no debug option in toolbar, is there any other option to find the number of iteration?

Is the debug option is available in higher versions?

Sushil

Yes, it is available. I recommend to upgrade to Mathcad 15.

P.S. The debugger has appeared in Mathcad 13.

Trace of the Given-Find block:

http://twt.mpei.ac.ru/ochkov/Mathcad_12/2_28b_Trace_Solve.GIF

MikeArmstrong
5-Regular Member
(To:ValeryOchkov)

Trace of the Given-Find block:

http://twt.mpei.ac.ru/ochkov/Mathcad_12/2_28b_Trace_Solve.GIF

Nice example Valery, There are several examples in the help file on the trace function, but none as nice as yours. It's a shame that the results are displayed in the debugging textbox though.

Mike

Hi Mike,

Thank you for such a nice explaination for counting the Iteration.

Sushil.

RichardJ
19-Tanzanite
(To:SushilGuhe)

As my MachCad version is 10.0, there is no debug option in toolbar, is there any other option to find the number of iteration?

This works in version 11, and I think it should work in version 2001i (i.e. version 10). Be aware that it will slow down the solve block. In versions 12 and later scripted components run MUCH slower (up to two orders of magnitude slower!) so it will make the solve block very slow. In version 13 it works, but you need a lot of patience! Version 15 is less painful, but only because the solve block converges faster (43 iterations instead of over 300).

I don't have 12 or 14 installed. I expect the behavior in 12 to be the same as in 13, and in 14 to be the same as in 15.

MikeArmstrong
5-Regular Member
(To:RichardJ)

That is superb, very impressed

Mike

Hi All,

i have attached here a mathcad file, in which i am trying to find the number of iteration it is taking to get to the final converged solution.

Can anybody help me out on this.

Thank you

MikeArmstrong
5-Regular Member
(To:SushilGuhe)

Have a look at the attached.

Mike

Hi Mike,

Thank You for the quick solution.

Can you tell me the procedure how you have done it?

Thank you

MikeArmstrong
5-Regular Member
(To:SushilGuhe)

I have used the trace function which is the scripted component posted by Richard and included it in your worksheet as shown in the attached image.

You can change the variable as you choose.

Mike

In one of system of non linear equation i have defined my variable as a0,a1,a2, b0,b1,b3. In this case the method discribed by you is not working.

Is it because we cannot define varibles as combination of alphabet and numerical?

MikeArmstrong
5-Regular Member
(To:SushilGuhe)

Can you provide an example please?

Mike

In my last sheet if i put x = a0 b = a2 a = b0 b = b1

Then can i follow the same procedure?

Hi Mike,

I think that problem is not in definition of varibles. As i have done the same thing in new worksheet with same example it is not working for me.

Even i have copied all the content from your sheet and pasted it to new worksheet it is not working for me.

I am attaching here the same thing, can you tell what is the difference in your and my worksheet? why it is not working for me?

Sushil

MikeArmstrong
5-Regular Member
(To:SushilGuhe)

It works for me. I got 416 iterations using the trace function.

Mike

For me it is showing some error, i have attached snap shot of this.

Can you tell me why it is coming for me?

MikeArmstrong
5-Regular Member
(To:SushilGuhe)

Yes, move the find function down the page a bit.

Mike

Thnkyou mike!

With moving down the function it is working.

I got my solution, thank you very much!

MikeArmstrong
5-Regular Member
(To:SushilGuhe)

No Problem at all.

Mike

RichardJ
19-Tanzanite
(To:SushilGuhe)

If you only have version 10 how did you save it in .xmcd format?

I have downloaded demo version of MathCad 14.0 from PTC site.

RichardJ
19-Tanzanite
(To:SushilGuhe)

I see. To make it work in version 10 you will need to move the scripted component above the solve block.

Thank you all for your kind involvement into this discussion and support.

I got my solution and it was not at all possible without all of your support.

Thank you very much!

Sushil

Top Tags