Re: (newbie) Find Max Number In An Array
- From: "alanglloyd@xxxxxxx" <alanglloyd@xxxxxxx>
- Date: 28 Jun 2006 03:39:24 -0700
Nektarios - Greece wrote:
<snip>
X Y
--------
25 0.571
26 0.555
27 0.534
28 0.530
29 0.535
30 0.541
etc
You can use a variant of Newton's approximation for roots of an
equation.
You can readily find the value of an integer for which Y is the
"minimum by integer". As you do that store the values for X and Y for
the values of X BEFORE that, and also store the values of X and Y AFTER
that one.
Lets call the values BEFORE the integer minimum X[L] and Y[L], the
values at the integer minimum X[M] and Y[M], and the values AFTER the
integer minimum X[N] and Y[N].
Then a better value for XMin is ...
X[M] - ( (Y[N] - Y[L]) / (2(Y[L] + Y[N] - (Y[M] * 2))) )
.... or in the example 28 - 0.055 =~ 27.95
Alan Lloyd
.
- References:
- (newbie) Find Max Number In An Array
- From: Nektarios - Greece
- Re: (newbie) Find Max Number In An Array
- From: Marco van de Voort
- Re: (newbie) Find Max Number In An Array
- From: Nektarios - Greece
- Re: (newbie) Find Max Number In An Array
- From: Marco van de Voort
- Re: (newbie) Find Max Number In An Array
- From: Nektarios - Greece
- (newbie) Find Max Number In An Array
- Prev by Date: (newbie) Find Max Number In An Array
- Next by Date: Re: Possible TImageList bug in D7? or..?
- Previous by thread: Re: (newbie) Find Max Number In An Array
- Next by thread: Re: (newbie) Find Max Number In An Array
- Index(es):
Relevant Pages
|