Oil Molecule Length Calculator and eTCL Slot Calculator Demo Example, numerical analysis

Oil Molecule Length Calculator and eTCL Slot Calculator Demo Example

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 12Dec2018



Introduction

gold Here is some eTCL starter code for the length of an oil molecule. The impetus for these calculations was checking some references in Sanskrit mathematics and the Roman poet Lucretius. Most of the testcases involve experiments or models, using assumptions and rules of thumb.

The gist of the calculations is finding the height of the oil slick as the length of the oil molecule. An eye dropper is used to drop one drop of oil into a bowl of water. Since the volume of oil is known, the height of the oil slick would be volume divided by the surface area of the circular oil slick. The average length of the atoms composing the oil molecule would be the height of the oil slick divided by the number of atoms in the oil molecule (12 for olive oil).

For home experiments, obtain a centimeter ruler, eye dropper from pharmacy, cereal bowl about 15 centimeters or more in diameter, and a small bottle of oil. The home experiments reported here used olive oil, but other oils are usable. Fill the bowl with about 3/4 water at room temperature. Distilled water without chlorine is advisable, but not absolutely necessary. Place oil drop in the center of the bowl. The oil should spread out into a circle or oval and then retreat somewhat due to surface tension. Measure the diameter of the oil slick, just after the oil slick contracts due to surface tension. Just after the contraction, the molecules are shoulder to shoulder and the best orientation. In a few minutes, the oval oil slick will disperse or change into an irregular shape.


For the experiments, 20 drops = 1 milliliter and 1 drop = 0.05 milliliter of oil. It is very important to try to drop the same amount each time, under the same temperature conditions. After a few trys with the eye dropper and when similar or average diameters are seen, write the oil slick diameters and temperature of the room/oil. Averaging the oil slick diameters over three or more times seemed to give the best results. Colors on the oil slick can be interpreted that the height of the oil slick is approaching the wavelength or a multiple wavelength of the colored light. Different colors of red, blue, and green on the oil slick mean that portions of the oil slick are different heights. Carefully look for the original contraction as a uniform color on the oil slick may indicate a uniform average height, which becomes more variable as the oil slick disperses. A sodium vapor lamp or filtered light source of consistent wavelength should help further define the height of the oil slick. --- Trying to find some earlier estimates of atomic theory from other cultures. The Svetasvatara Upanisad of Vedic literature indicated an atman was one ten thousandth of the diameter of a human hair, expressed as (1/00)*(1/100). or 10-4 . A human hair averages 80 microns or 8E4 nanometers. An atman would be 8E4/1E-4 or 8 nanometers. Possibly, the Sanskrit word atman (soul particle?) was derived from atman (breath). In some Sanskrit texts, the root word ama (mother or source) was associated or used as meaning soul. Since an insulin molecule is 5 nanometers and a hemogoblin molecule is 6 nanometers, an atman of 8 nanometers compares to human molecules within an order of magnitude.


The Sumerians used oil films in bowls for divination purposes under tutoring of gods Enhil, Enki, and Ea, ref WG. Lambert (Enmeduranki,pg115) circa 2500BCE. Sumerian mathematics was quite capable enough to figure the volume of oil and the diameter of an oil slick, but there is no known text on this issue. The nearest Old Babylonian texts are coefficient lists to figure the thickness of bitumen waterproofing of floors and the thickness of orpiment paint on walls.


Early references to atomic theory in English."It is as easy to count atomies as to resolve the propositions of a lover" from Shakespeare, As You Like It, 1590 CE. This Shakespeare quote is believed to be derived from the Roman Lucretius, 20 CE. Benjamin Franklin was performing oil and oil slick experiments in 1780's France under influence of French scientists.


In 1890, Lord Rayleigh published an R.S. paper on pieces of camphor affected by thin olive oil films. In one experiment, 81 milligrams of olive oil or 0.9 cubic centimeters of olive oil was spread a diameter of 84 cm over water in a metal tray. Lord Rayleigh estimated the thickness of the olive oil film at 1.63 micro-millimetres. Not to overstate the case, the original Rayleigh paper in 1890 did not claim the thickness of the oil film represented a single layer of molecules. At this point, we are primarily checking the accuracy of the eTCL calculator in estimating the thickness of the oil film. The eTCL calculator returned a molecule length of 1.624 nanometers for olive oil and an average length of oil atoms as 1.624/12 or 0.135 nanometers. The eTCL calculator is returning compatible thickness with the table of film trials in the Rayleigh report.


Pseudocode Section

    pseudocode can be developed from rules of thumb.
    pseudocode: enter diameter in cm, number of atoms in oil molecule
    pseudocode: output film thickness in nanometers
    pseudocode: average of atoms equals film thickness/ (number_of_atoms)
    pseudocode: rules of thumb can be 3 to 15 percent off, partly since g..in g..out.
    pseudocode: need test cases > small,medium, giant
    pseudocode: need testcases within range of expected operation.
    pseudocode: are there any cases too small or large to be solved? 

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

Testcase 1 table printed in tcl wiki format
quantity value comment, if any
testcase number 2
initial drop volume, cubic millimeters: .005
diameter oil slick centimeters: 60.
number of atoms in molecule : 12.0
answers: oil molecule height : 1.768
oil atom (average) nanometers: 0.147
oil atom (average) nanometers: 0.147
oil atom (average) nanometers : 0.147

Testcase 2

Testcase 2 table printed in tcl wiki format
quantity value comment, if any
testcase number 3
initial drop volume, cubic millimeters: .065
diameter oil slick centimeters: 220.
number of atoms in molecule : 12.0
answers: oil molecule height : 1.709
oil atom (average) nanometers: 0.142
oil atom (average) nanometers: 0.142
oil atom (average) nanometers : 0.142

Testcase 3


Testcase 3 table printed in tcl wiki format
quantity value comment, if any
testcase number 4
initial drop volume, cubic millimeters: .125
diameter oil slick centimeters: 280.
number of atoms in molecule : 12.0
answers: oil molecule height : 2.030
oil atom (average) nanometers: 0.169
oil atom (average) nanometers: 0.169
oil atom (average) nanometers : 0.169

Testcase 4

Lord Rayleigh Paper, RS.47. 1889 - 1890 table printed in tcl wiki format
quantity value comment, if any
testcase number 4
initial drop volume millimeters: .009
diameter oil slick centimeters: 83.
number of atoms in molecule : 12.0
answers: oil molecule height : 1.663
oil atom (average) nanometers: 0.138
oil atom (average) nanometers: 0.138
oil atom (average) nanometers : 0.138

Screenshots Section

figure 1.


References:

  • Lord Rayleigh, Measurements of the Amount of Oil,Royal Society of London, Vol. 47 (1889 - 1890)
  • molecule using an oil film [L1 ]
  • Diameter of oil molecule, Worsley School
  • Atom and Atma, Sanskrit definitions and article.
  • Concepts of atom, Kanada and Pakudha Katyayana,
  • Vaisheshika was an Indian Philosophy around 600 BCE (era of Buddha)
  • Science, Medicine, Technology in Ancient India
  • Measuring the Size of a Molecule, Science Curriculum by Aaron Keller
  • A well-oiled future: Recreating Babylonian oil divination,Alex Loktionov
  • The Rebels Who Challenged The Law Of Karma, Written by Prabhakar Kamath

Appendix Code

appendix TCL programs and scripts

        # pretty print from autoindent and ased editor
        # Oil Molecule Calculator
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL Club , 2may2014
        # comment follows from gold, 12Dec2018
        # pretty print from autoindent and ased editor
        # Oil Molecule Calculator V2
        # written on Windows XP on TCL
        # working under TCL version 8.6
        # Revamping older program from 2014.
        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 {{} { initial drop volume, cubic  millimeters:} }
        lappend names { diameter oil slick (average dimension) centimeters::}
        lappend names { number of atoms in molecule: }
        lappend names { answers:  oil molecule nanometers:}
        lappend names { oil atom (average) nanometers:}
        lappend names { oil atom (average) nanometers:}
        lappend names { oil atom (average) nanometers:}
        lappend names { oil atom (average) nanometers:}
        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 pi {} {expr acos(-1)}
        proc about {} {
            set msg "Calculator for Oil Molecule V2
            from TCL ,
            # gold on  TCL Club, 12Dec2018  "
            tk_messageBox -title "About" -message $msg }
        proc self_help {} {
            set msg " Oil Molecule Calculator V2
            from TCL Club ,
            # self help listing
            # problem, Oil Molecule Calculator V2
            # 3 givens follow.
            1) initial drop volume, cubic  millimeters:
            2) diameter oil slick (average dimension) centimeters:
            3) number of atoms in molecule:
            # Formulas in calculator makes
            # assumptions on how oil molecules and atoms
            # are stacked and oriented in
            # an oil slick.
            # 1) Assumption: oil atoms are
            # stacked vertically, due to
            # electostatic forces on the oil molecule.
            # 2) Assumption: the oil
            # slick is one molecule thick.
            # 3) Assumption: The oil atom has the thickness
            # of the oil molecule divided by the
            # given number of atoms.
            # 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.
            # >>> copyright notice <<<
            # This posting, screenshots, and TCL source code is
            # copyrighted under the TCL/TK license terms.
            # 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 answer2
            global side1 side2 side3 side4 side5
            global side6 side7 side8 testcase_number
            incr testcase_number
            set dropvol $side1
            set diameter_oil_slick  $side2
            set numberatoms $side3
            set height [ expr {  (4.*$side1*1E6)/([pi]*$side2*$side2)} ]
            set side4 $height
            set side5 [ expr { ($side4/$side3)} ]
            set side6 [ expr { ($side4/$side3)} ]
            set side7 [ expr { ($side4/$side3)} ]
            set side8 [ expr { ($side4/$side3)} ]
            return $side5
        }
        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 testcase_number
            global nonopttotal mergedx
            console eval {.console config -bg palegreen}
            console eval {.console config -font {fixed 20 bold}}
            console eval {wm geometry . 40x20}
            console eval {wm title . " Oil Molecule Calculator 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 |printed in| tcl format|% "
            puts "&| quantity| value| comment, if any|& "
            puts "&| testcase number| $testcase_number||& "
            puts "&| initial drop volume millimeters:| $side1 ||&"
            puts "&| diameter oil slick centimeters:| $side2||& "
            puts "&| number of atoms in molecule :| $side3||& "
            puts "&| answers:  oil molecule height :| $side4 ||&"
            puts "&| oil atom (average) nanometers:| $side5||& "
            puts "&| oil atom (average) nanometers:| $side6 ||&"
            puts "&| oil atom (average) nanometers :| $side7 ||&"
            puts "&| oil atom (average) nanometers :| $side8 ||&"
        }
        frame .buttons -bg aquamarine4
        ::ttk::button .calculator -text "Solve" -command { calculate   }
        ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup .005 60. 12.0  1.76  .15 .15  .15 .15}
        ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup .065 220. 12.0  2.0 .15 .15 .15 .15}
        ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup .125 280. 12.0 2. .15 .15  .15  .15}
        ::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 . "Oil Molecule 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   |&"  


Comments Section

Please place any comments here with your wiki MONIKER and date, Thanks.gold12Dec2018