**Sumerian Bronze & Alloy Calculator with demo examples eTCL 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 calculating ratios of bronze and other alloys from Sumerian texts and excavations. The impetus for these calculations was checking prices in some cuneiform texts and modern replicas. Most of the testcases involve replicas or models, using assumptions and rules of thumb. For a testcase from Elba text TM75G1310, 5+30/60 minas of copper and 40/60 minas of tin were combined to form a bronze alloy. The smelter loss was estimated to be 70 shekels,70/60, 1.166 rounded minas. The alloy ratio was (5+30/60)/(40/60),5.5/0.666, or 8.25 from the hand calculator. The eTCL calculator returned an alloy ratio of 8.258. The trial formula for smelter product was (5+30/60)+(40/60)-1.166, 5.0006 minas. The eTCL calculator returned an alloy mass of 5. rounded minas. Additional decimal points here are used to check the calculator results and are not inferences on the text accuracy. The Mari text TM7 recorded an instance where 8 minas of copper and 1/3 minas of tin were combined. The alloy ratio was 8/(1/3) or 24.02 from the hand calculator. The eTCL calculator returned an alloy ratio of 24.024. The smelter loss could not be inferred from the text. In the text TM75G1310 from Elba, 30 minas of copper and 3 minas 20 shekels of tin were mixed to form a copper tin bronze. The alloy product was 2000 shekels of bronze, 2000/60, or 33.33 minas. The alloy ratio was 30/(3+20/60),30/3.333, or 9 from the hand calculator. The eTCL calculator returned an alloy ratio of 9.009. From figures in the text, the smelter loss was 30+(3+20/60)-33.33, 0.0033. The trial formula for smelter product was 30+(3+20/60)-0.0033, 33.33, rounded minas. The eTCL calculator returned an alloy mass of 33.326 , rounded. For the trial formulas, the metal prices from the UrIII era will be used (mixing countries and eras). From the UrIII Equivalency lists, the silver price was 1 silver shekel for 90 shekels of copper and the tin price was 1 silver shekel for 15 to 20 shekels (UrIII). Using proportions, the copper value was (30*60)*(1/90), 20 silver shekels. The tin value was (3.33*60)*(1/20), 9.99, rounding 10 silver shekels. In the eTCL calculator, kilograms are used with the price ratios of copper (1/90) and tin (1/20) for UrIII. From the trial calculations, these ratios were transferred correctly to kilograms of silver. The price table contains redundant entries from different texts. However, the trade values or price ratios were undoubtedly different in different eras, countries, and texts. *** Pseudocode and Equations *** ====== Sumerian price in silver = [/ liters 300.] Sumerian price in liters grain = [* silver 300.] # 1 silver piece = 1 gur = 300 liters of grain liters = [* volume_in_cubic_cm .001] original copper mass + original tin mass - product mass = smelter loss original metal mass - product mass = smelter loss price? = raw materials + labor + profit price? = raw materials + heat process price? = raw materials + labor average price per unit = revenue / units sold ====== *** Table Prices*** %|Metal prices|per silver shekel etc| country, era|% %| quantity| value| comment, if any|% &| copper | 3 minas= 180 shekels | Babylon, Esnunna Code prescribing prices, 1900 BCE |& &| copper | 1.5 minas= 90 shekels | NeoSumerian, UrIII, circa 2300 BCE|& &| copper | 80 shekels | NeoSumerian, UrIII, circa 2300 BCE|& &| tin | 12 shekels| NeoSumerian, UrIII, circa 2300 BCE|& &| tin | 20 shekels | NeoSumerian, UrIII, circa 2300 BCE|& &| red gold | 15 shekels | NeoSumerian, UrIII, circa 2300 BCE|& &| gold | 7 shekels | NeoSumerian, UrIII, circa 2300 BCE|& &| gold | 20 shekels | NeoSumerian, UrIII, circa 2300 BCE|& ---- ***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|& &| testcase number:| | 1|& &| copper mass kilograms:|kilograms | 27.75 |& &| tin mass kilograms:|kilograms | 0.2277|& &| alloy mass kilograms :| set|1.3|& &| metal alloy ratio :| no units|121.870 |& &| alloy mass:| kilograms|26.677 |& &| copper value in silver :| kilograms|0.308 |& &| alloy value in silver :| kilograms|0.0113 |& ---- **** Testcase 2 **** %|table 2|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number:| | 2|& &| copper mass kilograms:|kilograms | 27.75 |& &| tin mass kilograms:|kilograms | 0.225|& &| alloy mass kilograms :| set|1.3|& &| metal alloy ratio :| no units|123.333 |& &| alloy mass :| kilograms|26.675 |& &| copper value in silver :| kilograms|0.308 |& &| alloy value in silver :| kilograms|0.011 |& ---- **** Testcase 3 **** %|table 3|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number:| | 3|& &| copper mass kilograms:|kilograms | 25.00 |& &| tin mass kilograms:|kilograms | 0.25|& &| alloy mass kilograms :| set|1.5|& &| metal alloy ratio :| no units|100.0 |& &| alloy mass :| kilograms|23.75 |& &| copper value in silver :| kilograms|0.277 |& &| alloy value in silver :| kilograms|0.0125 |& ---- ***Screenshots Section*** ****figure 1.**** [http://s1.postimg.org/7nrwm5lnz/sumerian_bronze_calculator_TCL_WIKI_2.png] ---- ***References:*** * oxhide ingots, copper production, trade, thesis,michael rice jones,2007 * Robert Englund, UCLA [cdli.ucla.edu/staff/englund/publications/englund2012a.pdf] * Ur III Tablets in the Valdosta State University, search on cdli * Cuneiform Digital Library Journal, search on Equivalency Values * Ur III Equivalency Values[http://cdli.ox.ac.uk/wiki/doku.php?id=ur_iii_equivalency_values] * Especially, the Ur III Equivalency Values for copper & silver sections. * The Sumerian keywords search on the cdli * are very effective, but major size files to download * Oxhide_ingot [https://en.wikipedia.org/wiki/Oxhide_ingot] * [https://en.wikipedia.org/wiki/Uluburun_shipwreck] ---- **Appendix Code** ***appendix TCL programs and scripts *** ====== # pretty print from autoindent and ased editor # Sumerian bronze alloy calculator # written on Windows XP on eTCL # working under TCL version 8.5.6 and eTCL 1.0.1 # gold on TCL WIKI, 15sep2014 package require Tk namespace path {::tcl::mathop ::tcl::mathfunc} frame .frame -relief flat -bg aquamarine4 pack .frame -side top -fill y -anchor center set names {{} {copper mass kilograms:} } lappend names {tin or other mass kilograms:} lappend names {smelter loss kilograms: } lappend names {alloy mixture ratio:} lappend names {alloy mass kilograms:} lappend names {copper value in silver: } lappend names {tin value in silver : } lappend names {bronze (or alloy) value in silver :} 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 Sumerian Bronze & Other Alloy 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 copper1 [* $side1 1. ] set tin1 [* $side2 1. ] set loss1 [* $side3 1. ] set side4 [/ $copper1 $tin1 ] set side5 [- [+ $copper1 $tin1 ] $loss1 ] set side6 [* $copper1 [/ 1. 90.] ] set side7 [* $tin1 [/ 1. 20. ] ] set side8 [* $copper1 [/ 1. 90.] ] } 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 "&| copper mass kilograms:|kilograms | $side1 |&" puts "&| tin mass kilograms:|kilograms | $side2|& " puts "&| alloy mass kilograms :| set|$side3|& " puts "&| metal alloy ratio :| no units|$side4 |&" puts "&| smelter loss :| kilograms|$side5 |&" puts "&| copper value in silver :| kilograms|$side6 |&" puts "&| alloy value in silver :| kilograms|$side7 |&" } frame .buttons -bg aquamarine4 ::ttk::button .calculator -text "Solve" -command { calculate } ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 27.75 0.2277 1.3 121.18 26.6 0.308 .011 0.308} ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 27.75 0.225 1.3 123.3 26.675 0.308 0.010.308 } ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 25.00 0.25 1.5 100.1 23.75 0.277 0.0125 0.277 } ::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 . "Sumerian Bronze & Other Alloy 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 (which 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. [AMG]: In this wiki, [[single brackets]] are links to other pages. If you don't want to link but just want brackets to show up in the displayed page, use [[[[double brackets]]] instead. <> Numerical Analysis | Toys | Calculator | Mathematics| Example