**Babylonian Field Expansion Procedure Algorithm and eTCL 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 in your comment with the same courtesy that I will give you. Its very hard to reply intelligibly without some background of the correspondent. Thanks,[gold] ---- <> [gold] Here is some eTCL starter code for Babylonian Field Expansion Procedure Algorithm . Here is some eTCL starter code for Babylonian field expansion procedure algorithm. The Babylonian field expansion procedure algorithm from clay tablets was loaded into an eTCL calculator. The Babylonians did not use algebra notation, so the reader will have to bear some anachronisms in the eTCL pseudocode. The field expansion procedure is defined as the method used by scribes to succesively reduce or add numbers or number products by integer fractions, usually 1/60, 2/60, 3/60 et al. In modern terms, the numbers in base 60 that appeared on the tablet would be n+(1/60), n+(2/60), n+(3/60) until a desired goal for is reached. On some clay tablets to reach a desired field area of 100 square units called a iku (Akkadian for field), the succesive altered sides a*b would be (a+(1/60))*(b+(1/60)),(a2+(1/60))*(b2+(1/60))...until (a_f+(1/60))*(n_f+(1/60)) ~= 100. Allowing for some number rounding, the field expansion procedure would produce an almost square field of 100 square units. The inherent error should be less than 1/60, error <= (/ 1. 60.). The field expansion procedure can be extended to produce rectanglar fields of certain desired areas or side a/b ratios. The bare numbers on the tablets were not usually marked with units or annotated. Succesive or iterated math solutions are called algorithms and the field expansion procedure is one of the earliest algorithms documented. The TCL procedures are descendants of this idea. For restating the problem in a computer algorithm, the sides and field area will be in meters and square meters, respectively. The reason for the field expansion procedure is not completely understood. However, there are some peg points or analogies available. The successive addition and clay marks/counterpieces looks somewhat like the pebble math problems, pebble games, or penny problems of some cultures. The almost square fields or concern with squares in some problems suggest the field expansion procedure was a method that avoided square roots or predated taking square roots. The cuneiform methods for taking areas of squares and rectangles were accurate, a*a or a*b. In those eras, the common approximate quadrilateral formula for area (a+c)*(b+d)*.25 was very inaccurate, inconsistent, and lead to unfair tax assessments. Taxes or interest were 1/60 per month or 12/60 per year of the harvest in some eras, so an accurate survey would almost pay the years taxes. There probably was some motivation to extend an accurate confirmed square area into an accurate rectanglar field vis using the inconsistent approximate quadrilateral formula. The Babylonian false position algorithm on this wiki does take a square root and may be a later development. ---- **Pseudocode Section** ====== # using pseudocode for Babylonian field expansion procedure algorithm. # possible problem instances include add 1/60 to sides until area goal reached long_side = supplied value short_side = supplied value desired goal = supplied value, usually 100 square units in some early math problems set old_field_area = a*b , old field_area = long_side * short_side set new_side_a = long_side + 1/60 set new_side_b = short_side + 1/60 set new_field_area = (long_side + 1/60) * ( short_side + 1/60 ) is new_field_area =? desired_area within +/- (1/60) , yes = finished loop check error , abs (desired_goal - new_field_area) <= [/ 1. 60.] half area = area * .5 quarter area = area * .25 check_answer new area =? desired goal , desired goal reached (yes/no) set answers and printout with resulting values ====== ***Testcases Section*** In planning any software, it is advisable to gather a number of testcases to check the results of the program. The math for the testcases can be checked by pasting statements in the TCL console. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the capacity functions (subroutines). **** Testcase 1 **** |table 1|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| 1:|testcase_number | |& &| 10.2 :|long side meters | |& &| 9.5 :|short side meters | |& &| 100.0 :|desired area (usually 1 iku, 100 square units)| |& &| 96.899 :|answers: old area meters squared| |& &| 0.166 :|area lacking meters squared | |& &| 100.211 :|area from new sides meters squared | |& &| 10.366 :|long side meters | |& &| 9.666 :|short side meters | |& **** Testcase 2 **** %|table 2|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| 2:|testcase_number | |& &| 9.599 :|long side meters | |& &| 9.060 :|short side meters | |& &| 100.0 :|desired area (usually 1 iku, 100 square units)| |& &| 86.975 :|answers: old area meters squared| |& &| 0.683 :|area lacking meters squared | |& &| 100.193 :|area from new sides meters squared | |& &| 10.283 :|long side meters | |& &| 9.743 :|short side meters | |& **** Testcase 3 **** %|table 3|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| 3:|testcase_number | |& &| 9.5 :|long side meters | |& &| 9.0 :|short side meters | |& &| 100.0 :|desired area (usually 1 iku, 100 square units)| |& &| 85.5 :|answers: old area meters squared| |& &| 0.7666 :|area lacking meters squared | |& &| 100.271 :|area from new sides meters squared | |& &| 10.266 :|long side meters | |& &| 9.766 :|short side meters | |& ---- ***Screenshots Section*** ****figure 1.**** [Babylonian Field Expansion Procedure Algorithm and eTCL demo example calculator screenshot] ---- ***References:*** September 2009 * A Geometric Algorithm with Solutions to Quadratic Equations * in a Sumerian Juridical Document from Ur III Umma * Joran Friberg, Chalmers University of Technology, Gothenburg, Sweden * google search engine * Wikipedia search engine * mathworld.wolfram.com, Trapezoid and right trapezoid * Mathematical Treasure: Old Babylonian Area Calculation, uses ancient method * Frank J. Swetz , Pennsylvania State University * Wikipedia, see temple of Edfu, area method used as late as 200 BC in Egypt. * [Oneliner's Pie in the Sky] * [One Liners] * [Category Algorithm] * [Babylonian Number Series and eTCL demo example calculator] * [Brahmagupta Area of Cyclic Quadrilateral and eTCL demo example calculator] * [Gauss Approximate Number of Primes and eTCL demo example calculator] * Land surveying in ancient Mesopotamia, M. A. R. Cooper * [Sumerian Approximate Area Quadrilateral and eTCL Slot Calculator Demo Example , numerical analysis] * Thomas G. Edwards, Using the Ancient Method of False Position to Find Solutions * Joy B. Easton, rule of double false position * Vera Sanford, rule of false position * www.britannica.com, topic, mathematics trapezoid * [Sumerian Equivalency Values, Ratios, and the Law of Proportions with Demo Example Calculator] * [Babylonian Sexagesimal Notation for Math on Clay Tablets in Console Example] * Babylonians Tracked Jupiter With Advanced Tools: Trapezoids, Michael Greshko, news.nationalgeographic.com * Geometry in Babylonian Astronomy, Cluster of Excellence Topology, Humboldt University of Berlin * Mathieu Ossendrijver: „Ancient Babylonian astronomers calculated Jupiter’s position * from the area under a time-velocity graph“, in: Science, January 29, 2016. * Late Babylonian Field Plans in the British Museum, books.google.com/books * Karen Rhea Nemet-Nejat * Late Babylonian Surface Mensuration Author(s): Marvin A. Powell Source: jstor * translation: trapezoid in two babylonian astronomical cuneiform * texts for jupiter (act 813 & act 817) from the seleucid era , 310 BC -75 AD * Otto Neugebauer, Astronomical Cuneiform Texts, 3 Vols. * Lund Humphreys, London, 1955:405,430-31. * DeSegnac, MS 3908 A RE-CONSTRUCTION, D.A.R. DeSegnac * A draft for an essay * DeSegnac, MENTAL COMPUTING OF THREE ARCHAIC * MESOPOTAMIAN PUZZLES W 20044, 35, W 20044, 20 & W 20214, essay draft * DeSegnac, HARMONY OF NUMBERS I and II, D.A.R. DeSegnac, A draft for an essay ---- **Appendix Code** ***appendix TCL programs and scripts *** ====== # pretty print from autoindent and ased editor # Babylonian Field Expansion Procedure Algorithm calculator # written on Windows XP on eTCL # working under TCL version 8.5.6 and eTCL 1.0.1 # gold on TCL WIKI, 15jan2017 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 {{} { long side meters :} } lappend names { short side meters :} lappend names { desired area (usually 1 iku, 100 square units) : } lappend names { answers: old area meters squared : } lappend names { area lacking meters squared :} lappend names { area from new sides meters squared: } lappend names { long side meters : } lappend names { short side meters :} 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 Babylonian Field Expansion Procedure Algorithm from TCL WIKI, written on eTCL " tk_messageBox -title "About" -message $msg } 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 side5 [* $side5 1. ] set side6 [* $side6 1. ] set side7 [* $side7 1. ] set side8 [* $side8 1. ] set true_area [* $side1 $side2 ] set desired_area $side3 # initialize ancient correction fraction set correction_fraction [/ 1. 60. ] set correction_fraction [* [/ [- $desired_area $true_area] $desired_area ] 5. ] set counter 1 while { $counter < 50. } { if { [* [+ $side1 [/ $counter 60. ]] [+ $side2 [/ $counter 60. ]] ] > $desired_area } {; break} incr counter } set correction_fraction [/ $counter 60. ] set side4 $true_area set side5 $correction_fraction set side6 [* [+ $side1 $correction_fraction ] [+ $side2 $correction_fraction ] ] set side7 [+ $side1 $correction_fraction ] set side8 [+ $side2 $correction_fraction ] } 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 reference_factor flag console show; puts "%|table $testcase_number|printed in| tcl wiki format|% " puts "&| quantity| value| comment, if any|& " puts "&| $testcase_number:|testcase_number | |& " puts "&| $side1 :|long side meters | |&" puts "&| $side2 :|short side meters | |& " puts "&| $side3 :|desired area (usually 1 iku, 100 square units)| |& " puts "&| $side4 :|answers: old area meters squared| |&" puts "&| $side5 :|area lacking meters squared | |&" puts "&| $side6 :|area from new sides meters squared | |&" puts "&| $side7 :|long side meters | |&" puts "&| $side8 :|short side meters | |&" } frame .buttons -bg aquamarine4 ::ttk::button .calculator -text "Solve" -command { calculate } ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 10.2 9.5 100.0 96.9 0.0166 100.2 10.2 9.51} ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 9.6 9.06 100. 86.9 .68 100.2 10.2 9.74 } ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 9.5 9.0 100.0 85.5 0.76 100.3 10.26 9.7 } ::ttk::button .clearallx -text clear -command {clearx } ::ttk::button .about -text about -command {about} ::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 .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 . "Babylonian Field Expansion Procedure Algorithm Calculator" ====== ---- *** 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 eTCL 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 on the next solve button. The command { calculate; reportx } or { calculate ; reportx; clearx } can be added or changed to report automatically. Another wrinkle would be to print out the current text, delimiters, and numbers in a TCL wiki style table as ====== puts " %| testcase $testcase_number | value| units |comment |%" puts " &| volume| $volume| cubic meters |based on length $side1 and width $side2 |&" ====== ---- [gold] This page is copyrighted under the TCL/TK license terms, [http://tcl.tk/software/tcltk/license.html%|%this license]. **Comments Section** <> Please place any comments here, Thanks. <> Numerical Analysis | Toys | Calculator | Mathematics| Example| Toys and Games | Games | Application | GUI <> Mathematics | Concept| Algorithm