Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: Compare two dates - what's Renard Series?

by pryrt (Abbot)
on Jul 25, 2019 at 17:20 UTC ( [id://11103390]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Compare two dates - what's Renard Series?
in thread Compare two dates

I know you've said you better understand it now... but there was a small point that I like, that I don't think was brought out enough. Like AnomalousMonk's link to resistor tolerances implies (but doesn't say explicitly enough, IMO): one of the nice things about the series is that it keeps allowable tolerance consistent. If you're manufacturing widgets, and your manufacturing has 0.1mm tolerance, then doing widgets in sizes 1,2,3,4,5,6,7,8,9,10 is reasonable; none of the widget sizes will overlap. But if you manufacture with 10% tolerance, then the step from 1 to 2 is fine, because 1+10%=1.1 doesn't overlap with 2-10%=1.8. But at the step from 9 to 10, 9+10%=9.9 and 10-10%=9, so a value of 9 is a technically valid 9+-10% or 10+/-10% widget. If you count the "maximum allowable tolerance" as the point where the lower value shifted up by the tolerance and the upper value shifted down by the tolerance are equals, then you can see:

#!/usr/bin/env perl # Preferred Numbers: https://perlmonks.org/?node_id=11103336 my $prev = 1; for my $this ( 2 .. 10 ) { # an x% change can fit between $prev and $this # x% changes, depending on $this # Overlap will start if x% is such that prev * (1+x%) == this * (1 +-x%) # algebra: # p*(1+x) = t*(1-x) # p + px = t - tx # (p+t)x = t-p # x = (t-p)/(p+t) # x% = 100%*x my $xpct = ($this-$prev) / ($this+$prev) * 100; printf "linear: %.2f .. %.2f => %.2f%%\n", $prev, $this, $xpct; } continue { $prev = $this; } print "\n"; my $prev = 1; for my $i ( 1 .. 10 ) { # now go in 10 logarithmic steps $this = $prev * (10**(1/10)); my $xpct = ($this-$prev) / ($this+$prev) * 100; printf "logarithmic: %.2f .. %.2f => %.2f%%\n", $prev, $this, $xpc +t; } continue { $prev = $this; } print "\n"; my $prev = 1; for my $i ( 1 .. 10 ) { # now go in 10 logarithmic steps $this = 10**($i/10); my $round_p = int($prev*10+0.5)/10; my $round_t = int($this*10+0.5)/10; my $xpct = ($round_t-$round_p) / ($round_t+$round_p) * 100; printf "rounded logarithmic: %.2f .. %.2f => %.2f%%\n", $round_p, +$round_t, $xpct; } continue { $prev = $this; } __END__ linear: 1.00 .. 2.00 => 33.33% linear: 2.00 .. 3.00 => 20.00% linear: 3.00 .. 4.00 => 14.29% linear: 4.00 .. 5.00 => 11.11% linear: 5.00 .. 6.00 => 9.09% linear: 6.00 .. 7.00 => 7.69% linear: 7.00 .. 8.00 => 6.67% linear: 8.00 .. 9.00 => 5.88% linear: 9.00 .. 10.00 => 5.26% logarithmic: 1.00 .. 1.26 => 11.46% logarithmic: 1.26 .. 1.58 => 11.46% logarithmic: 1.58 .. 2.00 => 11.46% logarithmic: 2.00 .. 2.51 => 11.46% logarithmic: 2.51 .. 3.16 => 11.46% logarithmic: 3.16 .. 3.98 => 11.46% logarithmic: 3.98 .. 5.01 => 11.46% logarithmic: 5.01 .. 6.31 => 11.46% logarithmic: 6.31 .. 7.94 => 11.46% logarithmic: 7.94 .. 10.00 => 11.46% rounded logarithmic: 1.00 .. 1.30 => 13.04% rounded logarithmic: 1.30 .. 1.60 => 10.34% rounded logarithmic: 1.60 .. 2.00 => 11.11% rounded logarithmic: 2.00 .. 2.50 => 11.11% rounded logarithmic: 2.50 .. 3.20 => 12.28% rounded logarithmic: 3.20 .. 4.00 => 11.11% rounded logarithmic: 4.00 .. 5.00 => 11.11% rounded logarithmic: 5.00 .. 6.30 => 11.50% rounded logarithmic: 6.30 .. 7.90 => 11.27% rounded logarithmic: 7.90 .. 10.00 => 11.73%

The linear scale wastes a lot of the tolerance near the low end, so you can have 30%, but at the high end, you can really only have 5% tolerance on the widgets. However, if you're doing 5% widgets, at the low end, you'll have big gaps, and a customer will complain that they want an intermediate value. With the even-logarithmic steps, every step between sizes will have the same amount of "room" for the tolerances, so if you can manufacture the widgets with 10% tolerance, they'll all nicely fit, with no overlap between sizes. (Even with some rounding on the Preferred Numbers in the 10-logarithmic steps will still show about the same tolerance range, and can handle 10% tolerance just fine.)

Replies are listed 'Best First'.
Re^5: Compare two dates - what's Renard Series?
by bliako (Monsignor) on Jul 26, 2019 at 13:46 UTC

    I am interested in manufacturing, from the point of centrally planning an economy. Albeit, I had no practical exposure to it ever and so all this stuff and your explanation is interesting and helpful.

    Wouldn't increasing tolerances just for the sake of not overlapping, going to be a headache for users? Is this "best practice" in design? I mean I buy 2 screws and the bigger one has double (percentage-wise) tolerance than that of the smaller one!

      ... increasing tolerances just for the sake of not overlapping ... 2 screws and the bigger one has double (percentage-wise) tolerance ...

      But the tolerances of the items in question do not change, only their ranges of absolute value. E.g., for 10% (i.e., +/-10%) resistors, a 100 ohm resistor has a range of 90 to 110 ohms, the 82 ohm resistor "below" it ranges over 73.8 - 90.2 ohms, and the 120 ohm resistor "above" it ranges over 108 - 132 ohms. At the other end of that magnitude, 820, 1000 and 1200 ohm 10% resistors range over 738 - 902, 900 - 1100 and 1080 - 1320 ohms respectively.


      Give a man a fish:  <%-{-{-{-<

        oh my mistake, I thought the firsts-in-the-scale are 5%. Reading it again they all have 10% tolerance and do not overlap. which is win-win.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11103390]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found