Precise Setting of a Delicate Parameter with “pibar”

(A slight revision of the post I made a few hours ago.)

We are still working on the Kuramoto model of self-synchronizing oscillators that I madeblog postsabout last fall, My colleagues and I expect to eventually write a serious paper. In the meantime, let me tell you about an unusual user interface control that I am using in our Kuramoto experiments.

Contents

pibar

For reasons that I need not get into right now, I want to make very small changes in the usually constant value ofpi. This special slider does the job. It variespibetween 3.1 and 3.2 in discrete steps, each step deleting or inserting one digit in the decimal expansion ofpi.

The slider starts in the center andpireturns its traditional value. With the default settings, if you move the slider to the left from the center, you get

|pi| = 3.1415926535
|pi| = 3.141592653
|pi| = 3.14159265
. . . .
|pi| = 3.141
|pi| = 3.14
|pi| = 3.1

It's easy to see what's happening in this direction because each step just chops off one digit.

Starting in the center and moving right is a little trickier because step rounds up. The first three and last three steps are

|pi| = 3.1415926536
|pi| = 3.141592654
|pi| = 3.14159266
. . . .
|pi| = 3.142
|pi| = 3.15
|pi| = 3.2

pi and truepi

Thepibarsuite consists of three functions.

  • pibarsets up the tool. You can center on any value you choose; it doesn't have to bepi. Another parameter sets the number of digits.
  • pireturns the current value provided by the slider.
  • truepialways returns4*atan(1), which is the double precision floating point number nearest to $\pi$. This is the value we get forpiwhenpibaris not messing with it.

Code

Thepibarsuite isavailable here. It is also included inversion 5.3 of Cleve_Lab, replacing last month's April 1 contribution.

Please let me know if you find anything useful to do with this.




Published with MATLAB® R2019b

|

Comments

To leave a comment, please clickhereto sign in to your MathWorks Account or create a new one.