MUMPS Rocketry Utilities

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

John Kemker

Well-Known Member
TRF Supporter
Joined
Aug 25, 2019
Messages
6,167
Reaction score
4,353
Okay, so I'm a MUMPS geek. Been programming in it since 1983. Recently was looking into putting together a motor test stand and needed to convert between grams of force and Newtons. Got tired of having to constantly type "xxxx / 101.97" in my calculator, so I wrote a quick and dirty routine in MUMPS to do it for me. Then I wanted to figure out what class of motor I could use on that test stand, so I wrote another routine to return the letter code for the motor based upon the Newtons. I'll probably add more functions as I go along, but I thought I'd share the code with the TRF community. Free to use and modify, just tell folks where you got it from. I'd appreciate any new code added being sent to me to include in my library. I use Reference Standard M (RSM) on my Linux box. You can run it under Linux, Windows (using Cygwin), MacOS and other UNIX and UNIX-like operating systems. Find RSM here.

Code:
ROCKET    ;;Utilities for Rocketry;JK3;26Jan2024
          ;;
          write !,"Not an entry-point!",!
          quit
          ;
G2N(gms)  ;;Grams to Newtons
          new newtons
          set newtons=gms/101.97
          quit newtons
          ;
N2A(n)  ;;Newtons to Alphabetic Code
          new code
          set code=$select(n'>0.3125:"1/8A",n'>0.625:"1/4A",n'>1.25:"1/2A",n'>2.5:"A",n'>5:"B",n'>10:"C",n'>20:"D",n'>40:"E",n'>80:"F",n'>160:"G",n'>320:"H",n'>640:"I",n'>1280:"J",n'>2560:"K",n'>5120:"L",n'>10240:"M",n'>20480:"N",n'>40960:"O",1:">0")
          quit code
          ;

To call G2N:
Code:
ROU> write $$G2N^ROCKET(100000)
9806.80592331077767971
ROU> write $$N2A^ROCKET($$G2N^ROCKET(1000000))
M
ROU>

It's not quite as easy to use as my APL workspace to get Newtons from grams, but I haven't figured out how to write a SELECT or CASE in APL
Code:
      ▿newtons[⎕]▿
    ▿c←newtons grams
[1]   c←grams+101.97
    ▿

(can't get the APL division sign to display on here)
 
On what do you run APL these days? I used it some in college (1974-1978) and found it a fascinating tool (and still have the book APL: An Interactive Approach) but I've not actually written any APL functions since then.

In college it ran on the campus mainframe, which was an IBM 360, and later an Amdahl.
 
Last edited:
On what do you run APL these days? I used it some in college (1974-1978) and found it a fascinating tool (and still have the book APL: An Interactive Approach but I've not actually written any APL functions since then.

In college it ran on the campus mainframe, which was an IBM 360, and later an Amdahl.
mvt4apl, which is an emulated 360 that runs on Linux, Windows, etc.
https://hercules-390.yahoogroups.na...-mvt-21-8f-mvt-for-apl-version-2-00-availablehttp://wotho.ethz.ch/mvt4apl-2.00.zip
I run mine on Linux (natch). I have a set of APL keycaps coming for a spare keyboard I have.

If you aren't using that copy of APL: An Interactive Approach, mind loaning it to me? (I wouldn't ask to keep it forever or buy it, as they are very valuable these days!)

I think there's an APL interpreter for Linux, as well, but I'm not entirely sure.
 
I used APL on an IBM 5100, around 1976? Was a little bit interesting. We couldn't remember what the Greek letters meant. Modern functional languages are so much more readable.

Mathematic notation has never got much traction in programming. Leslie Lamport offered Temporal Logic of Actions (TLA), automatic reasoning about sequential programs - in other words, proving correct multiprocessing - but with its mathematical notation, no one used it. Coq, a theorem prover, impenetrable. Haskell, probably the ultimate functional language, notation impenetrable.
 
If you aren't using that copy of APL: An Interactive Approach, mind loaning it to me? (I wouldn't ask to keep it forever or buy it, as they are very valuable these days!)
Let me think about that a bit.

Drop me a private message in a few days to remind me. I'm not home right at the moment.
 
Still having a problem with the APL equivalent of a case or select statement. MUMPS is easy, as $SELECT() is an intrinsic function. Python uses a series of if/elif blocks (already written both in Python, code below) and, of course, C has the switch() statement. I found reference in a Dyalog document to :Select/:Case in Dyalog's APL interpreter, but when I try to use it, I keep getting syntax errors, whether I'm running it under GNU-APL, Dyalog, or APL/360. Maybe I'm not thinking in the APL Way. /smh

Code:
def newtons(grams):
    n=grams/101.97
    return n

def motorcode(newtons):
    if newtons <= 0.3125:
        return '1/8A'
    elif newtons <= 0.625:
        return '1/4A'
    elif newtons <= 1.25:
        return '1/2A'
    elif newtons <= 2.5:
        return 'A'
    elif newtons <= 5:
        return 'B'
    elif newtons <= 10:
        return 'C'
    elif newtons <= 20:
        return 'D'
    elif newtons <= 40:
        return 'E'
    elif newtons <= 80:
        return 'F'
    elif newtons <= 160:
        return 'G'
    elif newtons <= 320:
        return 'H'
    elif newtons <= 640:
        return 'I'
    elif newtons <= 1280:
        return 'J'
    elif newtons <= 2560:
        return 'K'
    elif newtons <= 5120:
        return 'L'
    elif newtons <= 10240:
        return 'M'
    elif newtons <= 20480:
        return 'N'
    elif newtons <= 40960:
        return 'O'
    else:
        return '>O'
 
I remember APL from 45+ years ago.
Try this...

code ← '1/8A' '1/4A' '1/2A' 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O'
newtons ← 10220
index ← ⌈2⍟(newtons÷0.3125)
return ← code[index+1]
return
M
⌈ is ceiling or round up
⍟ is overstrike of O and * for the log function.
 
Okay, so I'm a MUMPS geek. Been programming in it since 1983. Recently was looking into putting together a motor test stand and needed to convert between grams of force and Newtons. Got tired of having to constantly type "xxxx / 101.97" in my calculator, so I wrote a quick and dirty routine in MUMPS to do it for me. Then I wanted to figure out what class of motor I could use on that test stand, so I wrote another routine to return the letter code for the motor based upon the Newtons. I'll probably add more functions as I go along, but I thought I'd share the code with the TRF community. Free to use and modify, just tell folks where you got it from. I'd appreciate any new code added being sent to me to include in my library. I use Reference Standard M (RSM) on my Linux box. You can run it under Linux, Windows (using Cygwin), MacOS and other UNIX and UNIX-like operating systems. Find RSM here.

Code:
ROCKET    ;;Utilities for Rocketry;JK3;26Jan2024
          ;;
          write !,"Not an entry-point!",!
          quit
          ;
G2N(gms)  ;;Grams to Newtons
          new newtons
          set newtons=gms/101.97
          quit newtons
          ;
N2A(n)  ;;Newtons to Alphabetic Code
          new code
          set code=$select(n'>0.3125:"1/8A",n'>0.625:"1/4A",n'>1.25:"1/2A",n'>2.5:"A",n'>5:"B",n'>10:"C",n'>20:"D",n'>40:"E",n'>80:"F",n'>160:"G",n'>320:"H",n'>640:"I",n'>1280:"J",n'>2560:"K",n'>5120:"L",n'>10240:"M",n'>20480:"N",n'>40960:"O",1:">0")
          quit code
          ;

To call G2N:
Code:
ROU> write $$G2N^ROCKET(100000)
9806.80592331077767971
ROU> write $$N2A^ROCKET($$G2N^ROCKET(1000000))
M
ROU>

It's not quite as easy to use as my APL workspace to get Newtons from grams, but I haven't figured out how to write a SELECT or CASE in APL
Code:
      ▿newtons[⎕]▿
    ▿c←newtons grams
[1]   c←grams+101.97
    ▿

(can't get the APL division sign to display on here)
Wow, MUMPS! I haven’t thought of that in years. And important professor of mine Dr. Richard Walters (UC Davis), was involved in the standardization of months in the mid 70s. And then later I workED for DEC, but I admit to only playing a little bit with MUMPS, and even less with APL. Still, the memories…
 
Wow, MUMPS! I haven’t thought of that in years. And important professor of mine Dr. Richard Walters (UC Davis), was involved in the standardization of months in the mid 70s. And then later I workED for DEC, but I admit to only playing a little bit with MUMPS, and even less with APL. Still, the memories…
Dick Walters! I remember that name!

I learned MUMPS from Tom Ackerman (went to high-school with one of his daughters and freshman year of college with his son) and worked with Ed McIntosh and Butch Kolner, all three of them MDC members back in the day.
 
There’s a ripple in the programming Force here. 😉

I learned APL on an IBM teletype with no monitor. One of the assignments was to find all of the vectors between aircraft given a matrix of polar coordinates from the airport. I wrote it in one line of APL. Parse-able but unreadable by mere mortals! I did a lot of work later on in MATLAB, which is matrix oriented like APL without the overstrike operators.
 
There’s a ripple in the programming Force here. 😉

I learned APL on an IBM teletype with no monitor. One of the assignments was to find all of the vectors between aircraft given a matrix of polar coordinates from the airport. I wrote it in one line of APL. Parse-able but unreadable by mere mortals! I did a lot of work later on in MATLAB, which is matrix oriented like APL without the overstrike operators.
APL is a Write-Only language. [grin]
 
On what do you run APL these days? I used it some in college (1974-1978) and found it a fascinating tool (and still have the book APL: An Interactive Approach) but I've not actually written any APL functions since then.

In college it ran on the campus mainframe, which was an IBM 360, and later an Amdahl.
Why, dear friend, would you want to torture yourself by writing any APL?
Dick Walters! I remember that name!

I learned MUMPS from Tom Ackerman (went to high-school with one of his daughters and freshman year of college with his son) and worked with Ed McIntosh and Butch Kolner, all three of them MDC members back in the day.
Dick Walters was very instrumental in my career. A wonderful teacher and very well connected. We visited Xerox Park and met Alan Kay approx. 1976. Of course I was blown away by Smalltalk and the Alto.
APL is a Write-Only language. [grin]
Yes!
 
True story:

Back in the early 80s, while I was still in high school in DeKalb County, GA, I had found a copy of APL - An Interactive Approach at the school library. I was fascinated with learning how to program in all sorts of languages, so I wanted to try APL. Only problem was, the only place with a terminal that could do APL that I could find, was the Griffin House at Fernbank Science Center. It was DeKalb County's computer lab. So, I talked my Mom into taking me to the Griffin House one weekend. Sat down and entered a program in that I had worked out on paper. Got up to go get a drink of water and looked at the code I had just written. It was complete gibberish to me. It ran. It did what I had intended, but that's about all I could say for it. Looking at the code, I couldn't tell you what it did.

Write-Only
 
True story:

Back in the early 80s, while I was still in high school in DeKalb County, GA, I had found a copy of APL - An Interactive Approach at the school library. I was fascinated with learning how to program in all sorts of languages, so I wanted to try APL. Only problem was, the only place with a terminal that could do APL that I could find, was the Griffin House at Fernbank Science Center. It was DeKalb County's computer lab. So, I talked my Mom into taking me to the Griffin House one weekend. Sat down and entered a program in that I had worked out on paper. Got up to go get a drink of water and looked at the code I had just written. It was complete gibberish to me. It ran. It did what I had intended, but that's about all I could say for it. Looking at the code, I couldn't tell you what it did.

Write-Only
Somewhere I have a bunch of old print-outs (on green/white lined wide-format perf feed paper, of course). Now you've got me wondering if there are any APL snippets in there. Probably in a box only my kids will find someday. They'll hold the printout like a sacred scroll! Seek out experts in hieroglyphics for its true meaning. Frame it and donate it to a museum. Millions of people will pay for the rare opportunity to stare at the ancient code with profound wonder!

<poof!> Nah, they'll just put in a dumpster with the rest of my crap.
 
Last edited:
Back
Top