All attempts failed. It’s time to read the manual!

I have started to write some programs for my Elektronika MK-52 calculators (I have 2 of them). Actually, I don’t need them so much but I have decided to use this calculator for my common tasks. I have a few HP calculators (the HP 48 line) but the Soviet thing is simpler and thus easier to use. And it is powerfull enough for my needs (15 easily accessible memories is much more than I actually need). So I also decided to write of some simple programs for the most repeating problems.

There are some articles around the Internet, also the Wikipedia has some informations (surprisingly the English page is more usefull than the Russian one) but I stil have had problems to understand what I have to do in some situations. There is even a “compiler” which is a nice tool for translating of a RPN programs to a sequence of calculator commands. An emulator is available, too.

Elektronika M-52 on my desk

The MK-52 also has a non-volatile memory and I now trying to use it. The non-volatile memory use requires the knowledge of program address (something like “1000007” in my case). Also the clean/read/write operations require the same sequence of commands (just to press the “read address” key and then the “I/O” key) but the type of operation is determined by hardware switch. I often have forgotten about this switch (to change from “write” to “read”, for example) so I have had to retype my program several times…

There is one tricky thing with use of the memory addresses (in tge form 1AAAASS): the initial address (AAAA) must be given in actual memory units but number of steps (SS) must be given in steps (1 step = 2 memory units). Also the number of steps must be a multiplication of 7. And there must be some space between memory blocks (at least 2 units). So if the first program is located at the beginning of the memory and it has 7 steps then its address is 1000007. If the second program has 21 steps then the best address should be 2001621 (16=2*7+2). The first number of the address (2 in this case) can be arbitrary.

There are some other strange things: the display can show only numbers. The operations are shown only their two-number codes and one must remeber them in order to be able to debug programs. The display blinks during computations – like things in old sci-fi movies.

All attempts failed. It’s time to read the manual!

Casio FX-700P programming

I decided to make something usefull for my FX-700P. So I wrote a program that gives internal forces from a beam and computes necessary cross-section (for steel beams and the IPE-type cross sections only). The program uses several simplifications, it takes into account only a bending moments so it is for a preliminary design only. I actually needed it for some work in the wild when no real computer with me and when a fast (and thus just a preliminary) decision is needed.

So the program takes internal forces (bending moment, shear force and normal force) and uses basic computations (normal stress from M/W+N/A and a shear stress computation) to decide what IPE size is enough.
The IPE cross section parameters are approximated by continuous functions to save the memory of the calculator.

The code for the FX-700P looks like this:

10  INPUT "M=",M
20  INPUT "V=",V
30  INPUT "N=",N
40  D = 235000000 * 0.9
100 J = 0 TO 12 STEP 1  
110 H = 80 + J*20 
120 A = H*H*0.000338738+H*0.0836899 -1.60321 
130 I = H*H*H*0.000475247 -0.0512346*H*H + 212.463 
140 B = 0.0148498*H + 2.62096
150 F = 0.0249428*H + 3.39449
160 E = 0.465021*H + 8.23748 
170 S = (F*B*H/2)/1000000+((H/2.0-B/2.0)*F)/1000000
180 H = H/1000
190 A = A/10000
200 I = I/100000000
210 W = I/(0.5*h) 
300 IF ABS(N/A - M/W) > D THEN 400
310 IF ABS(N/A + M/W) > D THEN 400
320 IF ABS(V*S / I*B) > D THEN 400
330 GOTO 410 
400 NEXT J
410 PRINT "IPE";H*1000

For a comparison there is a C code that does exactly the same:

int assess_IPE(double M, double V, double N)
  int i ;
  double h, A, I, W, S, Sh,f,e,a, fy;
  double sigma_top, sigma_bot, tau_top, tau_max ;
  fy = 235e6 * 0.9 ; /* design value of yield stress */
  for (i=0; i 240)&&(h = 300) h = 330 ; /* fix fo real h sizes */

    /* approximations: */
    A = h*h*0.000338738  + h*0.0836899 -1.60321 ;
    I = h*h*h*0.000475247 -0.0512346*h*h + 212.463 ;
    a = 0.0148498*h + 2.62096;  /* wall thickness */
    f = 0.0249428*h + 3.39449 ; /* thicknes of top part  */
    e = 0.465021*h + 8.23748  ; /* width of the top part */

    S = ((h/2.0-a/2.0)*f)/1e6 ; /* static moment S: UNUSED ATM */
    Sh = S + (pow(h/2-a,2)/2.0*a)/1e6 ; /* static moment for center (h/2) */
    h = h/1e3 ; /* mm  -> m  */
    A = A/1e4 ; /* cm2 -> m2 */ 
    I = I/1e8 ; /* cm4 -> m4 */
    W = I/(0.5*h) ;
    /* Stresses: */
    sigma_top = N/A - M/W ;
    sigma_bot = N/A + M/W ;
    tau_max   = V*Sh / I*a ;

    if ((fabs(sigma_top)<fy)&&(fabs(sigma_bot)<fy)&&(fabs(tau_max)<fy/sqrt(3)))
      fprintf(stdout,"Found IPE%i\n",(int)(h*1000));

Both codes are under the GPL v2. But once more: please do not use these codes for any real work! I don’t tested their correctness too much and they use some big simplifications.

Just for those who are curious about it: the BASIC code also works on the Elektronika MK-85.

Casio FX-700P programming

Elektronika MK-85: pocket-sized PDP-11

I had an opportunity to compare the Casio FX-700P with its soviet clone, the Elektronika MK-85. They have very similar look (actually the MK-85 was designed to have the same user and program interface as the FX-700P had). But the internals are very different: the FX-700P is a calculator but the MK-85 is a 16bit computer compatible with the PDP-11.

Casio FX-700P vs Elektronika MK-85

It means that the MK-85 is a bit heavier and it has bigger power consumption (it uses 4 battery cells instead to 2 in the Casio machine). The Soviet one don’t have so good display cover and it’s keys look worse but the Soviet keyboard feels better (but it is my personal opinion). It is also slower in the normal mode (it has also a “turbo” mode but I didn’t have an opportunity to try it). Good info about diferences in programming of these machines can be found here.

Unfortunately, the MK-85 has a memory only comparable with the FX-700P (about 2 KB) so it is not possible to run anything but the integrated BASIC here (no UNIX or other operating systems). But at least some assembly programming is possible.

Elektronika MK-85: pocket-sized PDP-11