
Sectn v1.1

November '98


Overview:
=========

This program was inspired by the program AREA (on GD #9 \Math) by 
Dewayne Cushman, which calculated the area of an irregular polygon. I 
have often needed to calculate additional section properties for such 
shapes, and until now had to resort to a PC package. 

For an irregular polygon, the program takes a matrix from the stack 
(see "Usage" for details) and calculates the centroid location, area, 
second moments of area, radii of gyration, principal moments of area 
and angle to the principal axis. A graphical representation of the 
section is provided along with the numerical output to enable a visual 
check of the input.

I hope you find Sectn useful.


DISCLAIMER:
===========

The program is written entirely in User RPL, so it should not pose any 
threat to memory contents. It has been tested on HP48G ROM revisions P 
and R without any trouble. As always, use at your own risk. No 
responsibility is accepted for any loss of memory, or failure of the 
program to fulfill the intended function.


Installation:
=============

Simply transfer the User RPL object to your HP48 as Sectn (or any 
other name). As some G-specific list processing commands are used, I 
do not believe that the program will run on the SX series without 
modifications. Sorry.

Bytes: 2743.5 (for the program on the stack)
Chksum: # F9E4h

Compressed using BZM, the program uses about 1140 bytes.


Usage:
======

Using the matrix writer, enter the coordinates of each vertex of the 
polgon with respect to an arbitrary origin and moving in a _clockwise_ 
direction. (X-coordinates in the first column, y-coordinates in the 
second.) Repeat the first point as the last point, to close the 
section. Put the matrix on the stack, and execute the program.

The following will be displayed in the small font, along with a 
graphical representation ofthe section (in correct proportion as far 
as possible):

IXC:    The moment of inertia about the x-axis through the centroid.
IYC:    The moment of inertia about the y-axis through the centroid.
IMAX:   The moment of inertia about the principal axis through the centroid.
IMIN:   The moment of inertia about the second principal axis.
ALPHA:  The angle between the principal axis and the x-axis.
RX:     Radius of gyration about the x-axis through the centroid.
RY:     Radius of gyration about the y-axis through the centroid.
AREA:   The area of the section.
XC:     The x-offset from the origin to the centroid.
YC:     The y-offset from the origin to the centroid.

Press CANCEL to clear the small font display and the return to the 
stack. The above values are left on the stack, each tagged with their 
name.

Execution time is about 10 seconds for shapes with ten vertices, so 
don't panic if the stack appears to freeze!

Tip: Closed sections may be entered by "cutting" a wall and proceeding 
around the perimeter as for any other polygon. This will lead "inside" 
the section at the cut, around the interior and out again at the cut. 
(There will then be two pairs of vertices with the same coordinates.)

WARNING: The program stores the input matrix in the statistics matrix 
(\GSDAT), and will overwrite any previous contents.


Known problems and limitations:
===============================

* G-series only


Revision History
================

v1.1  Code for property calculations reduced in size. Graphical output 
added.
v1.01 IFERR added to handle case where Tan(alpha)=0/0
v1.0  First release


Background:
===========

To calulate the section properties, the program considers sequentially 
the trapeziums bounded by a side of the polygon, a vertical axis at 
the left of the section, and horizontal axes at the top and bottom of 
the side under consideration. Ix, Iy, Ixy, A etc are calculated for 
the triangle and rectangle composing each trapezium.  These values are 
positive or negative depending on the direction of the side of the 
polygon, with the sums representing a numerical integral for the 
section.

Results have been cross checked against published section properties 
for various structural sections, and textbook formulas for a lot of 
different shapes. I am not aware of any situations where this approach 
would fail.

The display routine at the end of the prgram started out as an extract 
of the STKV program from the HP48 Handbook, by James Donnelly, which 
is a great reference when programming the HP48.


Feedback:
=========

For more info (not that there is much more to be said), bug reports, 
feedback etc, email me: jeff@lemcke.bu.aust.com.

Regards,

Jeff Roulston
