Programming saved me from calculus
At the beginning for necessity: I needed a tool to speed and to check the exercises at the University, today I reduced drastically times in designing.
Sometimes a casual event leads to a surprising result, like the finding of an twelve years old calculator, a Sharp PC-E500S in the original box and yet in a good state of conservation.
It had been given to my brother for Confirmation Sacrament. After a short time it was neglected and leave inside a carton for years... So What was I supposed to do? I had already had a simple scientific calculator, but without the qwerty keyboard and the programming ability like the first type. It was a real pocket computer, programmable in BASIC, a language familiar to me. OK, but these considerations do not answer at the previously question!
I had found the manner to use it, while I was doing some repetitive exercise of hydraulic structures. In these exercises I had to repeat more and more times the same calculations in a infinitive series of operations with the real risk to make errors. And if I had changed the input data to increase the number of exercise for practice, how would I have compared the results?
This calculator answered my problems, giving to me the opportunity to take again my old knowledge of BASIC programming. I converted in algorithm the boring operations and in some programs I introduced iterations and conditional controls.
The main difficulty was the little free memory available in it (just 22 kilobytes)... I had to work in economy: reducing comments, input data and number of instructions and using the outlawed GOTO[1].
I carried out and saved in its memory 15 little BASIC programs (3374 free bytes of memory). Here it the list with name, description and memory used:
NAME | DESCIPTION | MEMORY USED [in bytes] |
PEQUI.BAS | Equilibrium slope of a torrent | 2025 |
PIPON.BAS | Gushing back and digging out at the foot of a bridge | 1876 |
SCO.BAS | Reef to protect the bottom and banks of a river | 891 |
VCOLL.BAS | Collector tank flow | 686 |
VASCQUI.BAS | Basin sink with narrowing | 1713 |
VASCI.BAS | Basin sink with a slide | 2192 |
DISS.BAS | Longitudinal desanding | 683 |
DISO.BAS | Longitudinal deoiling | 815 |
SERBA.BAS | Pipeline system for a supply of 3 tanks | 1174 |
DRENA.BAS | Drainage tunnel | 553 |
POZPOT.BAT | Power of a pump in aquifer (confined or not) | 1068 |
PAFFON.BAS | Well self-sinking | 619 |
SFCALI.BAS | Spillway goblet | 869 |
ATTRAV.BAS | Channel crossing | 798 |
INVASO.BAS | Storm sewer with linear reservoir model | 2515 |
Today I take my Sharp calculator with me but I use it for simple operations, because compared to my PC, keyboard is small and uncomfortable and I can't export the results in my relations... So what can I do if I have an hydraulic structures problem?
Simply I compiled my old program for PC using FreeBasic (Wikipedia has a little description) that it is compatible with the old version of BASIC like QuickBasic. I do it for a storm sewer design. I rewrote some part of code to improve the read of input data and above all to save the outgoing calculus and results in a file that I can copy in my relations.
The last version I fixed is not perfect and 100% stable, but it works very well for me and I am going to publish it, whit the source code naturally!
[ 1] goto (GOTO, GO TO or other case combinations, depending on the programming language) is a statement found in many computer programming languages. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control. The jumped-to locations are usually identified using labels, though some languages use line numbers. At the machine code level, a goto is a form of branch or jump statement. In the past there was considerable debate in academia and industry on the merits of the use of goto statements.. Reference: Wikipedia
Add new comment