**Time Fractals in Golden Ratio Proportions and TCL demo example calculator, numerical analysis**

This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER and date in your comment with the same courtesy that I will give you. Aside from your courtesy, your wiki MONIKER and date as a signature and minimal good faith of any internet post are the rules of this TCL-WIKI. Its very hard to reply reasonably without some background of the correspondent on his WIKI bio page. Thanks,[gold] 30Apr2021
----

<<TOC>>
*** Introduction***
----
[gold] Here are some calculations on time fractal windows. This calculator uses golden ratio proportions to predict time windows or time fractals of similar probable occurrences based a seed time or initial age decimal years. There is plenty of uncertainty about probable occurrences events after the seed time in decimal years, but the the probable occurrences are largely based on growth, accumulation, and succession following the golden ratio proportions. Not all events in time have  golden ratio proportions.
----
*** Body ***
----
The golden ratio constant is 1.6180339887… As used in the TCL program, the golden ratio conjugate is 0.6180339887… In some circles, a peak is considered 1.6X and a dip is considered 0.6X. The most commonly used Fibonacci ratios as dips include the  23.6%, 38.2%, 50%, 61.8%, and 78.6% shorts. A version of 61.8% is loaded in the TCL program as 0.618... Not sure these Fibonacci ratios apply on all occasions, but there is considerable interest in predicting peaks and dips in Bitcoin cryptocurrency

----
*** Conclusions ***
----
The TCL calculator seems to be working as it stands and matches the scanty textbook examples. The calculator carries the numbers out to the TCL 8.6 maximum (17 places), but suggest there is about a 5 per cent accuracy inherent in most inputs and the probable event outputs. One relative error calculation in TCL notation was vis expr {(1 -(28.797 / 27.506))* 100. } >>   4.69 accuracy no units.
 

----
***Testcases Section***  

In planning any software, it is advisable to gather a number of testcases to check the results of the program.

**** Testcase 1 ****
%|table 1|printed in| tcl wiki format|% 
&| quantity| value| comment, if any|& 
&| 1:|testcase_number | |&
&| 11.0 :|aa quantity , initial age decimal years  |   |&
&| 2.0 :|bb quantity   | |& 
&| 3.0 :|cc quantity   | |& 
&| 4.0 :|dd quantity   | |&
&| 28.798373876248846 :|probable 2nd next occurrence, decimal years  : | |&
&| 46.596747752497691 :|3rd next occurrence, decimal years : |  |&
&| 17.798373876248846 :|probable  1st next occurrence, decimal years : |  |&
&| 17.798 :|probable  1st next occurrence, rounded or clipped : |  |&
 
---- 
**** Testcase 2 ****
----
%|table 2|printed in| tcl wiki format|% 
&| quantity| value| comment, if any|& 
&| 2:|testcase_number | |&
&| 10.0 :|aa quantity , initial age decimal years  |   |&
&| 5.0 :|bb quantity   | |& 
&| 7.0 :|cc quantity   | |& 
&| 9.0 :|dd quantity   | |&
&| 26.180339887498953 :|probable 2nd next occurrence, decimal years  : | |&
&| 42.360679774997905 :|3rd next occurrence, decimal years : |  |&
&| 16.180339887498949 :|probable  1st next occurrence, decimal years : |  |&
&| 16.180 :|probable  1st next occurrence, rounded or clipped : |  |&
---- 
 
**** Testcase 3 ****
----
%|table 3|printed in| tcl wiki format|% 
&| quantity| value| comment, if any|& 
&| 3:|testcase_number | |&
&| 15.0 :|aa quantity , initial age decimal years  |   |&
&| 4.0 :|bb quantity   | |& 
&| 5.0 :|cc quantity   | |& 
&| 7.0 :|dd quantity   | |&
&| 39.270509831248432 :|probable 2nd next occurrence, decimal years  : | |&
&| 63.541019662496865 :|3rd next occurrence, decimal years : |  |&
&| 24.270509831248425 :|probable  1st next occurrence, decimal years : |  |&
&| 24.271 :|probable  1st next occurrence, rounded or clipped : |  |&
----
**** Testcase 4 ****
----
%|table 4|printed in| tcl wiki format|% 
&| quantity| value| comment, if any|& 
&| 4:|testcase_number | |&
&| 144.0 :| entry is  Fibonacci number  |   |&
&| 2.0 :|bb quantity   | |& 
&| 3.0 :|cc quantity   | |& 
&| 4.0 :|dd quantity   | |&
&| 376.98105600000002 :|successive Fibonacci number 2nd  : | |&
&| 609.95534860800001 :|successive Fibonacci number 3rd  : |  |&
&| 232.99200000000002 :|successive Fibonacci number 1st |  |&
&| 232.99 :|probable  1st next occurrence, rounded or clipped : |  |&
----
If the entry is a Fibonacci number greater than zero, the TCL calculator should approximate the next 3 successive Fibonacci numbers as reals, but need to round to nearest integer. The On-Line Encyclopedia of Integer Sequences A000045 gives the Fibonacci numbers as follows 
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269.
----
%|table 5|printed in| tcl wiki format|% 
&| quantity| value| comment, if any|& 
&| 5:|notes on Elliott Wave Principle, possible peak curve rises and falls from Fibonacci numbers | |&
&| wave number | entry (144)  is  Fibonacci number  |   |&&| wave 1  :|161.8%   |new bull (+) or bear (-) market and is usually accompanied by sentiment extremes, possible Fibonacci |& 
&| wave 2 :|61.8%   | possible Fibonacci 61.8% or 78.6% retrenchment|& &| wave 3 :|161.8%   | possible Fibonacci |161.8% or 78.6% advance|& 
&| wave 4:|38.2%   | possible Fibonacci 38.2% retrenchment, sideways market|&
&| wave 5:|32.6%   | possible Fibonacci final leg in the direction of the dominant trend|&
&| wave 5:|50.0%   | possible Fibonacci final leg,  50.0% used as analyst midpoint|&
----
***Screenshots Section***
----
****figure 1.****
----
[time_fractals_equation]
---- 
----
****figure 2.****
----
[time_fractal_dummy_curve]
---- 
***References:***
   * Wikipedia search engine < time  >
   * Wikipedia search engine < golden ratio proportions  >
   * Wikipedia search engine <  Fibonacci  >
   * Google search engine < fractal time calculator Braden Greg  >
   * Book >> Fractal Time: The Secret of 2012 and a New World Age
   * Paperback – Illustrated, February 1, 2010
   * book(s) by Braden Gregg
   * www.greggbraden.com/fractal time calculator
   * Website articles by Tony Spilotro
   * Bitcoin Mathematics: Why 21 Million BTC May Have Been Chosen
   * Extreme interest in trading Bitcoin cryptocurrency [golden ratio tops ] 
   * Fibonacci Day: How To Use Math To Trade Bitcoin And Altcoins
   * Web article Mathematical Mystery: Why Did The Bitcoin Rally Stop At The Golden Ratio?
   * Crypto Calculated: How Ancient Math Predicts Bitcoin’s Next Top At $270K
   * Fibonacci Day: How To Use Math To Trade Bitcoin And Altcoins
   * by Tony Spilotro
   * Understanding Bitcoin’s Market Cycles: 3 Simple indicators for future tops and bottoms
   * Collected Works of R. N. Elliot
   * The Wave Principle. Nature's Law: The Secret of the Universe. R. N. Elliot
   * Series of Articles Published in 1939 by  Ralph Nelson Elliott.
   * Elliott Wave Principle by A.J. Frost and Robert Prechter
   * Elliott Wave Principle: Key To Market Behavior
   * Elliott, Ralph Nelson, Frost, Alfred John, Prechter, Robert Rougelot
   * R.N. Elliott's Masterworks: The Definitive Collection
   * 318 Pages · 1994 English
   * by R. N. Elliott & Robert R. Prechter & Jr.
   * Fractal Time.  coded in python ,  sourceforge.net_projects_fractaltimecalc
   * Golden Ratios in Energy Radiation and Vibrations
   * May 23, 2012 by Gary Meisner 
----

----
**Appendix Code**

***appendix TCL programs and scripts ***

======
        ;# pretty print from autoindent and ased editor occurrence
        ;# Time Fractal Proportions calculator
        ;# written on Windows 
        ;# working under TCL version 8.6 
        ;# gold on TCL WIKI, 30apr2021
        package require Tk
        package require math::numtheory
        namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory }
        set tcl_precision 17
        frame .frame -relief flat -bg aquamarine4
        pack .frame -side top -fill y -anchor center
        set names {{} {aa quantity, initial age decimal years  :} }
        lappend names {bb quantity optional :}
        lappend names {cc quantity optional : }
        lappend names {dd quantity optional : }
        lappend names {answers: probable 2nd next occurrence, decimal years  :}
        lappend names {probable 3rd next occurrence, decimal years  : }
        lappend names {probable  1st next occurrence, decimal years  : }
        lappend names {probable  1st next occurrence, rounded or clipped  :} 
        foreach i {1 2 3 4 5 6 7 8} {
            label .frame.label$i -text [lindex $names $i] -anchor e
            entry .frame.entry$i -width 35 -textvariable side$i
            grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1 }
        proc about {} {
            set msg "Calculator for Time Fractal Proportions V2
            from TCL WIKI,
            written on TCL 8.6 "
            tk_messageBox -title "About" -message $msg } 
        proc self_help {} {
            set msg "Calculator for Time Fractal Proportions V2
            from TCL ,
            ;# self help listing
            ;# 4 givens follow.
            1) aa initial age decimal years  N1
            2) bb  optional N2
            3) cc  optional N3
            4) dd  optional N4
            ;# This calculator uses golden ratio proportions 
            ;# to predict time windows or time fractals 
            ;# of similar probable occurrences based 
            ;# a seed time or initial age decimal years.
            ;# There is plenty of uncertainty about probable occurrences
            ;# and events after the seed time, but the 
            ;# the probable occurrences are largely based on growth,
            ;# accumulation, and succession
            ;# following the golden ratio proportions.
            ;# Not all events in time have  golden ratio proportions.
            ;# For comparison, TCL code may include redundant paths & formulas.
            ;# The TCL calculator normally uses modern
            ;# units  for convenience to modern users and textbooks.
            ;# Any convenient and consistent in/output units might be used
            ;# like inches, feet, nindas, cubits, or dollars to donuts.
            ;# Recommended procedure is push testcase and fill frame,
            ;# change first three entries etc, push solve,
            ;# and then push report. Report allows copy and paste
            ;# from console to conventional texteditor. For testcases
            ;# testcase number is internal to the calculator and
            ;# will not be printed until the report button is pushed
            ;# for the current result numbers.
            ;# This posting, screenshots, and TCL source code is
            ;# copyrighted under the TCL/TK 8.6 license terms.
            ;# Editorial rights retained under the TCL/TK license terms
            ;# and will be defended as necessary in court.
            Conventional text editor formulas or  grabbed from internet
            screens can be pasted into green console.
            Try copy and paste following into green screen console
            set answer \[* 1. 2. 3. 4. 5. \]
            returns  120
            ;# gold on  TCL Club, 30apr2021 "
            tk_messageBox -title "self_help" -message $msg }
        proc precisionx {precision float}  {
            ;#  tcl:wiki:Floating-point formatting, <AM>
            ;# select numbers only, not used on every number.
            set x [ expr {round( 10 ** $precision * $float) / (10.0 ** $precision)} ]
            ;#  rounded or clipped to nearest 5ird significant figure
            set x [ format "%#.5g" $x ]
            return $x
        }
        proc time_fractal {age_years} {
            set g_constant .61803398874989484820
            set year_occurrence  [ expr {  $age_years + $g_constant * $age_years  } ]
            return $year_occurrence
            }
       proc calculate {     } {
            global answer2
            global side1 side2 side3 side4 side5
            global side6 side7 side8 
            global testcase_number 
            incr testcase_number 
            set side1 [* $side1 1. ]
            set side2 [* $side2 1. ]
            set side3 [* $side3 1. ]
            set side4 [* $side4 1. ]
            set age_years [ expr { $side1*1.0 } ]
            set g_constant .61803398874989484820
            set year_occurrence [    time_fractal $age_years   ] 
            set 2nd_occurrence  [    time_fractal $year_occurrence   ]  
            set side5  $2nd_occurrence
            set 3rd_occurrence [    time_fractal $2nd_occurrence  ] 
            set side6  $3rd_occurrence
            set side7  $year_occurrence
            set side8 [precisionx 5  $year_occurrence ]
             }
        proc fillup {aa bb cc dd ee ff gg hh} {
            .frame.entry1 insert 0 "$aa"
            .frame.entry2 insert 0 "$bb"
            .frame.entry3 insert 0 "$cc"
            .frame.entry4 insert 0 "$dd"
            .frame.entry5 insert 0 "$ee"
            .frame.entry6 insert 0 "$ff" 
            .frame.entry7 insert 0 "$gg"
            .frame.entry8 insert 0 "$hh" 
             }
        proc clearx {} {
            foreach i {1 2 3 4 5 6 7 8 } {
                .frame.entry$i delete 0 end } }
        proc reportx {} {
            global side1 side2 side3 side4 side5
            global side6 side7 side8 
            global testcase_number
            console show;
            puts "%|table $testcase_number|printed in| tcl wiki format|% "
            puts "&| quantity| value| comment, if any|& "
            puts "&| $testcase_number:|testcase_number | |&"
            puts "&| $side1 :|aa quantity , initial age decimal years  |   |&"
            puts "&| $side2 :|bb quantity   | |& "  
            puts "&| $side3 :|cc quantity   | |& "
            puts "&| $side4 :|dd quantity   | |&"
            puts "&| $side5 :|probable 2nd next occurrence, decimal years  : | |&"
            puts "&| $side6 :|3rd next occurrence, decimal years : |  |&"
            puts "&| $side7 :|probable  1st next occurrence, decimal years : |  |&"
            puts "&| $side8 :|probable  1st next occurrence, rounded or clipped : |  |&" 
            }
        frame .buttons -bg aquamarine4
        ::ttk::button .calculator -text "Solve" -command { calculate   }
        ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 11. 2.  3.0 4.  28.798  46.596  17.79837 17.798}
        ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 10.0 5.0 7.0 9.0  26.180  42.360  16.18033 16.180 }
        ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 15.0 4.  5.0 7.0   39.270  63.541  24.27050 24.271 }
        ::ttk::button .clearallx -text clear -command {clearx }
        ::ttk::button .about -text about -command {about}
        ::ttk::button .self_help -text self_help -command {self_help }
        ::ttk::button .cons -text report -command { reportx }
        ::ttk::button .exit -text exit -command {exit}
        pack .calculator  -in .buttons -side top -padx 10 -pady 5
        pack  .clearallx .cons .self_help .about .exit .test4 .test3 .test2   -side bottom -in .buttons
        grid .frame .buttons -sticky ns -pady {0 10}
               . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30
        wm title . "Time Fractal Proportions Calculator V2 "           
======
----
*** Pushbutton Operation***

For the push buttons, the recommended procedure is push testcase and fill frame, change first three entries etc, push solve, and then push report. Report allows copy and paste from console. For  testcases in a computer session, the  TCL calculator increments a new testcase number internally, eg. TC(1), TC(2) , TC(3) , TC(N). The testcase number is internal to the calculator and will not be printed until the report button is pushed for the current result numbers. The current result numbers will be cleared either on the next clear button or on the next solve button.   
----
[gold]30Apr2021.  This page is copyrighted under the TCL/TK license terms, [http://tcl.tk/software/tcltk/license.html%|%this license]. 

**Comments Section**

<<discussion>>
Please place any comments here, Thanks, [gold] 30Apr2021

                              
<<categories>> Numerical Analysis | Toys | Calculator | Mathematics| Example| Toys and Games | Games | Application | GUI
----
<<categories>> Development | Concept| Algorithm