The Museum of HP Calculators

HP Forum Archive 13

[ Return to Index | Top of Index ]

HP42S Programming question
Message #1 Posted by Harry (Germany) on 29 July 2003, 7:16 p.m.

Hi guys,
if I want 110 complex storage registers, how do I get to those bigger than 99? I mean, I would need to acces them indirectly. But that does not work, as I have only complex registers to stor the adress in. And a complex number is not a valid adress.

Regards,
Harry

      
Some possible solutions...
Message #2 Posted by Vieira, Luiz C. (Brazil) on 29 July 2003, 11:30 p.m.,
in response to message #1 by Harry (Germany)

Hi, Harry;

I thought about some possibilities:

1 - Use a "named" register; I know it will lead to the use of instructions with more than 1- or 2-byte and you probably don't want this;

2 - If it is a temporary indirect addressing, stack registers may also be used;

3 - Store the complex numbers in a complex matrix other than REGS and index it and live REGS as a real-number matrix. REGS will always be used the way you need, and the indexed matrix data will be accessed by RCLEL, STOEL, ->, <-, ^ and v (four arrows). These are all 2-byte instructions as RCL IND nn and STO IND nn are, and as you'd somehow need to set up initial values and control over the index register, you will also need to set up and control indexed matrix pointers.

I used the third option in a program I wrote when I was finishing my Engineering course. I was the first student in the history of the university I was studying at the time to stuff a Load Flow program in a pocket calculator (HP42S). My first and only 10 (A+) in the whole Engineerign course.

I was writing the program firstly to run in an HP41CX, but the HP42S "saved the day". A detail: I had to completely rewrite the program in one week after spending a whole weekend "learning" the new features in the HP42S.

If you ned further information, let us know.

Best regards.

Luiz (Brazil)

Edited: 29 July 2003, 11:34 p.m.

            
Re: Some possible solutions...
Message #3 Posted by Harry (Germany) on 30 July 2003, 10:09 a.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Thanks for the suggestions, Luiz. I will probably use option 3.
What is Load Flow? Is it kind of network analyzing?

Regards,
Harry

                  
Re: Some possible solutions...(edited: wrong info)
Message #4 Posted by Vieira, Luiz C. (Brazil) on 30 July 2003, 2:44 p.m.,
in response to message #3 by Harry (Germany)

Hi, Harry;

I wrote some wrong data in first post that I corrected here.

Load FLow is the term we used (at the time I was a student at the University) to refer to network analysis programs, you're right. It used to be a common term, I'm not sure about today.

It's a somewhat big program with about 500 lines (I wrote more than 400 lines) and uses 1.1 KBytes (I wrote occupies more than 1.5K bytes), listing only. The teacher agreeded with the program since I was able to show her that I was using complex arithmetic and no other internal matrix resource except element handling . And I did it! That's why it's too big: accelerated Newton-Raphson's convergency method in a discrete "fashion" and all data editing, handling and post calculus.

Best regards and success in your programs.

Luiz (Brazil)

Edited: 30 July 2003, 4:53 p.m.

                        
Re: Load Flow
Message #5 Posted by Jeff on 31 July 2003, 7:37 a.m.,
in response to message #4 by Vieira, Luiz C. (Brazil)

Luiz,
     Yes the term "Load Flow" is still the commonly used
term for the programs that calculate voltage and current
in electric power system networks.  I prefer the term
"Power Flow" myself, because the loads are fixed, and
therefore do not "flow".  Power flows to the loads.  Just
another of my many pet peeves...
     I would like to see that program.  Perhaps you could
send it to Dave to post in the software section for the
42S.
                              
Re: Load Flow (edited)
Message #6 Posted by Vieira, Luiz C. (Brazil) on 31 July 2003, 10:21 p.m.,
in response to message #5 by Jeff

Hi, Jeff;

I found the first version only, still typewritten and with some correction notes. And it's not Newton-Raphson's, it's accelerated Gauss method. I need to find another updated listing, with minor corrections. I'll scan the pages, load the program in the HP42S (498 lines... What did I have in mind!), send it to the HP48G+ and upload it to the computer so I can list it and use it in a final document. Then I'll add the necessary comments in English (original is completely written in Portuguese) so you and anyone else can follow it.

It's an academic program, developed in 1989, full of remarks, and it has a complete editor that allows you to build all matrices by answering questions about all power loads, sources and buses. This editor consumes part of the program but I had to include it so the teacher would be able to use it by simply reading the instructions and typing input data. No extra "keywork" needed.

After convergence is accomplished, you can perform load calculus with updated data. It's interesting and somehow fun reading all of this stuff again.

As soon as it's ready I'm posting it, you bet!

Best regards.

Luiz (Brazil)

Edited: 31 July 2003, 11:37 p.m.

                                    
(deleted post)
Message #7 Posted by deleted on 1 Aug 2003, 7:11 a.m.,
in response to message #6 by Vieira, Luiz C. (Brazil)

This Message was deleted. This empty message preserves the threading when a post with followup(s) is deleted.

                                          
Re: Load Flow (edited)
Message #8 Posted by Vieira, Luiz C. (Brazil) on 1 Aug 2003, 9:27 a.m.,
in response to message #7 by deleted

Hi, Jeff;

I did not restrict the size of the YBus matrix. There is a restriction for the Swing Bus as it must be bus # 1, but this restriction exists because the original HP41CX program was like this. Unfortunately I never finished the CX original version, it stops after the YBus is completed. The original HP41CX version uses X-memory to hold all YBus and in this case it holds a 10-element restricted database.

When I wrote and tested the HP42S version, it was able to build a 16 element YBus. I did not try with an HP42S+ (the way I call the 32K upgraded model) as it was not even mentioned at that time, but as I have one this "big" now, I'll load the program and test it.

Thank you for your interest.

Best regards.

Luiz (Brazil)

Edited: 1 Aug 2003, 9:34 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall