Calculation of ellipse perimeter (need some help)

Calculation of ellipse perimeter (need some help)

Postby floppy_stuttgart » Fri Jun 25, 2021 6:33 pm

Hello,
I need a bit of support for transfering a function which calculate the ellipse perimeter by entering
a
ENTER
b
ENTER
XEQ "PERIMEL"
.. 85 lines
(no approximation, no long series, except the calculator precision; just pi and X² and + and - and / and SQRTs and..).
I would like to celebrate this function and its first use in a calculator especially an HP41 (not python, etc. the formula is in test phase in comparison with integral)
- program existing in a text form under linux 64 bit
- emu41 installed
- HP41CV or CX inHouse
- HP-IL and "Jeff famous box" by hand
If anybody would have 1h of his time (the week-end please), we could go through the whole process of converting text file into emu41 (running in "wine" window emulator under linux), then transfering into the HP41 and test-use. When I am complete, I will post all data here and my whole experience.
I am able to do it on my own, but it will take hours and hours before my ramp-up curve is behind me. Any kind help is welcome.
Programming is not new for me: only the process of interaction of an HP41 with a PC.
However, if there is any video anywhere or a tutorial how to do this, I welcome the submission of the links and I could do it on my own.
Last edited by floppy_stuttgart on Sun Jun 27, 2021 8:38 am, edited 1 time in total.
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

Re: Calculation of ellipse perimeter (need some help)

Postby jeffcalc » Sat Jun 26, 2021 8:08 am

floppy_stuttgart wrote:Hello,
I need a bit of support for transfering the function "Pascal(D)" which calculate the ellipse perimeter by entering
a
ENTER
b
ENTER
XEQ "PERIMEL"
.. 85 lines
(no approximation, no long series, except the calculator precision; just pi and X² and + and - and / and SQRTs and..).

Quite interesting !

If anybody would have 1h of his time (the week-end please), we could go through the whole process of converting text file into emu41 (running in "wine" window emulator under linux), then transfering into the HP41 and test-use.

Transfering program text files into the 41 is not immediate. The method that comes to my mind is to use the ucc utility (http://www.hp41.org/LibView.cfm?Command=View&ItemID=32) to create a so-called raw file, or a LIF disc image file, then load it into Emu41/V41/HP41.

If you never gone into this path, it may be easier and faster to just key in the 85 lines or so of your code in emu41, V41 or the HP41 - the one you are the most comfortable with - then save it in a virtual disc and share with the other emu41/V41/HP41 platforms for further tests.

J-F
User avatar
jeffcalc
......
......
 
Posts: 27
Joined: Fri Aug 28, 2009 8:57 pm

Re: Calculation of ellipse perimeter (need some help)

Postby floppy_stuttgart » Sat Jun 26, 2021 5:23 pm

Is there any HP41 programming editor (in Geany, Eclipse, ..) for checking the HP41 programming syntax on PC? (I like PyCharm for python. Eclipse for Prolog).
Before I pass the PERIMEL.TXT through the hp41uc.exe I wanted to make a global syntax check via a pre-processor (Plan A).
I found this on excel basis but I am not use to it.. http://www.flaxcottage.com/Calculators/ ... ftware.asp

first try with hp41uc failed and this is not clear to me what I have to do because I could not find a syntax failure catalogue.
Code: Select all
wine hp41uc.exe /t=PERIMEL /r /k
txt[ Z:\home\xxxxxx\Downloads\PERIMEL.TXT ] => raw[ Z:\home\xxxxxx\Downloads\PERIMEL.raw ]
Error: unrecognized or incomplete function[ LBLΓÇ¥PERIMELΓÇ¥ ]
If [ LBLΓÇ¥PERIMELΓÇ¥ ] is an external module function, try: [ XROM mm,ff ]
Compiler error on line 1.
0 bytes written.


I know I know.. I will have to put it with my fingers into the machine if nothing works (Plan B).

the writing of an HP41C pre-processor in prolog is already on the ToDo list. But this task is only 1 of 100 and had not the highest priority (Plan C for coming back to Plan A).
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

Re: Calculation of ellipse perimeter (need some help)

Postby mike-stgt » Mon Jun 28, 2021 2:41 am

floppy_stuttgart wrote:.. 85 lines

How about this? 42 steps, including END.
BTW, I don't grasp, you ask for help but know already beforehand your routine will have 85 lines -- smells funny.
floppy_stuttgart wrote:I wanted to make a global syntax check via a pre-processor
HP41 user code programs don't consist of clauses, basically they are nothing but recorded key strokes. The only global commands are END and alpha labels except for single letter A..J and a..e. They may all be used at will, therefore -- what do you expect as result of such a "global syntax check"?
floppy_stuttgart wrote:Is there any HP41 programming editor (in Geany, Eclipse, ..) for checking the HP41 programming syntax on PC?
Any virtual HP41 running on PC or under DOSBox on PC (or under some other VM on PC) will do as Ideal programming editor. All bad is sorted out, what you can't type is not possible on HP41.
mike-stgt
.........
.........
 
Posts: 179
Joined: Tue Dec 24, 2019 12:12 pm

Re: Calculation of ellipse perimeter (need some help)

Postby floppy_stuttgart » Mon Jun 28, 2021 10:35 am

the previous post is making me rethinking the use of virtual HP41.
Is existing any virtual HP41 where the programs are edited and where we can see all program lines? or at least 20 of them.
The virtual HP41, I was using till now under Linux had only 1 line visible. As an eclipse and pycharm user, its different.
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

Re: Calculation of ellipse perimeter (need some help)

Postby mike-stgt » Mon Jun 28, 2021 5:19 pm

floppy_stuttgart wrote:Is existing any virtual HP41 where the programs are edited and where we can see all program lines? or at least 20 of them.

Yes, no problem -- attach a printer in trace mode. It offers even more than just program listings as you may see here. If you prefer V41 there is a IL2IR bridge simulating a 82162A.
mike-stgt
.........
.........
 
Posts: 179
Joined: Tue Dec 24, 2019 12:12 pm

Re: Calculation of ellipse perimeter (need some help)

Postby floppy_stuttgart » Mon Jun 28, 2021 8:08 pm

good idea. Looks like wine standard installation on my linux 64bits system is having an issue. I will have to solve or find another solution.
Code: Select all
wine HP82240Bv112Setup.exe

Code: Select all
xxxxxx@ProDesk:~/Downloads$ 003a:err:module:import_dll Library MFC42u.DLL (which is needed by L"C:\\Program Files (x86)\\HP-Emulators\\HP82240B\\HP82240B.exe") not found
003a:err:module:attach_dlls Importing dlls for L"C:\\Program Files (x86)\\HP-Emulators\\HP82240B\\HP82240B.exe" failed, status c0000135


Update 1: by putting the error in google, I found out here https://askubuntu.com/questions/169218/ ... tall-mfc42
first by installing winetricks with
Code: Select all
apt-get install winetricks
and using it
Code: Select all
winetricks mfc42
, now the *wine HP82240Bv112Setup.exe* started the window.

Status:
- After starting the HP41 simulator "V41"
- Uploading the Infrared_Printer-Module into V41 (could be seen HowTo in the help file of V41)
- still trying how/where to print into the printer simulator. SEND seems to be the command.
Last edited by floppy_stuttgart on Tue Jun 29, 2021 2:11 pm, edited 1 time in total.
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

Re: Calculation of ellipse perimeter (need some help)

Postby mike-stgt » Tue Jun 29, 2021 1:52 pm

floppy_stuttgart wrote:Status:
- After starting the HP41 simulator "V41"
with a light hand I assume
- Uploading the Infrared_Printer-Module into V41 (could be seen HowTo in the help file of V41)
where in the V41 help file did you find a chapter "HowTo"? Or a statement about IR? Did you read the oo82162A manual I mentioned earlier? That is just the manual, if you surely do need it the program is here. Christoph offers a simpler IL2IR bridge named ILBlinky in here. Coould be enough in case you don't want print graphic and/or bar code.
- still searching in HP82240B windows file where is the icon file (.png?) for starting the printer emulator from my desktop.
You achieved to install and run V41? The process for the printer is similar.
Note: if it's there and you can see it -- it's real,
if it isn't there and you can see it -- it's virtual,
if it's there and you can't see it -- it's transparent,
it's not there and you can not see it -- did you erase it? :mrgreen:
- still trying how/where to print into the printer simulator. SEND seems to be the command.

How did you get to SEND? Pls stop violent guesswork, read enclosed descriptions. Printer commands are described in the printer manual.
mike-stgt
.........
.........
 
Posts: 179
Joined: Tue Dec 24, 2019 12:12 pm

Re: Calculation of ellipse perimeter (need some help)

Postby floppy_stuttgart » Tue Jun 29, 2021 2:57 pm

few issues with the proposal:
- link http://www.hp41.org/html/oo82162A.news.txt dont work
- I could not find the ZIP; now I have it. Thanks.
finally, my linux "wine" environment is not so easy for including all additional libraries and programs: I have to go deeper in the subject and it looks like it will take me hours (preferably I dont move for now into a windows environment).
So far achieved,
- program PEREL1.TXT created in a text editor under linux 64bits
- changed from .TXT to .RAW by using "wine hp41uc.exe /t=PEREL1 /r /k" (hp41uc is well absorbing it; unfortunately there is no extensive code analysis debugger like in pycharm but not so disturbing for now)
- program PEREL1.RAW uploaded into V41 and debugging started
- several programs starting on my desktop; see picture

ToDo for me; further support requested from here:
- connect V41 with video and printer emulation... in a wine environment under linux 64bits for having an output out of V41 which has more than 1 line in an emulated window or in an emulated printer in a windows
- making oo82162A working
- bringing this program into my HP41CV on the table
Attachments
Screenshot from 2021-07-01 16-03-10.png
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

Re: Calculation of ellipse perimeter (need some help)

Postby mike-stgt » Fri Jul 02, 2021 9:40 am

floppy_stuttgart wrote:few issues with the proposal:
- link http://www.hp41.org/html/oo82162A.news.txt dont work
- I could not find the ZIP; now I have it. Thanks.
oo82162A.news.txt is in the ZIP bundle, the link will do when you unzipped it.
ToDo for me; further support requested from here:
- connect V41 with video and printer emulation...
Your screen shot looks promising. Seems you installed the whole flock of devices Christoph offers for Virtual HP-IL. Now you have to decide which of them you want to connect and in which sequence. You have to set the port numbers of the devices and V41 accordingly as described in any of the HTM files that come with the devices. For example, the two devices in the middle of your screen shot, ILPilsim and ILBlinky, doulbe the same port numbers. Which of them is meant when the controller forwards frames to port 60001?

BTW, when I see all those devices I realise, if you need a line printer only, ILPer would be sufficient. Or even the 82163A. Virtual at its max :)
Only one devide in the loop simplifies also the annoying process of setting all those port numbers correctly. Otherwise a tool like VilMA is a lifesaver. Up to now I have only published the description still awaiting an analogical solution from someone else. But it could serve as nice summarization what you have to do manually and without any faults, else it won't work :mrgreen:
mike-stgt
.........
.........
 
Posts: 179
Joined: Tue Dec 24, 2019 12:12 pm

PM: How to start rexx under windows?

Postby mike-stgt » Fri Jul 02, 2021 2:28 pm

Please restrain from sending private mails to me, I will only answer in public.
floppy_stuttgart wrote:could you please inform if your program is starting in a terminal like this:
"c:/pathToTheEXE/rexx.exe oo82162A.rxh"
I am battling in using my linux & wine environment.

1st: did you see the list of prerequisites mentioned in oo82162A.htm? The first item is Windows. In contrast you use a linux & wine environment. Do you know about the differentnesses? What gives you the faith this could work?

2nd: next prerequisite item is Open Object REXX. Did you read the readme.pdf that comes with it? Also paragraph 2.2 Software Requirements? With all the Windows versions mentioned there Wine is missing. AFAIK Wine spells "Wine Is Not an Emulator". Hmm...

3rd: you may install ooREXX under Linux as described in chapter 3 of the a. m. readme.pdf -- alas, to show a nice application window I use ooDialog which is based on Windows GUI. So even most of my program would run, you must rewrite all what makes up the dialog window. Yes, why not, others solve crossword puzzles.

Next: as with many other programs the suffixes of its files gets associated with it at installation time. Same for ooREXX with .rex, .rxh and one more I can't remember. (Choice of suffix is up to you.) So REXX is started automated similar as .txt or .htm/.html too.

One more word: to care for HP41 and even older calculators is pretty nostalgic, similar with ooREXX and Windows. In contrast you use Linux&Wine, ask for webinars, tutorials and other modern rubbish and like to get ready for use "elles vorgekaut in d'Fingr g'schissa" (babelfish.de fails to translate that). I recommend to read along the descriptions and manuals and get it done as exactly as it is written. There are reasons why other options are not mentioned.
mike-stgt
.........
.........
 
Posts: 179
Joined: Tue Dec 24, 2019 12:12 pm

Re: Calculation of ellipse perimeter (need some help)

Postby jeffcalc » Fri Jul 02, 2021 3:32 pm

jeffcalc wrote:
floppy_stuttgart wrote:Hello,
I need a bit of support for transfering the function "Pascal(D)" which calculate the ellipse perimeter by entering
a
ENTER
b
ENTER
XEQ "PERIMEL"
.. 85 lines
(no approximation, no long series, except the calculator precision; just pi and X² and + and - and / and SQRTs and..).

Quite interesting !


I'm still curious to see your code to compute the ellipse perimeter with "no approximation, no long series".

J-F
User avatar
jeffcalc
......
......
 
Posts: 27
Joined: Fri Aug 28, 2009 8:57 pm

Re: Calculation of ellipse perimeter (need some help)

Postby floppy_stuttgart » Sun Jul 04, 2021 5:51 pm

Thanks for the hints.
I have an issue with activating/popping-up the menue for the video setup (82163A emulator).
Code: Select all
To set the above mentioned virtual HP-IL mode parameters call the "TCP/IP Setup..." item in the ILVideo system menu (you get it by Alt+Space Bar or a left mouse click on the symbol in the top left corner or a right mouse click on the title bar). After you finished the setup, press the "Start" button please. If the "Start" button is disabled, the virtual HP-IL interface is already running. So you have to "Stop" and restart the interface for activating the new settings.

dont work in my environment.
Ideally, somebody (so far I understood), would give to me his ILVideo.vil and perhaps I can edit and adapt.
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

Re: PM: How to start rexx under windows?

Postby floppy_stuttgart » Mon Jul 05, 2021 4:54 pm

mike-stgt wrote:One more word: to care for HP41 and even older calculators is pretty nostalgic, similar with ooREXX and Windows. In contrast you use Linux&Wine, ask for webinars, tutorials and other modern rubbish and like to get ready for use "elles vorgekaut in d'Fingr g'schissa" (babelfish.de fails to translate that). I recommend to read along the descriptions and manuals and get it done as exactly as it is written. There are reasons why other options are not mentioned.

Thanks. I will have a look again.
My view is a bit different: I am an "explorer" and the first path I explore is my linux/wine setup and see how supportive it can be for me to use again my hp41. If it fails, I will go into the standard Windows or without PC at all without regret.
Nostalgie (the design of the hp41) in combination with other modern systems (pilbox, linux,..) is exciting and this is my current vision to make it working and show this to family members (a professional vision is to support hydrogen motorisation on the market the next years etc. hp41 will not be there for the control units ;-).
However Mike, I dont want to have more heated exchange here (the german words preferably are not understood by others) and you are free not to answer to my chaotic way of approach (chaotic for now.. it will become better ;-).
Thanks to all your patience with my (too much) posts.
Last edited by floppy_stuttgart on Mon Jul 05, 2021 5:06 pm, edited 1 time in total.
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

Re: Calculation of ellipse perimeter (need some help)

Postby floppy_stuttgart » Mon Jul 05, 2021 5:04 pm

jeffcalc wrote:
jeffcalc wrote:I'm still curious to see your code to compute the ellipse perimeter with "no approximation, no long series".
J-F

Still working on this. Will take several weeks.. or months (the calculating with hp41 is a check because I want to observe precision without having all proof; I am still building the calculating which is representing a non trivial formula).
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

Re: PM: How to start rexx under windows?

Postby mike-stgt » Wed Jul 07, 2021 5:05 am

floppy_stuttgart wrote:Still working on this. Will take several weeks.. or months [...] I am still building the calculating which is representing a non trivial formula.
While Jean-François is curious to see your code I'd prefer to see the formula (now, not in weeks or months) unless it is the MAGM mentioned here and used there.
Last edited by mike-stgt on Fri Jul 09, 2021 11:34 pm, edited 1 time in total.
mike-stgt
.........
.........
 
Posts: 179
Joined: Tue Dec 24, 2019 12:12 pm

Re: Calculation of ellipse perimeter (need some help)

Postby floppy_stuttgart » Thu Jul 08, 2021 7:06 am

Status:
- I am currently following the path "pyilper" under linux; looks promising. a user having it under windows was identified; now I am leaving the other paths since my wine environment was not "self installing"
- still waiting for cables in order to connect the pilbox
- however, in the HP41 emulator, for the topic in title, a single function used (no series) "PEREL2" show (unfortunately) for now a maximum deviation of 0,11% in (1, 0.1) in comparison to page 7 of http://web.tecnico.ulisboa.pt/~mcasquil ... llipse.pdf I have to think how to make it better. Idea in short: an ISO-PERIMETER representative curve of "4*n" pass by the point (0,n) and (n/2*pi,n/2*pi) and has a tangent horizontal at (0,n) and a tangent -1 at (n/2*pi,n/2*pi). This tangent values at these points are a kind of logic and can be proofed using implicit differentiation of the existing series formula at these points. An iso-parameter curve of type conic (hyperbola or parabola or ellipse) passing through these conditions looks promising. PEREL2 hat a validity in the area b<a (whatever you give in X and Y, it will be selected so thats the case for the calculation). The choosen conic curve in PEREL2 was an ellipse tangent to a=0. I have to understand where this deviation is coming from at (1, 0.1): perhaps the calculation precision of the HP41 (dont think so); more likely the ISO-PARAMETER is a variable ellipse depending of (a/b). However, I have good fun starting some simulations with an HP41.
- simulations/calculations can be seen there https://www.desmos.com/calculator/cwumnetkhx?lang=de
- a raw or txt file cannot be uploaded here (just discovered this; can be sent offline). With the HP41 emulator in the menue "Fle" "Get User Code...", choose the .RAW file (created with "wine hp41uc.exe /t=PEREL2 /r /k" under linux 64bits), upload, thats it. a ENTER b XEQ "PEREL2". Result is in X.

mike: I see you posted something. answer not planned so far. I will have a look perhaps later. I am busy with pyilper and other things.

others: no help needed for now. However you can enjoy seiing me battling with weird math subjects, hp41, pilbox, linux, pyilper, cables, Nov64d, printers, RS232..
floppy_stuttgart
.........
.........
 
Posts: 112
Joined: Mon Mar 29, 2021 2:36 pm

Re: Calculation of ellipse perimeter (need some help)

Postby mike-stgt » Sat Jul 17, 2021 12:58 am

floppy_stuttgart wrote:- a raw or txt file cannot be uploaded here

That's a unreliable subterfuge, a flimsy excuse. If you use a virtual HP41 you may print the program to a simulated printer, then copy-paste the print-out with no effort in a 'Code' section here.

BTW, my suggested routine returns 4.063974178 for PEL(1, 0.1)
mike-stgt
.........
.........
 
Posts: 179
Joined: Tue Dec 24, 2019 12:12 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest