program to compute gears, with table

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

program to compute gears, with table

Emanuel Berg-4
Hey guys, does this look right to you?

;; (print-gears '(34 50) '(12 13 15 17 19 21 23 25) 622)
;;
;;                          =>
;;
;; 622 wheel
;;
;; chainring   sprocket   gear
;;
;;    34          25      2657.5360544880004
;;    34          23      2888.626146182609
;;    34          21      3163.7333982000005
;;    34          19      3496.7579664315795
;;    50          25      3908.1412566000004
;;    34          17      3908.1412566000004
;;    50          23      4247.97962673913
;;    34          15      4429.226757480001
;;    50          21      4652.549115000001
;;    34          13      5110.64625863077
;;    50          19      5142.291127105264
;;    34          12      5536.5334468500005
;;    50          17      5747.266553823531
;;    50          15      6513.568761
;;    50          13      7515.656262692309
;;    50          12      8141.960951250001

(require 'cl-lib)

(defun compute-gear (chainring sprocket wheel)
  (let*((pi     3.14159265)
        (radius (/ wheel 2.0))
        (circum (* 2 radius pi))
        (gear   (* (/ chainring sprocket 1.0) circum)))
    (list chainring sprocket gear)))

(defun gear (chainrings sprockets wheel)
  (let*((gears
         (cl-loop for c in chainrings
                  append (cl-loop for s in sprockets
                                  collect (compute-gear c s wheel) )
                  )))
        (cl-sort gears #'<= :key #'cl-caddr)))

(defun print-gears (chainrings sprockets wheel)
  (let ((out-buffer (get-buffer-create "*Gears*")))
    (with-current-buffer out-buffer
      (erase-buffer)
      (insert (format "%s wheel\n\n" wheel))
      (insert "chainring   sprocket   gear\n\n")
      (let ((gears (gear chainrings sprockets wheel)))
        (cl-loop for g in gears
                 do (let ((c (   car   g))
                          (s (   cadr  g))
                          (d (cl-caddr g)))
                      (insert (format "   %s          %s      %s\n" c s d)) ))))
    (pop-to-buffer out-buffer) ))

--
underground experts united
http://user.it.uu.se/~embe8573
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Graham

"Emanuel Berg" <[hidden email]> wrote in message news:[hidden email]...

> Hey guys, does this look right to you?
>
> ;; (print-gears '(34 50) '(12 13 15 17 19 21 23 25) 622)
> ;;
> ;;                          =>
> ;;
> ;; 622 wheel
> ;;
> ;; chainring   sprocket   gear
> ;;
> ;;    34          25      2657.5360544880004
> ;;    34          23      2888.626146182609
> ;;    34          21      3163.7333982000005
> ;;    34          19      3496.7579664315795
> ;;    50          25      3908.1412566000004
> ;;    34          17      3908.1412566000004
> ;;    50          23      4247.97962673913
> ;;    34          15      4429.226757480001
> ;;    50          21      4652.549115000001
> ;;    34          13      5110.64625863077
> ;;    50          19      5142.291127105264
> ;;    34          12      5536.5334468500005
> ;;    50          17      5747.266553823531
> ;;    50          15      6513.568761
> ;;    50          13      7515.656262692309
> ;;    50          12      8141.960951250001
>
> (require 'cl-lib)
>
> (defun compute-gear (chainring sprocket wheel)
>  (let*((pi     3.14159265)
>        (radius (/ wheel 2.0))
>        (circum (* 2 radius pi))
>        (gear   (* (/ chainring sprocket 1.0) circum)))
>    (list chainring sprocket gear)))
>
> (defun gear (chainrings sprockets wheel)
>  (let*((gears
>         (cl-loop for c in chainrings
>                  append (cl-loop for s in sprockets
>                                  collect (compute-gear c s wheel) )
>                  )))
>        (cl-sort gears #'<= :key #'cl-caddr)))
>
> (defun print-gears (chainrings sprockets wheel)
>  (let ((out-buffer (get-buffer-create "*Gears*")))
>    (with-current-buffer out-buffer
>      (erase-buffer)
>      (insert (format "%s wheel\n\n" wheel))
>      (insert "chainring   sprocket   gear\n\n")
>      (let ((gears (gear chainrings sprockets wheel)))
>        (cl-loop for g in gears
>                 do (let ((c (   car   g))
>                          (s (   cadr  g))
>                          (d (cl-caddr g)))
>                      (insert (format "   %s          %s      %s\n" c s d)) ))))
>    (pop-to-buffer out-buffer) ))
>
> --
> underground experts united
> http://user.it.uu.se/~embe8573

Not sure about your code as I do not speak that language but a quick check gives:

622*3.142*50/25=3908.648mm

So if your definition of gear is roll out in mm then it looks close. Do not forget to include the tyre. See:

https://www.cateye.com/data/resources/Tire_size_chart_ENG.pdf

for approximate circumferences. Taking a 23mm tyre the above example would be:
2096*50/25=4192mm

Graham.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Skip Montanaro
In reply to this post by Emanuel Berg-4
Something's fishy. Is the result mm of forward travel per crank revolution?
I'm used to seeing gear inches. Your 50x12 should be about 110 gear inches.
If your output is in millimeters, I get about 320 gear inches, so either
I've mistaken your intended units, or there's a mistake in there somewhere.

A couple nits which won't change anything:

* Why the 1.0 divisor when computing gear?

* You can skip the radius and use wheel (diameter) directly in computing
the circumference.

* It never occurred to me to do this in Lisp. I always just use an online
calculator, like:

http://www.gear-calculator.com/?GR=DERS&KB=34,50&RZ=12,13,15,17,19,21,23,25&UF=2150&TF=90&SL=2.6&UN=KMH

Skip

P.S. My latest acquisition (and oldest bike):
https://www.flickr.com/photos/49705339@N00/albums/72157686279443084


On Fri, Sep 8, 2017 at 12:33 AM, Emanuel Berg <[hidden email]> wrote:

> Hey guys, does this look right to you?
>
> ;; (print-gears '(34 50) '(12 13 15 17 19 21 23 25) 622)
> ;;
> ;;                          =>
> ;;
> ;; 622 wheel
> ;;
> ;; chainring   sprocket   gear
> ;;
> ;;    34          25      2657.5360544880004
> ;;    34          23      2888.626146182609
> ;;    34          21      3163.7333982000005
> ;;    34          19      3496.7579664315795
> ;;    50          25      3908.1412566000004
> ;;    34          17      3908.1412566000004
> ;;    50          23      4247.97962673913
> ;;    34          15      4429.226757480001
> ;;    50          21      4652.549115000001
> ;;    34          13      5110.64625863077
> ;;    50          19      5142.291127105264
> ;;    34          12      5536.5334468500005
> ;;    50          17      5747.266553823531
> ;;    50          15      6513.568761
> ;;    50          13      7515.656262692309
> ;;    50          12      8141.960951250001
>
> (require 'cl-lib)
>
> (defun compute-gear (chainring sprocket wheel)
>   (let*((pi     3.14159265)
>         (radius (/ wheel 2.0))
>         (circum (* 2 radius pi))
>         (gear   (* (/ chainring sprocket 1.0) circum)))
>     (list chainring sprocket gear)))
>
> (defun gear (chainrings sprockets wheel)
>   (let*((gears
>          (cl-loop for c in chainrings
>                   append (cl-loop for s in sprockets
>                                   collect (compute-gear c s wheel) )
>                   )))
>         (cl-sort gears #'<= :key #'cl-caddr)))
>
> (defun print-gears (chainrings sprockets wheel)
>   (let ((out-buffer (get-buffer-create "*Gears*")))
>     (with-current-buffer out-buffer
>       (erase-buffer)
>       (insert (format "%s wheel\n\n" wheel))
>       (insert "chainring   sprocket   gear\n\n")
>       (let ((gears (gear chainrings sprockets wheel)))
>         (cl-loop for g in gears
>                  do (let ((c (   car   g))
>                           (s (   cadr  g))
>                           (d (cl-caddr g)))
>                       (insert (format "   %s          %s      %s\n" c s
> d)) ))))
>     (pop-to-buffer out-buffer) ))
>
> --
> underground experts united
> http://user.it.uu.se/~embe8573
>
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Tomas Zerolo
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Sep 08, 2017 at 06:09:30AM -0500, Skip Montanaro wrote:

[...]

> * Why the 1.0 divisor when computing gear?

because...

  (/ 2 3)     => 0
  (/ 2 3 1.0) => 0.6666666666666666

(division defaults to integer division when all args are int)

As to the rest... I'll defer to Emmanuel :-)

Cheers
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEUEARECAAYFAlmyfrYACgkQBcgs9XrR2kZ7VwCfb/Q8fxCgdzAZoTDvv0x1oYOf
gHYAl2aPVP/v2vsz9f/DovXuOfWvYCg=
=UcUu
-----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Skip Montanaro
> because...
>
>   (/ 2 3)     => 0
>   (/ 2 3 1.0) => 0.6666666666666666
>
> (division defaults to integer division when all args are int)

Ah, right. Been awhile since I did anything with ELisp (or any other
Lisp). I've gotten used to Python's // operator when I need integer
division.

S

Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Frank Krygowski
In reply to this post by Graham
On 9/8/2017 4:46 AM, Graham wrote:

>
> "Emanuel Berg" <[hidden email]> wrote in message news:[hidden email]...
>> Hey guys, does this look right to you?
>>
>> ;; (print-gears '(34 50) '(12 13 15 17 19 21 23 25) 622)
>> ;;
>> ;;                          =>
>> ;;
>> ;; 622 wheel
>> ;;
>> ;; chainring   sprocket   gear
>> ;;
>> ;;    34          25      2657.5360544880004
>> ;;    34          23      2888.626146182609
>> ;;    34          21      3163.7333982000005
>> ;;    34          19      3496.7579664315795
>> ;;    50          25      3908.1412566000004
>> ;;    34          17      3908.1412566000004
>> ;;    50          23      4247.97962673913
>> ;;    34          15      4429.226757480001
>> ;;    50          21      4652.549115000001
>> ;;    34          13      5110.64625863077
>> ;;    50          19      5142.291127105264
>> ;;    34          12      5536.5334468500005
>> ;;    50          17      5747.266553823531
>> ;;    50          15      6513.568761
>> ;;    50          13      7515.656262692309
>> ;;    50          12      8141.960951250001
>>
>> (require 'cl-lib)
>>
>> (defun compute-gear (chainring sprocket wheel)
>>   (let*((pi     3.14159265)
>>         (radius (/ wheel 2.0))
>>         (circum (* 2 radius pi))
>>         (gear   (* (/ chainring sprocket 1.0) circum)))
>>     (list chainring sprocket gear)))
>>
>> (defun gear (chainrings sprockets wheel)
>>   (let*((gears
>>          (cl-loop for c in chainrings
>>                   append (cl-loop for s in sprockets
>>                                   collect (compute-gear c s wheel) )
>>                   )))
>>         (cl-sort gears #'<= :key #'cl-caddr)))
>>
>> (defun print-gears (chainrings sprockets wheel)
>>   (let ((out-buffer (get-buffer-create "*Gears*")))
>>     (with-current-buffer out-buffer
>>       (erase-buffer)
>>       (insert (format "%s wheel\n\n" wheel))
>>       (insert "chainring   sprocket   gear\n\n")
>>       (let ((gears (gear chainrings sprockets wheel)))
>>         (cl-loop for g in gears
>>                  do (let ((c (   car   g))
>>                           (s (   cadr  g))
>>                           (d (cl-caddr g)))
>>                       (insert (format "   %s          %s      %s\n" c s d)) ))))
>>     (pop-to-buffer out-buffer) ))
>>
>> --
>> underground experts united
>> http://user.it.uu.se/~embe8573
>
> Not sure about your code as I do not speak that language but a quick check gives:
>
> 622*3.142*50/25=3908.648mm
>
> So if your definition of gear is roll out in mm then it looks close. Do not forget to include the tyre. See:
>
> https://www.cateye.com/data/resources/Tire_size_chart_ENG.pdf
>
> for approximate circumferences. Taking a 23mm tyre the above example would be:
> 2096*50/25=4192mm
>
> Graham.

Right, don't forget to include the tire.  622 is bead seat diameter, but
you want (effective) outside diameter instead.

I first did such a thing in the 1970s, using Fortran. But I formatted it
as a compact table in rows and columns.  You could have one row for each
chainring, one column for each rear cog. A matrix, 2x8.

Another useful trick is to plot the gear development on a logarithmic
scale, so the change from one gear to the next is scaled as the
percentage change. Plotting using a separate row or a separate symbol
for each chainring makes clear which gear is "next" in your gear
progression.

These days, it's probably easiest to do all the above using a
spreadsheet, such as LibreOffice Calc. Or Micros**t Excel.

BTW, back when there were only five rear cogs and a person wanted a wide
range with uniform or other logical spacing, plotting gear development
(or "gear inches," in "inch" countries) was a useful tool for the art of
bike design. These days, with up to 11 cogs in back, the entire exercise
isn't as valuable as it once was.

--
- Frank Krygowski
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

David Scheidt
In reply to this post by Emanuel Berg-4
In rec.bicycles.tech Emanuel Berg <[hidden email]> wrote:
:Hey guys, does this look right to you?

As noted, you need to consider the diameter of the wheel including its tire.  

The style is awful.  In straight common lisp:

(defun compute-gear (chainring sprocket wheel)
  (list chainring sprocket (* (/ chainring sprocket) (* 3.14 wheel))))    

(defun gear (chainring sprocket w)
  (let ((g))
    (dolist (c chainring)
      (dolist (s sprocket)
        (push (compute-gear c s w) g)))
    (sort g #'< :key #'third)))

(defun print-gears (chainring sprocket wheel)
  (format nil "~:{ ~d ~d ~f ~%~}" (gear chainring sprocket wheel)))





--
sig 46
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Emanuel Berg-4
In reply to this post by Graham
Graham wrote:

> So if your definition of gear is roll out in
> mm then it looks close. Do not forget to
> include the tyre.

Right, perhaps I should change "gear" into
"roll out" if that's the agreed-upon term.
Perhaps I should even make it print the
formulae first thing.

And I'll include the tyre. Excellent :)

--
underground experts united
http://user.it.uu.se/~embe8573
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Emanuel Berg-4
In reply to this post by Emanuel Berg-4
Skip Montanaro wrote:

> * Why the 1.0 divisor when computing gear?

As explained, otherwise it'll be integer
division. But I think that qualifies as a hack
(not an ugly hack tho) so there is no shame in
spotting it an "error" :)

> * You can skip the radius and use wheel
> (diameter) directly in computing
> the circumference.

Right!

> * It never occurred to me to do this in Lisp.
> I always just use an online calculator, like:
>
> http://www.gear-calculator.com/?GR=DERS&KB=34,50&RZ=12,13,15,17,19,21,23,25&UF=2150&TF=90&SL=2.6&UN=KMH

Let's agree there is no need to do it in Lisp.
Only a desire :)

--
underground experts united
http://user.it.uu.se/~embe8573
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Joerg
On 2017-09-08 10:52, Emanuel Berg wrote:

> Skip Montanaro wrote:
>
>> * Why the 1.0 divisor when computing gear?
>
> As explained, otherwise it'll be integer
> division. But I think that qualifies as a hack
> (not an ugly hack tho) so there is no shame in
> spotting it an "error" :)
>
>> * You can skip the radius and use wheel
>> (diameter) directly in computing
>> the circumference.
>
> Right!
>
>> * It never occurred to me to do this in Lisp.
>> I always just use an online calculator, like:
>>
>> http://www.gear-calculator.com/?GR=DERS&KB=34,50&RZ=12,13,15,17,19,21,23,25&UF=2150&TF=90&SL=2.6&UN=KMH
>
> Let's agree there is no need to do it in Lisp.
> Only a desire :)
>

Why make things complicated? I do such stuff with spreadsheets. That's
what they were invented for. Part of every office software including
free ones.

--
Regards, Joerg

http://www.analogconsultants.com/
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

David Scheidt
In rec.bicycles.tech Joerg <[hidden email]> wrote:
:On 2017-09-08 10:52, Emanuel Berg wrote:
:> Skip Montanaro wrote:
:>
:>> * Why the 1.0 divisor when computing gear?
:>
:> As explained, otherwise it'll be integer
:> division. But I think that qualifies as a hack
:> (not an ugly hack tho) so there is no shame in
:> spotting it an "error" :)
:>
:>> * You can skip the radius and use wheel
:>> (diameter) directly in computing
:>> the circumference.
:>
:> Right!
:>
:>> * It never occurred to me to do this in Lisp.
:>> I always just use an online calculator, like:
:>>
:>> http://www.gear-calculator.com/?GR=DERS&KB=34,50&RZ=12,13,15,17,19,21,23,25&UF=2150&TF=90&SL=2.6&UN=KMH
:>
:> Let's agree there is no need to do it in Lisp.
:> Only a desire :)
:>

:Why make things complicated? I do such stuff with spreadsheets. That's
:what they were invented for. Part of every office software including
:free ones.

I rewrote his code in common lisp in less time than it takes excel to
start.  


--
sig 106
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Emanuel Berg-4
In reply to this post by Frank Krygowski
Frank Krygowski wrote:

> I first did such a thing in the 1970s, using
> Fortran.

Cool! Fortran (Formula Translation, 1957)
sounds like the perfect idea. Perhaps the
formating (output report) should be left to
COBOL tho :) (Common business-oriented
language, 1959).

Today I think the hipsters at the universities
would use Haskell (1990).

> But I formatted it as a compact table in rows
> and columns. You could have one row for each
> chainring, one column for each rear cog.
> A matrix, 2x8.

The idea with having it 8x3 was that the third
column would be the "roll out" and that would
be sorted vertically.

But perhaps I'll add a feature to flip
it later.

> Another useful trick is to plot the gear
> development on a logarithmic scale, so the
> change from one gear to the next is scaled as
> the percentage change. Plotting using
> a separate row or a separate symbol for each
> chainring makes clear which gear is "next" in
> your gear progression.

Yes, I thought about doing that. Perhaps with
ASCII art or using gnuplot which I did some
cool plots with. Here is one:

    http://user.it.uu.se/~embe8573/figures/gnuplot/science-inverted.png

--
underground experts united
http://user.it.uu.se/~embe8573
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Emanuel Berg-4
In reply to this post by David Scheidt
David Scheidt wrote:

> The style is awful. In straight
> common lisp [...]

Ha! I've heard about the bicycle style police
but I always thought that refered to shaved
legs and keeping the helmet straps to the
inside of the sunglasses scalps! Or wait...
should it be the other way around?

Well, styles make fights, and "pushing" is
never part of my game plan. But it does look
neater with `dolist' and `push' and it might be
more efficient as well as I don't know the
intricacies of append and collect. Not that it
will ever matter in this case, of course.

--
underground experts united
http://user.it.uu.se/~embe8573
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Emanuel Berg-4
In reply to this post by Joerg
Joerg wrote:

> Why make things complicated?

It isn't - it's fun :)

> I do such stuff with spreadsheets.

When done, feeding a CLI tool with data from
the shell is faster and more pleasant (cooler)
than using a spreadsheet. It can then also be
combined with other such tools, tho I admit
that probably won't happen in this case (?).

A spreadsheet is of course a fine way to do it
as well.

> That's what they were invented for.

Programming languages were also invented for
this kind of... computing :)

--
underground experts united
http://user.it.uu.se/~embe8573
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Emanuel Berg-4
In reply to this post by David Scheidt
David Scheidt wrote:

> I rewrote his code in common lisp in less
> time than it takes excel to start.

It really doesn't get any faster than these
lovely small shell tools :)


    you gotta give me more and more
    cuz you're the one that I adore
                      (Zodiac 1996)


--
underground experts united
http://user.it.uu.se/~embe8573
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Joerg
In reply to this post by David Scheidt
On 2017-09-08 12:59, David Scheidt wrote:

> In rec.bicycles.tech Joerg <[hidden email]> wrote:
> :On 2017-09-08 10:52, Emanuel Berg wrote:
> :> Skip Montanaro wrote:
> :>
> :>> * Why the 1.0 divisor when computing gear?
> :>
> :> As explained, otherwise it'll be integer
> :> division. But I think that qualifies as a hack
> :> (not an ugly hack tho) so there is no shame in
> :> spotting it an "error" :)
> :>
> :>> * You can skip the radius and use wheel
> :>> (diameter) directly in computing
> :>> the circumference.
> :>
> :> Right!
> :>
> :>> * It never occurred to me to do this in Lisp.
> :>> I always just use an online calculator, like:
> :>>
> :>> http://www.gear-calculator.com/?GR=DERS&KB=34,50&RZ=12,13,15,17,19,21,23,25&UF=2150&TF=90&SL=2.6&UN=KMH
> :>
> :> Let's agree there is no need to do it in Lisp.
> :> Only a desire :)
> :>
>
> :Why make things complicated? I do such stuff with spreadsheets. That's
> :what they were invented for. Part of every office software including
> :free ones.
>
> I rewrote his code in common lisp in less time than it takes excel to
> start.
>

Wow, you must be able to type at hundreds of letter a second. Here, it
takes less than 2sec for Excel to start. Mostly only a split second to
open the file because I usually have it running nearly all the time.

--
Regards, Joerg

http://www.analogconsultants.com/
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Emanuel Berg-4
Joerg wrote:

> Wow, you must be able to type at hundreds of
> letter a second. Here, it takes less than
> 2sec for Excel to start. Mostly only a split
> second to open the file because I usually
> have it running nearly all the time.

But it is faster to feed data into a shell
tool, hit RET and have the result outputted.

And yes, programmers type very quickly indeed.

On a general note, if you care about time (the
perception thereof) you should throw the
computer into a rock wall and be done with it.

--
underground experts united
http://user.it.uu.se/~embe8573
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Tomas Nordin-2
In reply to this post by Joerg

> Why make things complicated? I do such stuff with spreadsheets. That's
> what they were invented for. Part of every office software including
> free ones.

As pointed out already, maybe because it's fun. Maybe because you're
curious if you can do such thing in lisp. Maybe you realize that if you
do it you will learn more lisp as you go. Maybe you would like to write
it with a tool that is perfectly suited for public discussion and review
on a certain mailing list to get some useful feedback. Maybe you want to
start out playing with a language you love for a later implementation of
a cooler on-line calculator. And so on...

Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

David Scheidt
In reply to this post by Joerg
In rec.bicycles.tech Joerg <[hidden email]> wrote:
:On 2017-09-08 12:59, David Scheidt wrote:
:> In rec.bicycles.tech Joerg <[hidden email]> wrote:
:> :On 2017-09-08 10:52, Emanuel Berg wrote:
:> :> Skip Montanaro wrote:
:> :>
:> :>> * Why the 1.0 divisor when computing gear?
:> :>
:> :> As explained, otherwise it'll be integer
:> :> division. But I think that qualifies as a hack
:> :> (not an ugly hack tho) so there is no shame in
:> :> spotting it an "error" :)
:> :>
:> :>> * You can skip the radius and use wheel
:> :>> (diameter) directly in computing
:> :>> the circumference.
:> :>
:> :> Right!
:> :>
:> :>> * It never occurred to me to do this in Lisp.
:> :>> I always just use an online calculator, like:
:> :>>
:> :>> http://www.gear-calculator.com/?GR=DERS&KB=34,50&RZ=12,13,15,17,19,21,23,25&UF=2150&TF=90&SL=2.6&UN=KMH
:> :>
:> :> Let's agree there is no need to do it in Lisp.
:> :> Only a desire :)
:> :>
:>
:> :Why make things complicated? I do such stuff with spreadsheets. That's
:> :what they were invented for. Part of every office software including
:> :free ones.
:>
:> I rewrote his code in common lisp in less time than it takes excel to
:> start.
:>

:Wow, you must be able to type at hundreds of letter a second. Here, it
:takes less than 2sec for Excel to start. Mostly only a split second to
:open the file because I usually have it running nearly all the time.

On my mac at work, from the time I double click the excel icon to the
time it is ready to do work is over a minute.  It's a modern machine,
running an old version of excel.  The windows machine I have, but
never use, which is more powerful, and running a current version,
takes even longer.  It does have a spinny disk, and not an ssd.
(that's not counting the time to takes to boot up, since it's off.)

--
sig 57
Reply | Threaded
Open this post in threaded view
|

Re: program to compute gears, with table

Joerg
On 2017-09-09 19:06, David Scheidt wrote:

> In rec.bicycles.tech Joerg <[hidden email]> wrote:
> :On 2017-09-08 12:59, David Scheidt wrote:
> :> In rec.bicycles.tech Joerg <[hidden email]> wrote:
> :> :On 2017-09-08 10:52, Emanuel Berg wrote:
> :> :> Skip Montanaro wrote:
> :> :>
> :> :>> * Why the 1.0 divisor when computing gear?
> :> :>
> :> :> As explained, otherwise it'll be integer
> :> :> division. But I think that qualifies as a hack
> :> :> (not an ugly hack tho) so there is no shame in
> :> :> spotting it an "error" :)
> :> :>
> :> :>> * You can skip the radius and use wheel
> :> :>> (diameter) directly in computing
> :> :>> the circumference.
> :> :>
> :> :> Right!
> :> :>
> :> :>> * It never occurred to me to do this in Lisp.
> :> :>> I always just use an online calculator, like:
> :> :>>
> :> :>> http://www.gear-calculator.com/?GR=DERS&KB=34,50&RZ=12,13,15,17,19,21,23,25&UF=2150&TF=90&SL=2.6&UN=KMH
> :> :>
> :> :> Let's agree there is no need to do it in Lisp.
> :> :> Only a desire :)
> :> :>
> :>
> :> :Why make things complicated? I do such stuff with spreadsheets. That's
> :> :what they were invented for. Part of every office software including
> :> :free ones.
> :>
> :> I rewrote his code in common lisp in less time than it takes excel to
> :> start.
> :>
>
> :Wow, you must be able to type at hundreds of letter a second. Here, it
> :takes less than 2sec for Excel to start. Mostly only a split second to
> :open the file because I usually have it running nearly all the time.
>
> On my mac at work, from the time I double click the excel icon to the
> time it is ready to do work is over a minute.  It's a modern machine,
> running an old version of excel.


I suggest you use a PC instead, and a contemporary one. If it was more
than a couple of seconds I'd be concerned about something not being
right with the computer.


>                              ... The windows machine I have, but
> never use, which is more powerful, and running a current version,
> takes even longer.  It does have a spinny disk, and not an ssd.
> (that's not counting the time to takes to boot up, since it's off.)
>

Looks like your computers need some serious clean-up. I just tried it on
mine (Dell XPS8700, no SSD, regular HD). It takes such a small fraction
of one second that it is impossible to gauge the milliseconds from click
to Excel being open. I would need a camera and count the frames.

--
Regards, Joerg

http://www.analogconsultants.com/
12