Cherry Blossom Viewing Equation 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 in your comment with the same courtesy that I will give you. Its very hard to reply understandably without some background of the correspondent. Thanks,gold


gold Here is some eTCL starter code for calculating the cherry blossom equation, used for predicting mean temperature days (DTS) until peak cherry blossom viewing at Japanese weather stations and cities. This report will use less strict definitions and not consider confidence levels, since the main interest is developing a simple and quick slot calculator. The problem of predicting Japanese cherry (sakura) blossom viewing is similar to predicting harvest dates of fruits and vegetables worldwide, so there is considerable economic interest in the equation. Most of the testcases involve replicas or models, using assumptions and rules of thumb.

In planning any software, it is advisable to gather a number of testcases to check the results of the program. The results of the testcases are estimated using the hand calculator and then checked in the eTCL slot calculator. Pseudocode and equations are developed from the hand calculations and theory. Small console programs are written to check or proof the alternate subroutines or procedures, rather than keeping the unblessed code and comment lines in the main slot calculator. Finally the improved or alternate subroutines are loaded into the slot calculator. The eTCL slot calculator is effectively a shell program to input entries, host calculation routines, and display results. Additional significant figures are used to check the eTCL calculator, not to infer the accuracy of inputs and product reports.

Testcases

Testcase 1: Each site has selected DOY ( date of year) to start measurements of daily mean temperature in Kelvin degrees. The mean temperature for 25 days (temperature series entered or list in program) is calculated for the daily value of DTS, mean standard temperature equivalent day. The DTS calculation uses the R gas constant as 8.31432 Joules per (Mole* degree kelvin) and blossom exponential constant which ranges from 6 to 60 Kilojoules per Mole. Testcase 1 uses blossom constant of 17 KJ/Mole. The combined exponential constant is (blossom exponential constant / R_gas_constant)*{(mean_temperature1-standard_temperature2)/ (mean_temperature1*standard_temperature2)}. The expression with the temperatures is equivalent to {(1/ standard_temperature2)- (1/mean_temperature1)} . The individual DTS value is exp(combined exponential constant). Typical daily value of calculated DTS ranges from 0.4 to 1.0 equivalent day during spring in Japan. The cumulative DTS estimate is divided by 25 days for the bloom prediction DTS delta days. The julian date for the sakura bloom viewing is the DOY or julian equivalent plus the DTS delta days. The cherry blossom equation is very sensitive to the blossom exponential constant, which is selected for the several sakura and plum varieties across Japan.

Push Button Operation

For the push buttons in the eTCL slot calculator, the recommended procedure is push testcase to fill entry 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. The current result numbers will be cleared on the next solve button. The calculator display has a caution flag subroutine for negative numbers, unrecognizable text characters, and operation outside expected operation range. On a degrading scale, the calculator will post warning flags to the console report, issue degraded accuracy notices, and may reset some negative and offscale numbers to positive defaults. Errors pass through the warning flag routine once on the same testcase and multiple error calls on the same fault are possible. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the functions (subroutines).

Pseudocode and Equations

 expr (($aa - $bb)*($aa - $bb)/ ( $cc * [pi]* $dd* $dd*$ee))]} 

Testcases Section

Testcase 1


Testcase 2


Testcase 3


References:

  • Stat

Appendix Code

appendix TCL programs and scripts

        # pretty print 

gold This page is copyrighted under the TCL/TK license terms, this license .

Comments Section

Please place any comments here, Thanks.