Categories
Document Study

Coal Evaluation Program

During my last visit I made a stop at Dr. Lin’s office. I’ve been in there many times before and picked up a few things, but this time it seemed different. Did the wind create some upheaval of documents? Other explorers perhaps? Or maybe it is all just my perception? At any rate I got to work and grabbed my bucket and really started tossing the room. I found a variety of interesting things but this takes the cake.

To hold an old document in my hand is a real thrill. To look around you and think that people stood where you are standing, holding that same document. The difference being that then, it was filled with action and work being done in every direction, as far as they eye can see. Not a freezing cold Saturday morning, as lonely as the last corner of the earth, as I often find myself. Those moments are potent. Better still is to find a memo, or a handwritten document and you can get a stronger sense of real people that were there before me, often long before me.

I’ve pulled out a variety of artifacts that needed restorations to bring them back to life. This is a higher level of experience, to put yourself more securely in the shoes of the men and women that came before me. Of course they were not explorers who approached via bicycle, but real people who made coke and fed their families. I treasure all the things I’ve taken home and those I have restored are even more precious to me as they link me to this place that I love so much.

But to find a computer program is as close to a time machine as you are going to get. To watch a rusty wrench come back to life with the help of some sandpaper is eye opening. But software is interactive and when I can get it to operate, and accept my input, and output it’s results… then you know you are in the same place that others were. The times have changed, the plant has undergone a radical transformation of entropy, but the software is truly forever.

I have found 3.5″ floppies (could not get them to read unfortunately). I have found 5.25″ floppies but my feet are a bit cold on purchasing another drive to find that I cannot extract the data. I even have a 60MB 1/4″ tape cartridge which I may never know what is held inside. But to find a printed copy of the actual code is a hell of a moment. In my vast luck, I found two versions of the same piece of software, no doubt developed in-house.

For a variety of reasons, you cannot use one type of coal to make coke. And blending different types is true alchemy, the type that can destroy your battery or foul your blast furnace if done incorrectly. Petrography, and the study of the qualitative characteristics of coal is an important and precise science for any coke plant. Dr. Lin was truly a revolutionary who fought for a legitimate lab, and he got his wish in 1979.

A real life blend at Acme, in Dr. Lin’s unmistakable handwriting.
1974 coal blend

Blending coal means finding the qualities you want and tempering those you don’t with a dissimilar coal. Perhaps one coal has a ideal levels of volatile matter but a high level of sulfur – balance it with one with opposite qualities. You get the idea. If you were only blending 2 or 3 coals, you could probably crank out the data fairly quickly on a pocket calculator. Today, a spreadsheet with some integrated formulas could go a long way. But when you are blending upwards of four or five coals, and maybe a dose of petcoke to spice things up, the witch’s brew gets complicated quickly. So someone sat down and put together about 500 lines of BASIC, probably on an IBM machine, that could take your input on all the necessary measurements of your coal and crank out a bunch of useful data via a nearby printer.

Version 1.0 (1986)

The first version of the software I found was printed on a dot matrix printer no doubt, the type with perforated edges where a pin drive in the printer fed things along. The pages are also perforated but yet unseparated and still continuous. It mentions that it uses costs current to November 1986. I started high school in 1991, but the years prior to that I could usually be found in the computer lab at my grade school where we had ten or twelve Apple IIe (and a couple outcast TI machines in the corner). My parents probably took a second mortgage on the house to get me an Apple IIc+ around the same time and I spent thousands of hours messing around in BASIC. I never wrote a program but I enjoyed tinkering with the code, then loading the program to see what would result. Intuition isn’t a great way to write software but it sure is fun. Anyway, I remembered enough to recognize this as BASIC and I quickly flipped through the pages to see if the whole program was intact. Through some miracle it was and the paper was perfectly clean; clearly it had been waiting for me.

A simple interface asks how many coals in your blend, then asks for a number of values which you are expected to have:

  • cost/ton
  • % in blend
  • water content
  • fixed carbon
  • ash
  • volatile matter
  • sulfur
  • oxygen content
  • BTU

And with that, it outputs a couple pages of useful data so you can see if the blend will make quality iron or blow out the walls in your ovens. I did not recognize the LPRINT commands throughout the program so I did some research: this was so that all the output was sent to a printer, and not displayed on the screen. I knew this would be impractical or impossible so I was able to figure out how to send it to a text file. And with that, I sat down to enter the code as quickly as I could, because I could not wait to see it in action.

After correcting the many typos I instituted, it indeed did run! I have since made a number of tweaks and improvements. I do not claim to be a BASIC expert but there are some lines that just don’t make sense, so I have done my best to correct what I could. The formatting on the output file was a disaster and took countless restarts to slowly push the columns into place. The software works great but it is extremely tedious to input the nine variables, separated by commas, without making a mistake. I had to do some general research on coal to figure out what acceptable real world values for these variables would be but largely it seems like it will accept almost anything. The software does not process decimals, though you may enter them, it will simply round them to the nearest whole number.

The final question it asks you before finishing your output file is the ‘predicted coke stability’. I can only think this is a reference to the use of coke in the blast furnace as a ‘burden’. Coke is used as an accelerant or fuel but structurally it is also required in the layer cake of ore and limestone that is dumped down into the furnace. My research led me to believe that this would be expressed as a percentage, based on a screening test of coke before it is used in the furnace plant. Initially I was chasing a goose who was quite wild, because the program would just crash no matter what I seemed to enter. Eventually I found that it will only accept a value between 1 and 20. I do not know the unit of measurement used there, or if this is a genuine bug, but at least I could get it to run. And with that success, I moved onto v2.0.

Version 2.0 (1991)

Apparently I was not the only one who complained about the tedium of entering quality information for your coals, because the second version of the software does address this. This program cites 1991 in the code itself, and December 3rd 1997 is handwritten in red ink at the top of the first page. The output file references that year as well. It seems that 1997 new costs were loaded into the program, but the original code is original from 6 years earlier. As far as coal quality info, this program has 48 coals and 6 petcokes programmed in by name, with an accompaning code and all the necessary data. This means 54 ‘DATA’ lines and 54 REM statements. Once I survived inputting and debugging that ordeal, I saw that the software even allows you to print a hard copy of the coal/petcoke list for your reference – very handy! Again, the formatting was a mess but this also let me find my many typos so I could correct them one by one.

v2.0 was far easier to debug because it took me only seconds to create a coal blend by referencing the coal code numbers and blend percentages so I could immediately examine the output file. v1.0 took much longer and could be very frustrating as a result – debugging these programs took hundreds of restarts. I would see something in the output file, then go into the code to make a change, save the code, restart the compiled code, enter my coal info and output a new file. Again and again and…

Both of these versions claim a max number of coals to be used in the blend, but I do not see where in the code that limitation is implemented. However, I did attempt a 5 coal + 1 petcoke blend in v2.0 and the %wet coal calculation was incorrect. It looks like 3 coal + 1 petcoke is the max before it starts miscalculating. Also, v2.0 doesn’t seem to have the issue with the coal stability needing to be between 1-20.

There are definitely other bugs that I just couldn’t figure out. Neither version seems to correctly calculate the use of COG. The by-product credits in v2.0 didn’t work at all. An examination showed that the formulas were referencing non-existent variables. I created new formulas the best that I could but I don’t know if this is real world accurate. I should have saved the original input of the hard copy code so you could see how many issues there were. The finished product here isn’t perfect but if I dare say so, it is damn near. A huge thanks to the people at QB64org who were super helpful in troubleshooting v1. Turned out it was user error and not a code issue and they were very helpful in pointing that out and offering other expertise. At any rate, I could go on and on but you might as well have a go yourself! Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *