Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: an easy one?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88897] Re: an easy one?
  • From: dh <dh at metrohm.ch>
  • Date: Tue, 20 May 2008 06:54:14 -0400 (EDT)
  • References: <g0tr2f$mn5$1@smc.vnet.net>


Hi Francisco,

as you do not give an explicite example, I make one up: calculation of 

Sqrt[2] using Newtons method: xnew= xold+ f[xold]/f'[xold] starting with 

1.. Where f[x]= x^2-2 and we want an error <10^-6:

NestWhileList[#+(2-#^2)/(2#)&,1.,Abs[#^2-2]>10^-6&]

hope this helps, Daniel



Francisco Gutierrez wrote:

> I have a code (for clustering) that works well with FixedPointList.

>   It takes the following form:

>   FixedPointList[veamos[dataset,#]&, prototipos,10]

>    

>   where veamos is a function that acts on the dataset and prototipos,

>   and prototipos is also a list of lists (for example {{5,5},{10,10}} )

>    

>   But of course using FixedPointList is imperfect. I want to use NestWhileList instead, with a criterion of termination acting on prototipos (i.e., if the absolute value of the substraction of the penultimate prototipos and the last prototipos is less than a certain amount, say 0.01, then stop).

>    

>   But I haven´t been able.

>   Can somebody help me?

>   Thanks

>   Francisco Gutiérrez

> 





-- 



Daniel Huber

Metrohm Ltd.

Oberdorfstr. 68

CH-9100 Herisau

Tel. +41 71 353 8585, Fax +41 71 353 8907

E-Mail:<mailto:dh at metrohm.com>

Internet:<http://www.metrohm.com>




  • Prev by Date: DumpSave of packages
  • Next by Date: Cannot NSolve a system of equations
  • Previous by thread: Re: an easy one?
  • Next by thread: Re: Re: an easy one?