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
gold Here is some eTCL starter code for calculating efficiency of heat engines from source temperature, fuel, and combustion chamber dimensions. The Novikov efficiency rating can be compared with a process fraction of useful work in an eTCL calculator, developed from some code on a firebox. The impetus for these calculations was checking rated efficiency in some heat engines. These heat engines are called endoreversible engines. These endoreversible engines are rated from the (equation) Chambadal-Novikov efficiency (Nu) = 1.- sqrt(sink temperature low over temperature source high) or Nu = 1.-sqrt(tl/t2). These efficiency ratings are related to the Carnot engine, which was rated as Carnot efficiency (Nu)=1.-(t1/t2). As an electrical analog, the chart of a Novikov engine looks somewhat like a voltage source to resistors/LED to ground, where the output light is offset by resistor losses. For another example, the fire in a brick oven will cook the pizza with energy called the process heat fraction here, but much of the heat energy goes into heating the oven and the brick walls. Most of the testcases involve modeled data, using assumptions and rules of thumb .
The Carnot heat engine with temperatures proportional to the golden ratio phi (1.618...) can be developed from the following relationships. The heat flow of work (W) equals the heat flow of the source (Qh) minus the heat flow of the sink (Qc). Following the Huleihul paper, the ratio of Qh/Qc = Qc/W, where the Carnot efficiency Nu = W/Qh, W=Qh-Qc,Qc=Qh-W, and W>Qc. The ratio equation Qh/Qc = Qc/W can be solved into a quadratic equation in f(Nu) . Moving terms, Qh*W=Qc*Qc,and substituting Qh*W = (Qh-W)*(Qh-W), Qh*W=Qh**2 -2*W*Qh+W**2. Shifting terms to the left side, Qh**2 +2*W*Qh+W*Qh+W**2 = 0, Qh**2 + 3*W*Qh+W**2 = 0, and dividing by Qh**2, 1+3*W*Qh/(Qh**2)-(W**2)/Qh**2=0. Substituting Nu=W/Qh and taking -1*, the equation is a quadratic equation in terms of f(Nu), Nu**2 - 3*Nu-1=0. Using the quadratic solution and leaving the negative solution behind, the quadratic solution is Nu =( 3+ (sqrt(5)) /2 or Nu=1-(1/phi), where phi is the golden ratio 1.618... For the Carnot engine limited to the golden ratio, Nu=0.382 and the initial equations and proportions take on a new utility for the Carnot engine. We have the ratio W/Qh=0.382 or ~ 4/10, Qh=2.6*W, and the ratio W/Qc = decimal 0.625 or ~6/10. Where Qh/Qc = Qc/W, then flipping W/Qh >> 1/0.382 for the right term, Qh/Qc= 1/0.625 or Qh/Qc=1.6, 1+6/10, or ~16/10. Returning to Nu=1-(1/phi), the losses part of the equation is (1/phi) and equals TL/TH. Rearranging terms in the equation 1/phi = TL/TH, so TL = TH*phi and TH = TL/phi.The solved ratios can be implemented into the eTCL routines for a firebox heat engine. Also, there are a lot of series and identities mathematics on the golden ratio, which are amenable to computer implementation (and peer review).
Another way of examining heat engines is the study of the loss portions of the Carnot and Novikov equations. The loss portion of the Carnot engine would be TL/TH and the loss portion of the Novikov would be sqrt(TL)/sqrt(TH). For both engines, the raising source temperature TH means lower losses and higher efficiencies. Likewise for the sink temperature TL, the lowering TL means lower losses and thus higher efficiencies.
A solar oven can be made from surplus parts to study the Novikov heat engine. A old wooden speaker box was painted with a black matte finish and was filled on the inside with a layer of styrofoam. The front of the speaker box was rectangular of width 40 cm and height 34 cm, extending back in a triangular form to about 45 cm. The diameter of the front speaker opening was about 22.6 cm. A V-shaped internal cavity was lined with glazed porcelain tiles. The thickness between the porcelain tiles and the wooden crate varies between 4 to 13 cm of styrofoam insulation. A small side hole of diameter 7 cm was kept as a side entry. In operation, the side cavity would be plugged with 1) a baffle of porcelain tile and 2) a conical styrofoam drink cup filled with bits of crushed styrofoam. The front circular opening just fit two pie pans of pyrex glass. Two pans were glued lid to lid together with epoxy for better insulation like so {}. The maximum diameter of the glued pans is 25 cm and the thickness of the disk is 7 cm. The sunlight enters the cavity through two layers of pyrex glass, a plastic fresnel lens, and a layer of air. The fresnel lens was intended to concentrate the entering energy in roughly the center of the cavity. At noon or solar max, the solar oven operates about 30 F or 20 C above the ambient temperature. The solar oven is usually propped up with three bricks to aim the front opening for the noon sun.
The interior of the solar oven is a V-shaped cavity of about 3400 cubic centimeters. The front of the V-shaped cavity is a rectangle about 15 cm wide and 19 cm height, extended back about 24 cm in a triangular form. The V-shaped cavity acts as a solar trap with angles such that entering solar energy is less likely to be reflected out of the cavity. The white porcelain tiles reflect a substantial portion of light and radiant heat energy back to the centered target. As noon approaches, the tiles and pyrex glass get hot and should be handled with a towel.
Several targets have been prepared and tried in the solar oven. For 24Aug2013, the shade temperature at noon was 90F or 32C. A small pint of tea in a transparent glass jar had reached a temperature of 110F or 42C at noon. At 1330 hours, the shade temperature was 89F or 31C and the small pint of tea was at 110F or 43C. At 1400 hours, the tea was replaced by a small sphere of wet green clay and by a small cup of roped green clay. Completely drying the clay would take about 3 days in this solar oven. At 1430 hours, a small blackened tin of soaked beans was added, but cooking beans is about a 8 hour job in this solar oven. The work of the heat engine was heating water, cooking beans, or drying green clay.
Targets painted a flat black have an advantage in a solar oven, so a tin can was painted black on the outside, brick was painted flat black, and a pint glass jar was painted flat black on the inside. Although steam can crack glass, there is some advantage in putting solid targets inside blackened containers or doubled containers, eg. a blackened jar inside a transparent jar with loose lids to allow pressure to escape. At the end of effective sunlight, if is possible to cover the front opening and insulate the solar oven to continue some cooking after daylight. A blackened brick or other solid object can be added inside the cavity to retain some residual heat after daylight. Another way of retaining heat is to pour heated beans or soup into a thermos bottle, after peak of solar heat in the day.
From the measured Kelvin temperatures, the Novikov efficiency of the solar oven can be calculated. At noon, the Novikov efficiency Nu(305K,315K) was 0.016, from the eTCL calculator. At 1330 hours, the Novikov efficiency Nu(304K,316K) was 0.019.
The formula for combined cycle efficiency is Nu(combined) = Nu(1)+Nu(2) - Nu(1)*Nu(2). For an example using round numbers, the yoked value of a gas turbine generating electricity and the exhaust heat fed to a steam generator generating electricity. The formula eTCL statements below can be pasted into the console window, when the eTCL report function is activated with access to the utility subroutines. The Carnot and Novikov efficiencies can also be estimated in the eTCL calculator separately. The temperatures for the gas turbine is 1700 degrees K and the exhaust is 900 K, in round numbers. The measured efficiency of the gas turbine is Nu(1) equals 0.40. The followon steam generator is 900 K and the exhaust is 400 K. The measured efficiency of the steam generator is Nu(2) equals 0.33. The combined efficiencies from the Novikov formula (not measured), the Nu(combined) = Nu(1)+Nu(2) - Nu(1)*Nu(2), Nu(combined) = 0.40+0.32-(0.40*0.32), Nu(combined)= 0.592 or 59.2 percent. Comparing the measured efficiencies with the Novikov formula, the Novikov formula for the steam generator was in close agreement with the measured results, the Novikov results for the gas generator was not so good. Both the Carnot and Novikov formulas assume Newtonian heat flow, and above 900 K degrees radiant heat transfer (T**4 terms) becomes more important. The gist is that the Carnot and Novikov formulas start to break down above 900 K.
namespace path {::tcl::mathop ::tcl::mathfunc} set Nu_combined [ - [ + 0.40 0.32 ] [* 0.40 0.32 ] ] answer% 0.592 for measured efficiencies set carnotefficiency_gas_turbine [ carnotthermic 1700 900] answer% 0.4705 or 47 percent set novikovefficiency_gas_turbine [ endothermic 1700 900] answer% 0.272 set carnotefficiency_steam [ carnotthermic 900 400] answer% 0.555 set novikovefficiency_steam [ endothermic 900 400] answer% 0.33 set Nu_combined_Novikov [ - [ + 0.272 0.33 ] [* 0.272 0.33 ] ] answer% 0.512 for Novikov estimated efficiencies
The formula for combined cycle efficiency is Nu(combined) = Nu(1)+Nu(2) - Nu(1)*Nu(2). It might be wondered why the Carnot efficiency is calculated and tracked with the Novikov efficiency? The Carnot efficiency is good at predicting the amount of heat loss to stack when natural gas is burned. Maybe a numerical coincidence, but when natural gas burned completely in air, about 50 to 60 percent heat goes up the stack. Without other considerations like power generation and radiant heat transfer, the efficiency of the natural gas furnace is 100%-(50% to 60% up the stack) or 50 to 40% efficient ( vis. measured gas Nu 40% vs Carnot 47 %).
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).
Pizza is baked for 20 minutes or 20*60, 1200 seconds in a brick oven, wood fired. Sink temperature T1 (300) and source temperature T2 ( 900 ) are inputs. The calculations should be carried out in Kelvin degrees. Exhaust or low temperature T1 is fixed at 300 degrees kelvin. Firing max temperature is calculated on a separate track, solving T**4 equation in chamber.
testcases | T1 | T2 | Carnot Nu | Endoreversible Nu | Endo fraction process K2*Nu |
---|---|---|---|---|---|
1 | 300 | 900 | 0.666 | 0.422 | 0.166 |
2 | 300 | 1200 | 0.75 | 0.5 | 0.187 |
3 | 300 | 1400 | 0.785 | 0.537 | 0.196 |
4 | 300 | 700 | 0.57 | 0.345 | 0.142 |
namespace path {::tcl::mathop ::tcl::mathfunc} set Nu_Carnot [ - 1. [/ 300. 900. ] ] set Nu_Carnot [ - 1. [/ 300. 1200. ] ] set Nu_Carnot [ - 1. [/ 300. 1400. ] ] set Nu_Carnot [ - 1. [/ 300. 700. ] ] set Nu_Endoreversable [ - 1. [sqrt [/ 300. 900. ] ]] set Nu_Endoreversable [ - 1. [sqrt [/ 300. 1200. ] ]] set Nu_Endoreversable [ - 1. [sqrt [/ 300. 1400. ] ]] set Nu_Endoreversable [ - 1. [sqrt [/ 300. 700. ] ]]
quantity | value |
---|---|
testcase number | 1 |
piston diameter meters | .5 |
piston height meters | .5 |
piston firing seconds | 1200 |
volume cubic meters | 0.098 |
total energy MJ | 153.962 |
piston volume m*m*m | 0.0981 |
heat source temperature T2 | 900. |
heat sink temperature T1 | 300. |
max room fuel kg | 83.448 |
estimated fuel, kg | 11.404 |
total heat megajoules | 153.962 |
firing max temperature | 1202 |
man workdays to load fuel | 0.0327 |
Carnot efficiency | 0.666 |
Novikov efficiency | 0.422 |
process fraction applied/total | 0.166 |
name | water boiled | measured Nu | Novikov Nu | Carnot Nu | Th | Tl |
---|---|---|---|---|---|---|
stove 1 | 1 liter | 49.4 | 42.414 | 66.839 | 96.5 | 32. |
stove 2 | 1 liter | 43.8 | 49.349 | 74.345 | 95.5 | 24.5 |
stove 3 | 0.5 liter | 32.4 | 50.129 | 75.1 | 96.5 | 24. |
set Nu_Carnot [ - 1. [/ 32. 96.5 ] ] set Nu_Carnot [ - 1. [/ 24.5 95.5 ] ] set Nu_Carnot [ - 1. [/ 24. 96.5 ] ] set Nu_Novikov [ - 1. [sqrt [/ 32. 96.5 ] ]] set Nu_Novikov [ - 1. [sqrt [/ 24.5 95.5 ] ]] set Nu_Novikov [ - 1. [sqrt [/ 24.5 96.5 ] ]]
name | measured Nu | Carnot Nu | Novikov Nu | Th | Tl | fuel |
---|---|---|---|---|---|---|
kiln 1 | .60 | C 0.781 | N 0.532 | 1370k | 300 k | coal |
kiln 2 | .62 | C. 0.785 | N.0.537 | 1400k | 300 k | coal |
#Not sure formulas work on kilns?
set Nu_Carnot [ - 1. [/ 300. 1370. ] ] set Nu_Carnot [ - 1. [/ 300. 1400. ] ] set Nu_Novikov [ - 1. [sqrt [/ 300. 1370. ] ]] set Nu_Novikov [ - 1. [sqrt [/ 300. 1400. ] ]]
The fuel used was wood at 237 kg in 135 min or 135*60 or 8100 seconds. The average heat flux was 237*16 MJ/kg over 8100 seconds, 237*16/8100, or 0.468 MJ/S. A WATT is a joule per second, so the heat power is 0.468 E6 J/S, or 4.68E5 watts.Using electrical analog model, Q in watts equals (TH-TL)/(R1+R2+R3+R4) or (TH-TL)/(SUM of R) , where TH=1200 deg K and TL=300 deg K. From the eTCL calculator, Nu(1200,300)returns Carnot Nu 0.75 and Novikov Nu 0.5. The thermal current is estimated as I=4.68E5 watts Many statements below can be pasted into eTCL console window.
set current 4.5E5 R= delta T/ power or(1200K-300K) /4.68E5 watts delta 1200K-300K = 900K (SUM of delta T’s of each R) set R_overall [/ 900 4.65e5] SUM R =0.00190 OR 1.9e-3 R2 is largest component of SUM R For each R step, R= delta T/ power R1 is delta 100K / 4.5E5 =0.000222 R2 is delta 700K / 4.5E5 =0.001555 R3 is delta 50K / 4.5E5 =0.0001111 R4 is delta 50K / 4.5E5 =0.0001111 2% set R1 [/ 100 4.5E5] 0.000222 3% set R2 [/ 700 4.5E5] 0.001555 4% set R3 [/ 50 4.5E5] 0.001111 5% set R4 [/ 50 4.5E5] 0.001111 6% set sumR [+ 0.000222 0.001555 0.000111 0.000111 ] 0.00199 P=VOLTS*CURRENT>> (T1-T2)*I set R2_power [* [- 800 100] 500] 350000 set efficiency [/ 3.5E5 4.5E5 ] 0.77777 set process_heat [/ [* [- 100 50] 500] 4.5E5 ] 0.0555 or 5.55 percent. Only small portion of heat cooks pizza
# TCL source code follows # pretty print from autoindent and ased editor # heat engine combustion 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 {{} {combustion chamber diameter meters:} } lappend names {combustion chamber height meters:} lappend names {heat source temperature input: } lappend names {heat sink temperature input: } lappend names {optional:} lappend names {answers: volume cubic meters: } lappend names {total heat units, megajoules: } lappend names {endo process, applied/total energy: } 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 Heat Engine Combustion Calculator V2 from TCL Club # gold on TCL Club, 12Dec2018 " tk_messageBox -title "About" -message $msg } proc self_help {} { set msg " Heat Engine Combustion Calculator V2 from TCL , # self help listing # problem, Heat Engine Combustion Calculator V2 # 1 given follows. 1) combustion chamber diameter meters: 2) combustion chamber height meters: 3) heat source temperature input: 4) heat sink temperature input: # 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 grabbed from internet screens can be pasted into green console. # gold on TCL Club, 12Dec2018 " tk_messageBox -title "Self_Help" -message $msg } proc pi {} {expr acos(-1)} proc pistonvolumex { d h } { set pistonvolumexxx [* .25 [pi] $d $d $h ] return $pistonvolumexxx } proc heatx { vol density } { set fuel_mass [* $vol $density] set total_heat [* $fuel_mass 40.1] return $total_heat } proc endothermic { theatsource tlow } { set endo [expr { 1.-sqrt($tlow)/sqrt($theatsource)} ] return $endo } proc carnotthermic { theatsource tlow } { set theatsource [* 1. $theatsource] set tlow [* 1. $tlow] set carnot [- 1. [/ $tlow $theatsource]] return $carnot } proc endoprocess { theatsource tlow } { set theatsource [* 1. $theatsource] set tlow [* 1. $tlow] set endoprocess [* .25 [- 1. [/ $tlow $theatsource]]] return $endoprocess } proc firebox { total_heat burn_time cross_section temp_ambient temp_flame} { set d $cross_section set firing_temp 1 set heat_flux [/ $total_heat $burn_time] set heat_flux_persec [/ $heat_flux $burn_time] set cross_section [ / [* [pi] $d $d ] 4.] set item 25 set temp_ambient 25 set temp_flame 1488. set tx $temp_ambient set taxx $temp_flame set t 25 set h [/ $heat_flux_persec $cross_section] while {$item <= 4000} { incr item set t [+ $t 1 ] set term1 [* 1. $t $t $t $t] set term2 [* 1. $tx $tx $tx $tx] set term1 [* .000000000056703 [ - $term1 $term2]] set term2 [* $h 1.1 [/ [- $taxx $t] [ - $taxx $tx ]]] set difference [abs [- $term1 $term2]] if {$difference < 2.} { set temp_answer $t } } return $temp_answer } proc calculate { } { global answer2 global side1 side2 side3 side4 side5 global side6 side7 side8 global testcase_number incr testcase_number global piston_volume piston_temperature_exp global workdays total_heat massfromvolume global total_heat firebox_temp heatsourcetemp2 global carnotefficiency novikovefficiency global idealappliedovertotal piston_firing_time global heatsinktemp1 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. ] incr testcase_number set piston_diameter $side1 set piston_height $side2 set piston_firing_time [* 2 60 10] set heatsourcetemp2 $side3 set heatsinktemp1 $side4 set piston_volume 1 set piston_volume [pistonvolumex $piston_diameter $piston_height] set fuel_density 850 set massfromvolume [* $piston_volume $fuel_density] set fuel [* [ / 8.2 60. ] $massfromvolume] set total_heat [* 13.5 $fuel] set temp_amb 25. set temp_flame 1488. set piston_temperature_exp $temp_flame set total_heat_joules [* $total_heat 1.0E6] set firebox_temp [firebox $total_heat_joules $piston_firing_time $piston_diameter $temp_amb $temp_flame] if {$piston_temperature_exp > 1200.} {set piston_temperature_exp 1200} set workdays [/ $piston_volume 3. ] set carnotefficiency [ carnotthermic $heatsourcetemp2 $heatsinktemp1] set novikovefficiency [ endothermic $heatsourcetemp2 $heatsinktemp1] set idealappliedovertotal [ endoprocess $heatsourcetemp2 $heatsinktemp1] set fractionwork [ endoprocess $heatsourcetemp2 $heatsinktemp1] set side6 $piston_volume set side7 $total_heat set side8 $fractionwork } 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 answer2 global side1 side2 side3 side4 side5 global side6 side7 side8 global testcase_number global piston_volume piston_temperature_exp global workdays total_heat massfromvolume global total_heat firebox_temp heatsourcetemp2 global carnotefficiency novikovefficiency global idealappliedovertotal piston_firing_time global heatsinktemp1 console eval {.console config -bg palegreen} console eval {.console config -font {fixed 20 bold}} console eval {wm geometry . 40x20} console eval {wm title . " Heat Engine Combustion Report V2, 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 :|combustion chamber diameter meters: | |&" puts "&| $side2 :|combustion chamber height meters: | |& " puts "&| $side3 :|heat source temperature input: | |& " puts "&| $side4 :|heat sink temperature input: | |&" puts "&| $side5 :|optional: | |&" puts "&| $side6 :|answers: volume cubic meters | |&" puts "&| $side7 :|total heat units, megajoules: | |&" puts "&| $side8 :|endo process, applied/total energy: | |&" } frame .buttons -bg aquamarine4 ::ttk::button .calculator -text "Solve" -command { set side8 0 ; calculate } ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup .5 .5 900. 300. 0. 0.0981 153.9 .166 } ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 1.5 1.5 1200. 300. 0. 2.65 4156. .1875 } ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 2. 2. 1400. 300. 0. 6.28 9853. .196 } ::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 . "Heat Engine Combustion Calculator V2"
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. While the testcases are in meters, the units either cancel out or are carried through in the calculator equations. So the units could be entered as English feet, Egyptian royal cubits, Sumerian gars, or Chinese inches and the outputs of volume will in the same (cubic) units. This is an advantage since the units in the ancient Sumerian, Indian, and Chinese texts are open to question. In some benign quarters of the globe, feet and cubic feet were still being used for design in the 1970's.
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 |&"
# pretty print from autoindent and ased editor # Novikov efficiency of small gas stoves # written on Windows XP on eTCL # working under TCL version 8.5.6 and eTCL 1.0.1 # gold on TCL WIKI , 8aug2013 package require Tk namespace path {::tcl::mathop ::tcl::mathfunc} console show proc novikov { theatsource tlow } { set endo [expr { 1.-sqrt($tlow)/sqrt ($theatsource)} ] return $endo } proc carnot { theatsource tlow } { set theatsource [* 1. $theatsource] set tlow [* 1. $tlow] set carnot [- 1. [/ $tlow $theatsource]] return $carnot } proc k { temperature } { set temperature [+ $temperature 273. ] return $temperature } puts "%|name|water boiled|measured Nu|Novikov Nu|Carnot Nu |%" puts "&|stove a|1 l|49.4|[* 100 [novikov 96.5 32.]]|[* 100. [carnot 96.5 32.]]|&" puts "&|stove b|1 l|43.8|[* 100. [novikov 95.5 24.5]] |[* 100. [carnot 95.5 24.5]] |&" puts "&|stove c|0.5 l|32.4|[* 100. [novikov 96.5 24.]] |[carnot 96.5 24.]|&"
Please place any comments here with your wiki MONIKER and date. Thanks, gold 12DEC2018
Category Numerical Analysis | Category Toys | Category Calculator | Category Mathematics | Category Example | Toys and Games | Category Games | Category Application | Category GUI |