Hi Justin,

Justin Mason escreveu:
> hi Fidelis --
> 
> talking of EDDC, I'm running into a bit of wierdness with the equation
> published in http://osbf-lua.luaforge.net/papers/osbf-eddc.pdf --
> specifically the final CF(F) equation on page 5. Using the K1, K2 and K3
> values suggested, I cannot reproduce the values in the graph below it.
> 
> According to the graph, what I should see are values like this:
> 
>     Dfs    Dfh    CF
>     100    100    0
>     0      100    1
>     100    0      1

Yes, that's the "ideal" curve... good for explaining and visualizing the
effects of the CF.

> what I actually get are:
> 
>     Dfs    Dfh    CF
>     100    100    1.19134681363401e-07
>     0      100    0.124843632959153
>     100    0      0.124843632959153

But when it comes to practice we need some adjustments... the second
term,  ($WdotSumf / (1.0 + $K3 * $WdotSumf)), limits the max value to
approx. 1/$K3 for large $WdotSumf, that is 1/8 (0.125) in this case.

You can get a good approximation of the ideal curve by setting $K3 to 1:

s=100 h=0 w=3125 cf=0.999994300021052
s=100 h=100 w=3125 cf=9.53671598439468e-07
s=0 h=100 w=3125 cf=0.999994300021052

$K3 = 1 was my first attempt but experiments showed that higher values
produce better accuracy, with a maximum around 8.

> 
> Here's the (perl) code I used to implement this:
> 
>   my $Dfs = 100;
>   my $Dfh = 0;
>   my $weight = 3125;   # demo, assume a strong token
>   my $K1 = 0.25;
>   my $K2 = 10;
>   my $K3 = 8;
> 
>   my $NDfs = $Dfs;  # assume Dfs/Dfh are normalized for demo purposes
>   my $NDfh = $Dfh;
>   my $Sumf = $Dfs + $Dfh; die "assert: Sumf == 0" unless $Sumf;
>   my $NDeltaf = $NDfs - $NDfh;
>   my $NSumf = $NDfs + $NDfh;
>   my $WdotSumf = $weight * $Sumf;
> 
>   # the CF(F) equation
>   my $CF = (((($NDeltaf ** 2) + ($NDfs * $NDfh) - ($K1 / $Sumf))
>               / ($NSumf ** 2)) ** $K2)
>             * ($WdotSumf
>               / (1.0 + $K3 * $WdotSumf));
> 
>   print "s=$Dfs h=$Dfh w=$weight cf=$CF\n";
> 
> 
> (sorry about the perl, but hopefully it's readable enough.)

No problems, perfectly readable :).

> I've run through this logic on paper, against the equations, and I can't
> spot an error -- the equation really seems to produce incorrect output.
> Could you take a look?   Am I missing something?

Hope it's clearer now.

-- 
Fidelis Assis

Reply via email to