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

SOLVED
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.

Thank you very much!

Shawn

1 ACCEPTED SOLUTION

Accepted Solutions
Regular Member
(in response to sfan)

Re: Why the root function cannot converge?

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

I hope this helps.

Norm

6 REPLIES 6
Regular Member
(in response to sfan)

Re: Why the root function cannot converge?

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

I hope this helps.

Norm

Re: Why the root function cannot converge?

Yes, that trick works.

Thank you very much!

Re: Why the root function cannot converge?

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.

Re: Why the root function cannot converge?

 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

Re: Why the root function cannot converge?

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!

Re: Why the root function cannot converge?

 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

Announcements
Check out the latest