+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: program SECTION ver 2.0 (/thread-687.html)
program SECTION ver 2.0 - churichuro - 02-16-201403:53 AM
Hello a leave this simple program for calc some geometric properties
for figures made from rectangles, like W section or so.
1) first you create a Matrix
with 2 columns
col 1 is rectangle width
col 2 is de rectangle depth
for example : in Matrix M1
"I" section with
top Flange 20cm wide and 1.3cm thick
Web 0.6cm thick and 37.40 cm high
bottom Flange 20cm wide and 1.3cm thickness
(you can use more rectangles for you figure, no only 3)
2) call the program named SECTION
(the program return a list with result too. )
3) you can se some like this graphic results
4) press ENTER key and numeric result is return in a list
Code:
EXPORT SECTION(mat)
BEGIN
Local t,d,h,y0,a,ix1,iy1,iy;
Local ssy,ry,yy1,ix,ssx,rx;
Local d1,y,i,n,at,ftor,mx1;
Local mx2,my1,my2, res;
FOR i FROM 1 TO n DO
h[i+1]:= h[i]+d[i];
IF t[i]≠0 THEN
my1:=iPart(210-ftor*h[i]+0.5);
my2:=iPart(210-ftor*(h[i]+d[i])+0.5);
mx1:=iPart(240-ftor*(t[i]/2)+.5);
mx2:=iPart(mx1+ftor*t[i]+.5);
TEXTOUT_P("*** SECTION V1.2 ***",5,5,0,#0000FF);
TEXTOUT_P("by Rafael H. Padilla V.",5,21,0,#0000FF);
TEXTOUT_P("dysup@hotmail.com",5,35,0,#0000FF);
TEXTOUT_P("*** RESULTS ***",5,55,0,#0000FF);
FOR i FROM 1 TO 9 DO
TEXTOUT_P(res(i),10,58+i*16);
END;
my1:=iPart(210-y*ftor+0.5);
FOR i FROM 1 TO 11 DO
mx1:= iPart((i-1)*10+190);
mx2:= mx1+6;
LINE_P(mx1,my1,mx2,my1,#00FF00);
END;
Thank you. As a mechanical engineer I will make good use of it!
François
RE: program SECTION ver 2.0 - akmon - 05-14-201501:13 PM
With new firmware version (7820), the picture of section appears for half a second and it comes back to main screen showing "Invalid input".
Update. I´ve erased some part of the code, at the end for not flickering "Press Enter". It does not flick, but the figure and results remain until you press a key.
Code:
EXPORT SECTION(mat)
BEGIN
Local t,d,h,y0,a,ix1,iy1,iy;
Local ssy,ry,yy1,ix,ssx,rx;
Local d1,y,i,n,at,ftor,mx1;
Local mx2,my1,my2, res;
FOR i FROM 1 TO n DO
h[i+1]:= h[i]+d[i];
IF t[i]≠0 THEN
my1:=iPart(210-ftor*h[i]+0.5);
my2:=iPart(210-ftor*(h[i]+d[i])+0.5);
mx1:=iPart(240-ftor*(t[i]/2)+.5);
mx2:=iPart(mx1+ftor*t[i]+.5);
TEXTOUT_P("*** SECTION V1.2 ***",5,5,0,#0000FF);
TEXTOUT_P("by Rafael H. Padilla V.",5,21,0,#0000FF);
TEXTOUT_P("dysup@hotmail.com",5,35,0,#0000FF);
TEXTOUT_P("*** RESULTS ***",5,55,0,#0000FF);
FOR i FROM 1 TO 9 DO
TEXTOUT_P(res(i),10,58+i*16);
END;
my1:=iPart(210-y*ftor+0.5);
FOR i FROM 1 TO 11 DO
mx1:= iPart((i-1)*10+190);
mx2:= mx1+6;
LINE_P(mx1,my1,mx2,my1,#00FF00);
END;
TEXTOUT_P("NA",170,my1-5);
REPEAT
TEXTOUT_P("PRESS <<ENTER>> KEY",90,222,0,#FF0000);
WAIT(.35);
UNTIL GETKEY ≠ −1;
return(res);
END;
RE: program SECTION ver 2.0 - zmp - 08-04-201506:18 PM
My spreadsheet based on your program to compare inertia and sectional properties.
I hope it can help.
If you find any issue please keep me inform... It is beta... trying to implement other shapes: c not symmetrical...