Article: 4032 of comp.sys.handhelds Path: jpl-devvax!elroy.jpl.nasa.gov!usc!orion.oac.uci.edu!!nelson From: (Matt Nelson) Subject: Airfoil Plotter for HP48sx Summary: draws airfoils of arbitrary size Date: 29 Oct 90 Reply-To: nelson@psroot.ps.uci.edu Organization: University of California, Irvine This is for all of the R/C model airplane/sailplane enthusiasts out there, especially if you are into designing and building. Here is the latest version of my airfoil section plotter. I needed to plot some ribs for a glider project, and realized that I had sold my trusty HP-28s. I quickly re-wrote my original program to run on the HP-48sx, and came up with something MUCH prettier, and MUCH MUCH faster. This thing is really quite painless to use now (the 28s version was slooooow). The speedup came from creating a PICT that is big enough to contain the entire airfoil section. The airfoil data is plotted only once, and then sent to the printer, one screen at a time, through successive PVIEW and PRLCD commands. BE WARNED... although this is a very fast way to print out large objects, it is also a memory-hungry way to do it; for example, a 10" SD7003 required a PICT that was 131 by 832. When I saved this PICT to the stack and BYTESed it, it was 14,154 bytes big. On top of that, just the data for the SD7003 (as listed below) is 988.5 bytes long. All I am saying is that this program DOES use a lot of memory, but is very handy, and serves my purposes very well; if you don't like it, feel free to use something else. To use this program, simply get into the AIRFOIL directory, and hit [AIRFOI]. It will ask for an airfoil. Just hit the menu button corresponding to the airfoil data you wish to use (you can hit [SD700] to try it out), then [ENTER]. It will then ask for a chord. Give it a number corresponding to the desired chord, in centimeters, then [ENTER]. The program will handle other units, and in fact presents you with the UNITS LENG menu, so you can give it a chord size in any unit you wish. Just be sure to give it a valid unit object (you have to supply the underscore manually, since the calculator is in program entry mode at this point). You should be greeted by a "working..." message. Point the calculator at your 82240A/B printer, and watch the airfoil section print out. The airfoil data is assumed to be in a complex vector, where each element corresponds to a point (x,y) on the airfoil. The points should be arranged so that if you were to draw lines sequentially from one point to the next, you would trace out a closed outline of the airfoil section. The sample airfoil in this posting, the SD7003, should help illustrate this. For those who are interested, the SD7003 is an airfoil designed specifically for use at very low Reynolds numbers, such as those encountered by model sailplanes. There are two parameters which control the absolute size of the printed output. These are the global variables ycmps and xcmps. These represent the number of centimeters per screen OF PRINTED OUTPUT for the y and x directions, respectfully. One arrives at these values by printing a screenfull of anything, and measuring the size of the printed output in centimeters. The numbers supplied below are for the 82240A printer; I have never used a 'B' version of the printer, and don't know whether these numbers will have to be changed in order to work properly with that printer. The only reason I left these numbers as global variables is so that the user could have some control over the aspect ratio of the output, without diving into the program itself. Please direct any comments/suggestions/questions etc. to: Matt Nelson internet: nelson@psroot.ps.uci.edu Physics Dept. bitnet: mnelson@uci University of California phone: (714) 725-2629 Irvine, CA 92717