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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Why the root function cannot converge?

sfan
1-Newbie

Why the root function cannot converge?

Hi, guys,

Could someone help me with the below problem? Please see the attachment's last page for further details.

Capture.JPG

Thank you very much!

Shawn

1 ACCEPTED SOLUTION

Accepted Solutions
nas0k
7-Bedrock
(To:sfan)

Changing the range from  "0" to "1" to  "0.1" to "1" seems to fix the problem.

I hope this helps.

Norm

View solution in original post

6 REPLIES 6
nas0k
7-Bedrock
(To:sfan)

Changing the range from  "0" to "1" to  "0.1" to "1" seems to fix the problem.

I hope this helps.

Norm

sfan
1-Newbie
(To:nas0k)

Yes, that trick works.

Thank you very much!

RichardJ
19-Tanzanite
(To:sfan)

I'm not sure I would label it as a "trick". I can't read your worksheet, but I suspect it's more of a valuable lesson in numerical computing. I don't know what the function u(t) is, but I suspect that if you try to evaluate du(0) you will get a divide by zero error.

StuartBruff
23-Emerald II
(To:RichardJ)

Richard Jackson wrote:

I'm not sure I would label it as a "trick". I can't read your worksheet, but I suspect it's more of a valuable lesson in numerical computing. I don't know what the function u(t) is, but I suspect that if you try to evaluate du(0) you will get a divide by zero error.

Well, depends how you define "trick", I suppose, but the word had much the same effect on me as it seems to have done on you.  You are right - a quick look at the function reveals that there is a discontinuity at t = 0, leading to a failure of du(0) to converge hence the error.  The "trick", as Norman has said, is to simply shift the range into the region where the function is continuous ...

The "Real Trick" here is to plot the function over a sufficient range to show where likely problems are going to occur, evaluate the functions at "The Usual Suspects",  and to make due allowances for them taking into account the limitations of the numerical tools (eg, avoid discontinuities!). 

Stuart

Yes, I presume the time domain as positive, therefore I missed the negative part.

Given the discontinuity, I understand why the "trick" works.

This is a good thought to check the range for the root function.

Thank you Stuart!

StuartBruff
23-Emerald II
(To:sfan)

Shawn Fan wrote:

Yes, I presume the time domain as positive, therefore I missed the negative part.

Given the discontinuity, I understand why the "trick" works.

This is a good thought to check the range for the root function.

No problem, Shawn ... I suspect most of have scars from being bitten by this particular dog and its friends!    Numeric routines are particularly prone to wagging their tails nicely most of the time, then turning round and snapping at you for some seemingly unfathomable reason.  It helps to understand a little bit about solvers in general to give some clue as to why they are returning bizarre results, or failing to return results at all, for some problem where the solution is obvious even to a two-year old.

Stuart

Top Tags