LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to indicate that UDF didn't converge?


I have a handful of UDF's that use iterative algorithms to numericall
arrive at a solution (usually either a Newton-Raphson type algorithm o
successive approximations). I like to put a check on the number o
iterations, to prevent getting stuck in an infinite loop should th
problem diverge. Generic function looks something like:

function myudf(arglist, optional init)
if ismissing(init) then init= some reasonable initial guess for generi
problems of this sort
code setting up initial values for the iteration
it=0
do
it=it+1
iteration code to find next value from old value
loop until convergeance criteria or it=100
myudf=result
end function

What I would like to add is something to let me know when th
convergeance criteria hasn't been met, but rather the function ha
ended because we've reached the maximum number of iterations. I'm jus
looking for ideas. How would you inform me that the function reache
maxiterations without converging? message box? have the functio
return an error? other possibility?

Thanks in advance

--
MrShort
-----------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php...fo&userid=2218
View this thread: http://www.excelforum.com/showthread.php?threadid=49559

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converge tabs Andrianna Excel Discussion (Misc queries) 1 June 23rd 06 07:13 AM


All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"