Updated 2017-03-09 23:24:56 by gold

## Introduction edit

gold Here is some eTCL starter code for calculating rolls of paper, felt, and fabric. The impetus for these calculations was checking weights of textile rolls in some cuneiform texts and modern replicas. Most of the testcases involve replicas or models, using assumptions and rules of thumb.

The paper roll formula is length of roll in meters equals (1E5 *( Mass of roll in kg ))/((roll diameter in cm)*( surface density in gm/square meters )). The surface density of the paper can be found and the terms, the surface density equals (1E5 *( Mass in kg ))/((roll diameter in cm)*( length of roll in meters)). Here after, the eTCL notation will be used, which can be pasted into the console window.

For the testcases, there were three textile rolls of the same diameter and same material density, but which differed in other features. The 60-textile roll was 17.17 kg, 50 cm diameter, 50 cm height, 137 meters long, and estimated 250.36 gram per square meter. For the 60-textile, the length of cloth roll was estimated as [/ [* 1.E5 17.17] [* 50. 250.], 137.25 meters. The surface density version of the formula on the 60-textile gives [/ [* 1.E5 17.17] [* 50. 137.], 250.1 grams per square meter. The 90-textile roll was 25.37 kg, 50 cm diameter, 70 cm height, 202 meters long and estimated 250.36 gram per square meter. For the 90-textile, the length of cloth roll was estimated as [/ [* 1.E5 25.79 ] [* 50. 250.]], 202 meters. The surface density version of the formula on the 90-textile gives [/ [* 1.E5 25.79] [* 50. 202.]], 255.15 grams per square meter. The 30-textile roll was 12.2 kg, 50 cm diameter, 30 cm height, 95 meters long and estimated 250.36 gram per square meter. For the 30-textile, the length of cloth roll was estimated as [/ [* 1.E5 12.12] [* 50. 250.]], 96 meters. The surface density version of the formula gives [/ [* 1.E5 12.12] [* 50. 95.], 255.15 grams per square meter. In the eTCL calculator, the mass of the roll was divided by the volume of the roll as a cylinder to obtain material density in kilograms per cubic meter. In the three testcases, the material density should be similar. The main goal was to check the internal consistency of the length and density estimates for the textile rolls.

For the density of modern felt, the Italian felt sheet was L/W/T 1./1.8/0.0015 meters and weighed 500 grams. The felt sheet volume was [* 1. 1.8 .0015] or 0.0027 cubic meters and the fabric density was [/ 0.5 [* 1. 1.8 .0015] ] or 185.185 kg/ cubic meters. The fabric surface density was [/ 500. [* 1. 1.8 ] ] or 277 grams per square meter. By bolt length of 1 meter over width of 1.8 meter, the Italian felt fabric was [/ 500. 1. ] or 500 grams/ bolt length in meters. As a concept, the felt was rolled into a solid cylinder of 100 cm diameter and 180 cm high. In the console window, the cylinder volume formula was [* [pi] 1. 1. 1.8 [/ 1. 4. ] ] or 1.414 c. meters. The eTCL calculator returned a cylinder volume of 1.413 cubic meters. The mass of the cylinder was [* 1.413 185.1] or 261.5 kg. Returning to the eTCL calculator (still up), load the 261.5 kg for the mass, and push solve. The eTCL calculator returns length of 523 meters. Checking for consistency, the bolt length times the felt weight per meter gives [* 523 500] , 261500 grams, or 261.5 kg .

### 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

90-textile roll table printed in tcl wiki format
quantity value comment, if any
testcase number 1
diameter centimeters: 50.
height centimeters: 70.
mass of roll kilograms: 25.37
surface density grams/ m*m : 250.1
answers: roll volume cubic meters: 0.137
roll density kilograms/ cubic meters: 184.583
roll length meters : 202.878

#### Testcase 2

60-textile roll table printed in tcl wiki format
quantity value comment, if any
testcase number 2
diameter centimeters: 50.
height centimeters: 50.
mass of roll kilograms: 17.17
surface density grams/ m*m : 250.2
answers: roll volume cubic meters: 0.098
roll density kilograms/ cubic meters: 174.892
roll length meters : 137.250

#### Testcase 3

30-textile roll table printed in tcl wiki format
quantity value comment, if any
testcase number 3
diameter centimeters: 50.
height centimeters: 30.0
mass of roll kilograms: 12.
surface density grams/ m*m : 250.9
answers: roll volume cubic meters: 0.058
roll density kilograms/ cubic meters: 203.718
roll length meters : 95.655

#### Testcase 4

Modern Italian felt table printed in tcl wiki format
quantity value comment, if any
testcase number 4
diameter centimeters: 100.
height centimeters: 180.
mass of roll kilograms: 261.5
surface density grams/ m*m : 500.
answers: roll volume cubic meters: 1.413
roll density kilograms/ cubic meters: 184.973
roll length meters : 523.0

### References:

• Ask Dr. Math, 03/15/2001, material left on roll.

## Appendix Code edit

### appendix TCL programs and scripts

```        # pretty print from autoindent and ased editor
# paper roll calculator
# written on Windows XP on eTCL
# working under TCL version 8.5.6 and eTCL 1.0.1
# gold on TCL WIKI , 2may2014
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 {{} { diameter centimeters:} }
lappend names { height centimeters::}
lappend names { mass of roll kilograms: }
lappend names { surface density grams/square meters: }
lappend names { answers:roll volume cubic meters:}
lappend names { roll density kilograms/cubic meters:}
lappend names { roll length meters:}
foreach i {1 2 3 4 5 6 7} {
label .frame.label\$i -text [lindex \$names \$i] -anchor e
entry .frame.entry\$i -width 35 -textvariable side\$i
proc pi {} {
expr acos(-1)
}
set msg "Calculator for Paper Rolls & Felt
from TCL WIKI,
written on eTCL "
tk_messageBox -title "About" -message \$msg }
proc calculate {     } {
global side1 side2 side3 side4 side5
global side6 side7 testcase_number
incr testcase_number
set diameter   \$side1
set height  \$side2
set mass \$side3
set sdensity \$side4
set volume [/ [* [pi] \$diameter \$diameter \$height 1.E-6] 4.]
set side5 \$volume
set density [/ \$mass \$volume ]
set side6 \$density
set calclength [/ [* 1.E5 \$mass] [* \$diameter \$sdensity ]]
set side7 \$calclength
}
proc fillup {aa bb cc dd ee ff gg} {
.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"}
proc clearx {} {
foreach i {1 2 3 4 5 6 7} {
.frame.entry\$i delete 0 end } }
proc reportx {} {
global side1 side2 side3 side4 side5
global side6 side7 testcase_number
console show;
puts "%| table |printed in| tcl wiki format|% "
puts "&| quantity| value| comment, if any|& "
puts "&| testcase number| \$testcase_number||& "
puts "&| diameter centimeters:| \$side1 ||&"
puts "&| height centimeters:| \$side2||& "
puts "&| mass of roll kilograms:| \$side3||& "
puts "&| surface density grams/ m*m :| \$side4 ||&"
puts "&| answers: roll volume cubic meters:| \$side5||& "
puts "&| roll density kilograms/ cubic meters:| \$side6 ||&"
puts "&| roll length meters :| \$side7 ||&"
}
frame .buttons -bg aquamarine4
::ttk::button .calculator -text "Solve" -command { calculate   }
::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 50. 70. 25.37  250.1 0.137 184.58  202.87 }
::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 50. 50. 17.17  250.2 0.098 174.89 137.7 }
::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 50. 30.0 12. 250.9 0.058 203.3   95.}
::ttk::button .clearallx -text clear -command {clearx }
::ttk::button .cons -text report -command { reportx }
::ttk::button .exit -text exit -command {exit}
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 . "Paper Rolls & Felt 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   |&"  ```

`   test!`