## Introduction

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

### appendix TCL programs and scripts

```         # TCL source code follows
# pretty print from autoindent and ased editor
# Paper and Felt Roll Calculator V2
# written on Windows XP on TCL
# working under TCL version 8.6
# gold on TCL Club, 12Dec2018
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 {{} {diameter centimeters:} }
lappend names {height centimeters:}
lappend names {mass of roll kilograms:  }
lappend names {surface density grams per square meters: }
lappend names {answers: roll volume cubic meters:}
lappend names {roll density kilograms/cubic meters: }
lappend names {optional: }
lappend names {roll length 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
proc pi {} {expr acos(-1)}
set msg "Calculator for Paper and Felt Roll Calculator V2
from TCL
# gold on TCL Club, 12Dec2018 "
tk_messageBox -title "About" -message \$msg }
proc self_help {} {
set msg " Paper and Felt Roll Calculator V2
from TCL ,
# self help listing
# problem, Paper and Felt Roll Calculator V2
# 4 givens follow.
1) diameter centimeters:
2) height centimeters:
3) mass of roll kilograms:
4) surface density grams per square meters:
# 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
# Editorial rights and disclaimers
# retained under the TCL/TK license terms
# and will be defended as necessary in court.
Conventional text editor formulas
or  formulas grabbed from internet
screens can be pasted into green console.
# gold on  TCL Club, 12Dec2018 "
tk_messageBox -title "Self_Help" -message \$msg }
proc calculate {     } {
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 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 side8 \$calclength
}
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 eval {.console config -bg palegreen}
console eval {.console config -font {fixed 20 bold}}
console eval {wm geometry . 40x20}
console eval {wm title . " Paper and Felt Roll V2 Report, screen grab and paste from console 2 to texteditor"}
console eval {. configure -background orange -highlightcolor brown -relief raised -border 30}
console show;
puts "%|table \$testcase_number |printed in| tcl format|% "
puts "&| quantity| value| comment, if any|& "
puts "&| \$testcase_number :|testcase_number | |&"
puts "&| \$side1 :|diameter centimeters:  |   |&"
puts "&| \$side2 :|height centimeters:   | |& "
puts "&| \$side3 :|mass of roll kilograms: | |& "
puts "&| \$side4 :|surface density grams per square meters: | |&"
puts "&| \$side5 :|answers:roll volume cubic meters:  | |&"
puts "&| \$side6 :|roll density kilograms/cubic meters: |  |&"
puts "&| \$side7 :|optional: |  |&"
puts "&| \$side8 :|corrected height above ground meters: |  |&"
}
frame .buttons -bg aquamarine4
::ttk::button .calculator -text "Solve" -command { set side8 0 ; calculate   }
::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 50. 70. 25.37  250.1 0.137 184.58 0. 202.87 }
::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 50. 50. 17.17  250.2 0.098 174.89 0. 137.7 }
::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 50. 30.0 12. 250.9 0.058 203.3  0. 95.}
::ttk::button .clearallx -text clear -command {clearx }
::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  .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 . "Paper and Felt Roll 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 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   |&"  ```