Logarithmic interval ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Logarithmic interval ?

Karl Ramberg
Hi,
Does anybody know of a logarithmic interval implementation in Squeak where the steps in the interval go by logarithmic scale instead of linear ?

Best,
Karl



Reply | Threaded
Open this post in threaded view
|

Re: Logarithmic interval ?

Nicolas Cellier
Yes,
But i don't remember if published somewhere... I'll check this evening or tomorrow 

Le dim. 3 févr. 2019 à 16:43, karl ramberg <[hidden email]> a écrit :
Hi,
Does anybody know of a logarithmic interval implementation in Squeak where the steps in the interval go by logarithmic scale instead of linear ?

Best,
Karl




Reply | Threaded
Open this post in threaded view
|

Re: Logarithmic interval ?

Karl Ramberg
I used a workaround that probably is more flexible since I have several variables that need the logarithm

steps := 100.
xLog := 0.02 log: steps.
yLog := 1.894 log: steps
1 to: steps do:[:i|    
          x := i raisedTo: xLog.
          y := i raisedTo: yLog.
          ]

Best,
Karl



On Sun, Feb 3, 2019 at 5:10 PM Nicolas Cellier <[hidden email]> wrote:
Yes,
But i don't remember if published somewhere... I'll check this evening or tomorrow 

Le dim. 3 févr. 2019 à 16:43, karl ramberg <[hidden email]> a écrit :
Hi,
Does anybody know of a logarithmic interval implementation in Squeak where the steps in the interval go by logarithmic scale instead of linear ?

Best,
Karl





Reply | Threaded
Open this post in threaded view
|

Re: Logarithmic interval ?

Nicolas Cellier
Hi karl,
This is not a logarithmic interval. The progression should be geometric, that is with a constant ratio.

    x3/x2 = (x2/x1).

The ith element of geometric serie should be something like

    (ratio raisedTo: i-1) * start.

Le dim. 3 févr. 2019 à 18:15, karl ramberg <[hidden email]> a écrit :
I used a workaround that probably is more flexible since I have several variables that need the logarithm

steps := 100.
xLog := 0.02 log: steps.
yLog := 1.894 log: steps
1 to: steps do:[:i|    
          x := i raisedTo: xLog.
          y := i raisedTo: yLog.
          ]

Best,
Karl



On Sun, Feb 3, 2019 at 5:10 PM Nicolas Cellier <[hidden email]> wrote:
Yes,
But i don't remember if published somewhere... I'll check this evening or tomorrow 

Le dim. 3 févr. 2019 à 16:43, karl ramberg <[hidden email]> a écrit :
Hi,
Does anybody know of a logarithmic interval implementation in Squeak where the steps in the interval go by logarithmic scale instead of linear ?

Best,
Karl






Reply | Threaded
Open this post in threaded view
|

Re: Logarithmic interval ?

Karl Ramberg
You are right.
It would be nice to have a logarithmic interval.

Best.
Karl


On Sun, Feb 3, 2019 at 6:37 PM Nicolas Cellier <[hidden email]> wrote:
Hi karl,
This is not a logarithmic interval. The progression should be geometric, that is with a constant ratio.

    x3/x2 = (x2/x1).

The ith element of geometric serie should be something like

    (ratio raisedTo: i-1) * start.

Le dim. 3 févr. 2019 à 18:15, karl ramberg <[hidden email]> a écrit :
I used a workaround that probably is more flexible since I have several variables that need the logarithm

steps := 100.
xLog := 0.02 log: steps.
yLog := 1.894 log: steps
1 to: steps do:[:i|    
          x := i raisedTo: xLog.
          y := i raisedTo: yLog.
          ]

Best,
Karl



On Sun, Feb 3, 2019 at 5:10 PM Nicolas Cellier <[hidden email]> wrote:
Yes,
But i don't remember if published somewhere... I'll check this evening or tomorrow 

Le dim. 3 févr. 2019 à 16:43, karl ramberg <[hidden email]> a écrit :
Hi,
Does anybody know of a logarithmic interval implementation in Squeak where the steps in the interval go by logarithmic scale instead of linear ?

Best,
Karl







Reply | Threaded
Open this post in threaded view
|

Re: Logarithmic interval ?

Nicolas Cellier
Hi Karl, I published GeometricInterval along with some GeometricIntervalTests at

    MCHttpRepository
        location: 'http://www.squeaksource.com/STEM'
        user: ''
        password: ''.

It is a port of VW SYSEXT-GeometricInterval from Cincom public store, a bit revisited.

Le dim. 3 févr. 2019 à 21:18, karl ramberg <[hidden email]> a écrit :
You are right.
It would be nice to have a logarithmic interval.

Best.
Karl


On Sun, Feb 3, 2019 at 6:37 PM Nicolas Cellier <[hidden email]> wrote:
Hi karl,
This is not a logarithmic interval. The progression should be geometric, that is with a constant ratio.

    x3/x2 = (x2/x1).

The ith element of geometric serie should be something like

    (ratio raisedTo: i-1) * start.

Le dim. 3 févr. 2019 à 18:15, karl ramberg <[hidden email]> a écrit :
I used a workaround that probably is more flexible since I have several variables that need the logarithm

steps := 100.
xLog := 0.02 log: steps.
yLog := 1.894 log: steps
1 to: steps do:[:i|    
          x := i raisedTo: xLog.
          y := i raisedTo: yLog.
          ]

Best,
Karl



On Sun, Feb 3, 2019 at 5:10 PM Nicolas Cellier <[hidden email]> wrote:
Yes,
But i don't remember if published somewhere... I'll check this evening or tomorrow 

Le dim. 3 févr. 2019 à 16:43, karl ramberg <[hidden email]> a écrit :
Hi,
Does anybody know of a logarithmic interval implementation in Squeak where the steps in the interval go by logarithmic scale instead of linear ?

Best,
Karl








Reply | Threaded
Open this post in threaded view
|

Re: Logarithmic interval ?

Nicolas Cellier
And I have added a LogarithmicInterval which is more like numpy.logspace.

For a LogarithmicInterval, bounds are specified by their logarithm (in whatever base).

If you want 100 points from 0.1 to: 10.0, then you can write:
    (0.1 log logTo: 10 log size: 100 base: 10).
or:
    (-1 logTo: 1 size: 100 base: 10)
or you can omit the base and use ln/exp
    (0.1 ln logTo: 10 ln size: 100).

Le ven. 8 févr. 2019 à 15:56, Nicolas Cellier <[hidden email]> a écrit :
Hi Karl, I published GeometricInterval along with some GeometricIntervalTests at

    MCHttpRepository
        location: 'http://www.squeaksource.com/STEM'
        user: ''
        password: ''.

It is a port of VW SYSEXT-GeometricInterval from Cincom public store, a bit revisited.

Le dim. 3 févr. 2019 à 21:18, karl ramberg <[hidden email]> a écrit :
You are right.
It would be nice to have a logarithmic interval.

Best.
Karl


On Sun, Feb 3, 2019 at 6:37 PM Nicolas Cellier <[hidden email]> wrote:
Hi karl,
This is not a logarithmic interval. The progression should be geometric, that is with a constant ratio.

    x3/x2 = (x2/x1).

The ith element of geometric serie should be something like

    (ratio raisedTo: i-1) * start.

Le dim. 3 févr. 2019 à 18:15, karl ramberg <[hidden email]> a écrit :
I used a workaround that probably is more flexible since I have several variables that need the logarithm

steps := 100.
xLog := 0.02 log: steps.
yLog := 1.894 log: steps
1 to: steps do:[:i|    
          x := i raisedTo: xLog.
          y := i raisedTo: yLog.
          ]

Best,
Karl



On Sun, Feb 3, 2019 at 5:10 PM Nicolas Cellier <[hidden email]> wrote:
Yes,
But i don't remember if published somewhere... I'll check this evening or tomorrow 

Le dim. 3 févr. 2019 à 16:43, karl ramberg <[hidden email]> a écrit :
Hi,
Does anybody know of a logarithmic interval implementation in Squeak where the steps in the interval go by logarithmic scale instead of linear ?

Best,
Karl








Reply | Threaded
Open this post in threaded view
|

Re: Logarithmic interval ?

Karl Ramberg
Hi,
Cool. I will try it soon. I have a cold at the moment :-(

Cheers,
Karl


On Fri, Feb 8, 2019 at 10:28 PM Nicolas Cellier <[hidden email]> wrote:
And I have added a LogarithmicInterval which is more like numpy.logspace.

For a LogarithmicInterval, bounds are specified by their logarithm (in whatever base).

If you want 100 points from 0.1 to: 10.0, then you can write:
    (0.1 log logTo: 10 log size: 100 base: 10).
or:
    (-1 logTo: 1 size: 100 base: 10)
or you can omit the base and use ln/exp
    (0.1 ln logTo: 10 ln size: 100).

Le ven. 8 févr. 2019 à 15:56, Nicolas Cellier <[hidden email]> a écrit :
Hi Karl, I published GeometricInterval along with some GeometricIntervalTests at

    MCHttpRepository
        location: 'http://www.squeaksource.com/STEM'
        user: ''
        password: ''.

It is a port of VW SYSEXT-GeometricInterval from Cincom public store, a bit revisited.

Le dim. 3 févr. 2019 à 21:18, karl ramberg <[hidden email]> a écrit :
You are right.
It would be nice to have a logarithmic interval.

Best.
Karl


On Sun, Feb 3, 2019 at 6:37 PM Nicolas Cellier <[hidden email]> wrote:
Hi karl,
This is not a logarithmic interval. The progression should be geometric, that is with a constant ratio.

    x3/x2 = (x2/x1).

The ith element of geometric serie should be something like

    (ratio raisedTo: i-1) * start.

Le dim. 3 févr. 2019 à 18:15, karl ramberg <[hidden email]> a écrit :
I used a workaround that probably is more flexible since I have several variables that need the logarithm

steps := 100.
xLog := 0.02 log: steps.
yLog := 1.894 log: steps
1 to: steps do:[:i|    
          x := i raisedTo: xLog.
          y := i raisedTo: yLog.
          ]

Best,
Karl



On Sun, Feb 3, 2019 at 5:10 PM Nicolas Cellier <[hidden email]> wrote:
Yes,
But i don't remember if published somewhere... I'll check this evening or tomorrow 

Le dim. 3 févr. 2019 à 16:43, karl ramberg <[hidden email]> a écrit :
Hi,
Does anybody know of a logarithmic interval implementation in Squeak where the steps in the interval go by logarithmic scale instead of linear ?

Best,
Karl









Reply | Threaded
Open this post in threaded view
|

Re: Logarithmic interval ?

Karl Ramberg
I made test with a Mandelbrot set zoom with the logarithmic interval and it works really well :-)
The zoom scale get down to ridiculously small numbers and it is only possible to do using logarithmic steps.

Cheers,
Karl




On Sat, Feb 9, 2019 at 5:04 PM karl ramberg <[hidden email]> wrote:
Hi,
Cool. I will try it soon. I have a cold at the moment :-(

Cheers,
Karl


On Fri, Feb 8, 2019 at 10:28 PM Nicolas Cellier <[hidden email]> wrote:
And I have added a LogarithmicInterval which is more like numpy.logspace.

For a LogarithmicInterval, bounds are specified by their logarithm (in whatever base).

If you want 100 points from 0.1 to: 10.0, then you can write:
    (0.1 log logTo: 10 log size: 100 base: 10).
or:
    (-1 logTo: 1 size: 100 base: 10)
or you can omit the base and use ln/exp
    (0.1 ln logTo: 10 ln size: 100).

Le ven. 8 févr. 2019 à 15:56, Nicolas Cellier <[hidden email]> a écrit :
Hi Karl, I published GeometricInterval along with some GeometricIntervalTests at

    MCHttpRepository
        location: 'http://www.squeaksource.com/STEM'
        user: ''
        password: ''.

It is a port of VW SYSEXT-GeometricInterval from Cincom public store, a bit revisited.

Le dim. 3 févr. 2019 à 21:18, karl ramberg <[hidden email]> a écrit :
You are right.
It would be nice to have a logarithmic interval.

Best.
Karl


On Sun, Feb 3, 2019 at 6:37 PM Nicolas Cellier <[hidden email]> wrote:
Hi karl,
This is not a logarithmic interval. The progression should be geometric, that is with a constant ratio.

    x3/x2 = (x2/x1).

The ith element of geometric serie should be something like

    (ratio raisedTo: i-1) * start.

Le dim. 3 févr. 2019 à 18:15, karl ramberg <[hidden email]> a écrit :
I used a workaround that probably is more flexible since I have several variables that need the logarithm

steps := 100.
xLog := 0.02 log: steps.
yLog := 1.894 log: steps
1 to: steps do:[:i|    
          x := i raisedTo: xLog.
          y := i raisedTo: yLog.
          ]

Best,
Karl



On Sun, Feb 3, 2019 at 5:10 PM Nicolas Cellier <[hidden email]> wrote:
Yes,
But i don't remember if published somewhere... I'll check this evening or tomorrow 

Le dim. 3 févr. 2019 à 16:43, karl ramberg <[hidden email]> a écrit :
Hi,
Does anybody know of a logarithmic interval implementation in Squeak where the steps in the interval go by logarithmic scale instead of linear ?

Best,
Karl