Martin,
Thank you again for your comments and code.
I have given a little more thought to this issue and have spoken a
little with my son, Jason, who is a champion triathlete. He described
a little of his biking strategies and was very helpful. Among other
things our discussion reminded me that my style is very aversive to
shifting the crank cog, which I assumed was just my style, but it
sounds like he too avoids such changes, but does so more than I. He
said his focus is more on cadence counting, which I have never
mastered. He also said his newest bike has 2 and 11 (22) gears, and he
claims to use about 19 of them.
The upshot of our discussion was that I thought I would look more into
trying to find how many (consecutive) gear change steps among the
rear hub gears would be roughly equivalent to a single step change of
the crank gears for different gearing systems. This is quite different
from studying the correct sequence of gear shifts to make as if they
were made quasi-linearly (changing both front and rear gears together,
if necessary), as my previous analysis implied. I now see that my
earlier analysis would only be relevant if there were an automatic
shift system because human bikers are not likely to behave that way.
That earlier analysis could be helpful to see which ranges of rear hub
gears are desirable with each crank cog gear, I suppose. So I did
manage to filter out the "oblique" cases you identified.
indices =: {@;&(i...@#)
ratios =: <"0@(/:~...@[ %/ \:~...@]) NB. sorted and boxed
combined =: ,&>/@,:&, NB. indices and ratios
gears0 =: indices combined ratios
famend =: _:`((([:< 0 1;~<:@#...@])))`] NB. fast cog
samend =: _:`((([:< _1 _2;~0:)))`] NB. slow cog
oamend =: _:`((([:< 0 _1;~...@}:@i...@#@])))`] NB. other cog
amends =: [: oamend}~ [: samend}~ famend}~
filter =: (_&~:#])@,@ame...@i.@,&#
filtgears =: filter{gears0
rhub=: 32 26 21 18 16 14 12 11
ccog=: 28 38 48
ccog filtgears rhub
NB. or for your bike
rhub =. 25 23 21 19 17 16 15 14 13
ccog =. 39 53
ccog filtgears rhub
NB. "tableau2" stitches increase ratios within hub groups
NB. not increases between adjacents in the tableau
NB. the increases are stitched to the right of tableau2
rratios =: #...@[,@($,:) (1,~2 %/\ \:~...@])
formatrratios =: (1) 0 3 4&{@(5j2&":)\ rratios
sortRatios2=: /:_2&{"1
rhubgroups =: sortRatios2@ (filter{gears0,."....@formatrratios)
tableau2 =: {:,.~1&{ ,. -...@{. (|."0 1 ) >:@{:@{.{.!._"0 (_2&{)
tableau2 |: ccog rhubgroups rhub
2%~/\ccog NB. compare ccog changes to rhub changes above
NB. below is an annotated output
rhub =. 25 23 21 19 17 16 15 14 13
ccog =. 39 53
tableau2 |: ccog rhubgroups rhub
0 1.56 _ 9 <---1.69565%1.56 is 1.09
1 1.69565 _ 10
2 1.85714 _ 11
3 2.05263 _ 12
4 2.29412 _ 6
5 2.4375 _ 7 <---2.6%2.4375 is 1.07
2 _ 2.52381 11
6 2.6 _ 7
3 _ 2.78947 12
4 _ 3.11765 6
5 _ 3.3125 7
6 _ 3.53333 7
7 _ 3.78571 8
8 _ 4.07692 0
53%39
1.35897
1.35897 suggests that changing from low to high crank is similar to 3
or more step increases on the rear hub cogs for these gears. In
contrast on my bike the effect is more similar to about 2 step
increases on the rear hub cogs.
Your code is quite cogent. I used a couple of your ideas but could not
resist returning to my tableaus, too.
Thank you,
--
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm