Hp-41 structural analysis pac porting to hp49g+



#2

Hello,
  I bought some weeks ago the hp41 structural analysis pac and i am very happy about it.

I was porting the equations used in the manual to my hp49g+  but i am having an issue with a formula. I am asking to other mechanical engineers or mathematicians if they did it with success.
The formula i am referring to has been extracted from Felix Wojiechowski book, properties of plane cross sections, machine design, p. 150, jan 22, 1976.

Given the coordinates of a section i would like to calculate the product of inertia Ixy.

The formula starts like this:

Sum for i=0 to N where N is the number of coordinates for

           1
 ----------- *  [ 1/8*(........)]
   (xi+1 - xi)

It is obvious that if xi+1 and x1 are the same (vertical points) the division leads to infinite.

The hp-41 with the ROM does not stop because of this issue...

Any help is apreciated,

Thanks

Giancarlo


#3

Hi.

Just to make it faster for us to locate, would you please tell which of the structural analysis pac program(s) you are using AND what part of it? I mean, is there any specific example in the manual so we could follow? Chances are that in the case you specify, the HP41 program checks if the values are equal to each other - or if the difference between them is equal to or too close to zero - and then it uses a different approach. Inspecting program line contents might lead to an alternate routine or calculation. So, if we know were to look for at first place it might be faster.

At least I am considering it has been written in user code (FOCAL); if it is in machine code, just a few (a couple of guys, maybe) of us here might be able to track the lines.

Cheers.

Luiz (Brazil)


Edited: 12 May 2012, 3:51 p.m.


#4

Hello Luiz and thank for helping.
The program name is 'SECTION' and the formula crashes in my hp-49g+ with the first example of the manual ( you can find'em in the museum DVD) at page 13.

These are the points to enter:
(0,0)
(0,5)
(3,5)
(3,0)
(0,0)

The formula i mentioned in the post crashes in my hp-49g+ because the first two points share the same distance from the origin (0 on the x axis).

If you do 1/(0-0) you got the error...

The issue is in me (most probably) or in the formula,

Thanks

Giancarlo


#5

Hi, Giancarlo.

I took some time this weekend to delve into the program and I found something interesting. Please, download the progam listing (PDF) and look at the steps with light-blue background in first page. Notice that R05 stores Ixy summation, and R06 is the variable containing (x(i+1)-x(i)). If R06 is NOT zero, the program computes the division and adds the result in X-register to R05; otherwise, zero is added. Please, download the program execution trace listing (PDF) and you'll see the sequence of events. The program itself is about 400 steps long (not that long), but it iterates a lot. I commented the relevant events on first page, up until finding the x(i+1)-x(i) occurrence and in which register was it being held. Then I found the point where it is compared to zero.

I guess this is what should be done in the HP49G version: either you detect the occurrence of a zero prior to compute the whole summation or you discard it. Something like:

(...)
IF (variable name with (x(i+1)-x(i))) DUP 0 =
THEN (partial summation) *
ELSE (partial summation) SWAP /
END
(...) (continues with Ixy summation computing)
Or, even smaller:
(...)
IF (variable name with (x(i+1)-x(i))) DUP 0 !=
THEN (partial summation) SWAP /
END
(...) (continues with Ixy summation computing)
Chances are it will work fine, now.

Let us know how it goes.

Success!

Luiz (Brazil)


Edited: 14 May 2012, 5:44 a.m.


#6

"Notice that R05 stores Ixy summation, and R06 is the variable containing (x(i+1)-x(i)). If R06 is NOT zero, the program computes the division and adds the result in X-register to R05; otherwise, zero is added."

Hi

The blue sequence could be :

 R06 DUP { / } { NIP } IFTE
'R05' STO+

The 'real' translation is

 R06 DUP { / } IFT
'R05' STO+

But i fear this could leave unnecessary data on the stack (49 has an unlimited stack...).

Edited: 14 May 2012, 3:34 p.m.


#7

Hello Luiz and Gilles,
thank you so much for debugging my issue. i am not very familiar with the hp-41 even if i like it a lot.

Without your help it wouldn't have been possible for me find the solution. May i ask you how you 'downloaded' the data from the ROM?

I like porting programs a lot and such feature would be very useful.

The original formula for calculating the product of inertia Ixy doesn't mention such particular behaviour. I will print and dig into the program so i can familiarize with the flow of the hp-41 programs.
Using formulas like indicated in the hp-41 module manuals have some risks like this one.

You won a pizza in Italy if one day you decide to come in Italy,

thanks

Giancarlo


#8

My mother is native from Italia near Bologna
So perhaps ;)

#9

Hi, Gilles. Thanks for your remarks.

Quote:
But i fear this could leave unnecessary data on the stack (49 has an unlimited stack...).
In this case, you bet this is a big problem because the original HP41 program actually leaves some 'trash' in the stack once division is performed or not. That's why I took if...then...end complete structure into account instead of the shorter IFT (IfThen), valuable tool in many cases. Considering the original program structure, stack manipulations are limited to the X and Y contents in that particular passage, i.e., Z and T contents are neglected. In other parts of the program, Z-contents are used. In any case, not taking care of what is left in the stack when converting programs with controlled loops will surely leave a lot of trash.

Inspecting a trace listing is as important as a program list, some facts may not 'pop out' of the program list as they do in the trace list. This is what I use to generate the trace list:

I know it could be done by other means, but in this case I keep my HP48G in use, running inprt.gx with rechargeable batteries - as it is the HP41.

(now for the question) One fact: running programs stored in ROM modules while TRACE is active does not generate a complete sequence of events - detailed trace as shown -, instead acts as NORM mode. I had to COPY the program to RAM memory and rearrange XROM calls so the detailed trace list came out. I tried with the HP82143A and had the same behavior. Have not found yet any info about this.

Anyone, please?

Cheers.

Luiz (Brazil)

Edited: 14 May 2012, 4:17 p.m.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP-41(CL): The easiest way to transfer FOCAL programs from a Linux PC to the HP-41 Geir Isene 13 1,314 12-05-2013, 02:40 AM
Last Post: Hans Brueggemann
  HP67/97 M.E. Pac cover Ignacio Sánchez 2 379 11-22-2013, 04:04 AM
Last Post: Ignacio Sánchez Reig
  request M.E. pac for HP-67/97 wallet cover scan Ignacio Sánchez 0 283 11-06-2013, 09:36 AM
Last Post: Ignacio Sánchez Reig
  HP-67/97 Mechanical engineering PAC cover Ignacio Sánchez 0 261 10-30-2013, 04:35 AM
Last Post: Ignacio Sánchez Reig
  Entering,Saving,and Analysis /Fitting X Y Data on the Prime Harold A Climer 6 666 10-26-2013, 01:54 PM
Last Post: Tim Wessman
  Interesting Base Conversions - Porting a 1975 HP 25 Program to the HP 35S Eddie W. Shore 1 332 10-13-2013, 07:49 PM
Last Post: BruceH
  HP41 Navigation Pac Perpetual Alminac Dan Pfeiffer 2 377 09-03-2013, 07:39 PM
Last Post: Dan Pfeiffer
  HP85 Waveform Analysis inaki 1 279 04-23-2013, 01:20 PM
Last Post: Paul Berger (Canada)
  For sale: HP 25C and Stat Pac 2 for HP 65 Michae Altmann 1 316 04-21-2013, 01:24 PM
Last Post: Raymond Del Tondo
  HP 41CX Survey Pac Keith Burr 7 685 03-29-2013, 10:09 AM
Last Post: Keith Burr

Forum Jump: