How to work Hp50g programs on computer?



#32

Hi,
Is there any way to work Hp50g programs on computer?(By means of a simulator or any other things)

I need this for my numerical analysis homework. Thanks.


#33

Install debug4x. You're welcome.

TW

#34

If you are running Linux or OS/X then try x49gp (http://x49gp.svn.sourceforge.net/viewvc/x49gp/README.QUICKSTART). debug4x also works with Wine on both OS/X and Linux.


#35

I want to try Calcolo Numerico 1.2

But couldn't undersand how to use debugger. Can you elaborate on this matter? Thanks.


#36

Here's my question

f(x)= 1 +5x - cos(0.3x^1/2)^-1

Find it's root between 2.5 and 3.5 by bisection and regula falsi methods.

Actually I would appreciate any tool to do this.

Thanks.


Edited: 24 Nov 2009, 4:42 p.m.


#37

Now, you're not trying to get us to do your homework for you, are you?

It doesn't matter, I guess, since the problem as given has no solution. The first root is at x=0 and the next one isn't until x=27.161003... (when 0.3*sqrt(x) is close to pi/2).


#38

Quote:
Now, you're not trying to get us to do your homework for you, are you?

It doesn't matter, I guess, since the problem as given has no solution. The first root is at x=0 and the next one isn't until x=27.161003... (when 0.3*sqrt(x) is close to pi/2).


Hi,

I didnt say I wanted a solution for my hw. I just wanted to be more precise about what I'm asking. (I also think there is a mistake in the question but that's not the issue..)

I want to learn how to solve such an equation with debugxx or any other program that is available on pc. (better be hp 50g since I will start using it in a week!)

Thanks.


#39

There are a lot of ways to solve problems like that with the HP50g.

One document to help with that is here.

For the problem you gave, you might need to divide the given function by x to prevent a solver from simply finding the x=0 root.

I found the x=27.161... root by graphing. Using common sense, I knew the zero had to be close to (pi/(2*.3))^2=27.4. For most values of x, the function you gave is close to 5x, but when cos(...) is near zero, 1/cos(...) can take on any value, so that's when there will be a root. I set the window x range from 0 to 30 (25 to 30 gives a zoomed in view) and the y range from -5 to 150 (again based on y~5x). You move the cursor near to the zero you want, hit FCN, then ROOT.

If your class requires you to use specific methods (like method of false position) then I assume they might want you to write a program yourself.


#40

Well, it turns out I had time today to write a quick HP50g bisection program. Of course, you can do this easily on this calculator.

This is the program.

I saved it as BI.

It assumes a function saved to variable F has been defined. Let's assume we want to find the square root of 2 with the function x^2-2. You enter it on the stack like so.

Then hit DEF (left shift on the 2 button)

Then you need to have the root bracketed. Put the limits on levels 1 and 2 of the stack. It doesn't matter which is which. 1 and 2 bracket the root in this case.

With the variable menu open (press the VAR key), every time you press the BI softkey, a bisection is performed. If you press it repeatedly, it (slowly) converges.

Of course, you could also write a program to iterate automatically.

Programming a method of false position solver could be an exercise for you.


By the way, while the HP50g is a great calculator, it has a learning curve. The sooner you start to use it, the better. Going through the manual can help, of course, but a fun way to gain experience with it is to do challenges posted to the board, like the recent University calculator challenge, or Valentin's challenges.


#41

Thank you for your contribution and great animated GIFs.

It seems to me too that no debugger or compilater is required for this roots seeking problem.

With great interest, I was comparing your bisection program BI with one of my own HP28’S’ program library. I found a very close looking program there.

I still have two questions about your code; why are you storing the mean value in 'N’ , is there any purpose anywhere for further use?

Why not arranging the use of local variables A B and N in a more comprehensive way without using any STO command such as :

« -> A B 
« A B + 2 / -> N
« A F SIGN N F SIGN ==
« N B » « A N »
IFTE
»
»
»
In your original code, 0 is affected to N with no further use

The second question;
Why are you putting the IF statement at the end of the test, just before the THEN instruction, not at the beginning of it ? I already notice this way used by a lot of HP49 and HP50 code writers!
Is there a technical issue there, not to follow the original and more comprehensive syntax structure:
« IF test THEN clause1 ELSE clause2 END »

There is my an alternative bisjection program peek out of my aged private library, which will run on HP50g as well has it hat does on HP28S so many times:

« -> a b                     @ pickup a & b from stack
« a b + 2 / @ compute mid point (n)
IF
DUP @ leave a copy of n in the stack
F @ compute sign of F(n)
a F @ compute sign of F(a)
* 0 > @ indirectly compare signs
THEN b @ leave n & b in stack
ELSE a SWAP @ leave a & n in stack
END
»
»
‘BIJ’ STO
OR whith out any local variable structure (only stack manipulations):
« DUP2 + 2 / DUP F 4 PICK F * 0 > «ROT» «SWAP» IFTE DROP »

An alternative to write down an automatic iterative program, would be to use the SOLVER environment and pressing a key during for-looker’s loops, the HP will display intermediate A and B values in the run!

These programs remembers me a lot of fun stuff from high school age!


Edited: 26 Nov 2009, 5:20 a.m. after one or more responses were posted


#42

Quote:
The second question; Why are you putting the IF statement at the end of the test, just before the THEN instruction, not at the beginning of it ? I already notice this way used by a lot of HP49 and HP50 code writers! Is there a technical issue there, not to follow the original and more comprehensive syntax structure: « IF test THEN clause1 ELSE clause2 END »

Perhaps they are keeping in line with the RPN idea of arguments first then operation?

#43

Quote:

Perhaps they are keeping in line with the RPN idea of arguments first then operation?


Yeah, that's all it is. When I'm "thinking in RPL", that's the syntax that makes the most sense to me.

As for storing 0 in N, that's just how I declare local variables. It seems to me that having all local variables allocated up front is the easiest way to do it.

Given a choice between various programming philosophies -- ease of writing, ease of reading, "elegance" -- I'll choose ease of writing.

#44

Quote:
Why are you putting the IF statement at the end of the test, just before the THEN instruction, not at the beginning of it ? I already notice this way used by a lot of HP49 and HP50 code writers!
Is there a technical issue there, not to follow the original and more comprehensive syntax structure:
« IF test THEN clause1 ELSE clause2 END »

It may be historical. One of the roots of RPL is Forth, so it makes perfect sense. Forth does not give you an option, its always 'test' IF. Of course, Lisp is also a root of RPL and Lisp uses the more conventional 'IF' syntax, i.e. IF 'test'. However, neither Lisp nor Forth 'test' syntax matches the conventional a opr b (Forth: a b opr, Lisp: opr a b).

I've written a few identical programs in Forth and Lisp so that I could compare them to RPL. No question RPL is more Forthy and less Lispy. I'd prefer that RPL was more Forthy. Sometimes rigidness makes it easier for groups to collaborate. And, it would be more consistent with the rest of RPL that does not have multiple ways to do some function.

Perl is a great example of flexibility taken to extreme. "There's more than one way to do it." is a Perl motto. I'm fairly certain that no two Perl programmers will truly ever understand each other. I believe this because I lead a team of Perl programmers. I often hear, "why did he do it this way?", "what does this do?", "perhaps we should have used Python...", etc... I was once accused of my Perl code looking like it had come from a C programmer. Well it did. I took the statement as a complement.

If you have not taken a look at Forth, then give it a go. Forth is freely available for just about every platform from the late 70's until today.

Edited: 26 Nov 2009, 1:33 p.m.

#45

I am busy learning UserRPL, and am intrigued by your two quite different bisection programs, which produce identical results. Did you write it structurally first, then later decide to write it again in "stack manipulation" form, or does a "stack manipulation" decompiler exist?


#46

@ Crawl

You are right in your programming philosophy and nothing is wrong with your code or style.

Allocated all the variables at beginning of the program/function makes sense to me too. I use to make it systematically in the old style BASIC line program such as the one on my Commodore C128D computer, this greatly help organize data and memory. It si also sparing running -time or the bad behavior when "out of memory error" runs, which is quite easy to occur on simplest 8-bits computer.

It is true that the IF…THEN…ELSE...END statements are not as Reverse Polish notation as the IFT or IFTE are. These two last are much more real post-pone operators like the majority of RPL instructions.

Egan points out similarity between UserRPL and FORTH which indeed have IF/ELSE/THEN/ whith a much more “Reverse Polisch” behaviour.


@ Egan Ford

Thank you for our interesting input and thoughts. I was not aware that userRPL and FORTH have so much in common. Again, you indicate me a good subject of studies and I will certainly past my for-coming weekend in learning a lot of new stuff by reading and experimenting of few bits in FORTH.

At first, the IF/ELSE.THEN syntax in FORTH pulzze me. FORTH have so much common syntax and stack operation (i.e. DUP DROP, etc…) . That’s perhaps why the syntax of IF/ELSE/THEN misleads me at first before I realize that the END statement was “missing”. It is fact it is not a lack in FORTH, it is RPL which have one extra statement, making the IF statement useless.

In FORTH

  DUP 6 < IF DROP 5 ELSE 1 - THEN ; 
In UserRPL
 IF DUP 6 < THEN  DROP 5 ELSE 1 – END 
These two lines have the same effet on the top value in the stack. Oppositely to FORTH the IF statement in RPL have no effect and the following variation of the code are equivalent: (changing position of IF/ELSE/THEN statements in FORTH will lead to a catastrophe)
IF DUP 6 < THEN DROP 5 ELSE 1 - END 
DUP IF 6 < THEN DROP 5 ELSE 1 - END
DUP 6 IF < THEN DROP 5 ELSE 1 - END
DUP 6 < IF THEN DROP 5 ELSE 1 - END
Amazing ! I never realize that.



@ Pal G.

Exactly, I generally first wrote first version of code using local variable or algebraic expression or what ever format is convenient depending of source of information. It this first phase, the function/programs are generally like prototypes and the first effort is to avoid any mistake or wrong transcription from the sources.
Then after playing with it and using this ‘first generation’ of code, I sometime rewrite most useful section of code in a more compact manner.

This is not systematic the great majority of code stay in the ‘easy to write it’ format. Only portion of code I use often will be ‘compilated’ into more ‘compact’ format. It is also copy to another part of the memory (I greatly use sub-directory to organize multiple project on my HP28S and share code have to be move to the top of the sub-directory tree.

Since HP28S lacks any export/import capabilities with external PC, printing and saving ‘compact code’ documentation will help re-typing it into the calculator. This appends time to time.

As far as I know, there is no “stack manipulation” decompiler on the HP28S, perhaps it may be one develop by the HP48/49/50 active community on these calculators or PC (since these are much more connected than old style HP28C/S).

#47

If you are on windows, debug4x includes an emulator for SW development purposes. Thus you can emulate a 48gx, 48gII, 49g+ or 50g by just clicking on the icon in the menu.

TW


#48

On debug4x 50g emulator screen I have:

So what should I do to clear the screen. (I'm real newbie..)


#49

Okay, you seriously need to read the manual. Especially before you ask any more questions.

They even have the manual available in multiple languages.

#50

Download and go through this quickstart guide first before going into the larger manual. It will help you out and probably be more useful.

ftp://hpcalclm:Builder2@ftp.usa.hp.com/

TW

#51

Here's a link to some very good training modules for the 50G:

HP 50G Training Modules

I hope this helps.

Regards,


John


#52

HP50g for US$99.99

Must be a mistake??


#53

However, the picture is of a 40gs, which is listed as $99.99 (on the "small/medium business -> handhelds" section). Clicking on the "buy online" link it comes up with a 50g for $149.99. "Pech"

#54

... we had this thread. Now we seem to face a very distinctive circumstance.

Anyway, both posts relate to very new models, and contributors at MoHPC (keep in mind it is a MUSEUM, not a BRAND_NEW forum) have always been very friendly accepting and answering such questions. I for one prefer to stick with Pioneers, Voyagers, Spices and Nuts (Coconuts, Halfnuts, any nuts...). I feel as if I've been out for too long...

Sorry, folks; could not help mentioning.

Cheers.

Luiz (Brazil)

Edited: 25 Nov 2009, 5:49 p.m.


#55

Imho poor online support Hp gives for its products..

Hp help forum for calculators is dead so I ask all my question here..

Thanks for your help again.

Edited: 25 Nov 2009, 7:10 p.m.


#56

The HP Help Forum is dead because the calcs are so easy to use no one actually need go there. What other reason could there be? ;-)

Try asking your questions in comp.sys.hp48 on Usenet. You will get friendly help there.


#57

I pointed him to comp.sys.hp48 in a previous thread, including a link to it on Google groups if he doesn't have a news reader.

#58

Hi, ferroburak;

by no means I intended to patronize a discussion about who can or cannot post about this or that subject. I actually was trying to make sense of things, since I was not following discussions here for about a couple of years (I started posting here in 2001). I tracked some subjects related to the old models that are of my own interest at the forum archives so I could get closer to what is going on, but I found just a few references (MCODE programming, maintenance, etc.). Then I saw many entries about subjects I am not much interested about, but you see, a forum is a place where people share subjects of common interest, and I just miss the ones I like most.

About your request: I see no problems posting here about the new models, what I see is that there are many follow-ups. And once again, I am just another contributor.

Have you tried this HP48-dedicated group? I found some HP50G-related discussions. And please, this link is just another possibility of having your questions being answered, I am not pointing you there, OK? Since the first time I posted here, anybody is welcome sharing whatever knowledge one has about HP calculators. And this has not been changed.

Cheers.

Luiz (Brazil)


#59

From the heading at the top of this Forum:

Quote:
This forum is for discussion of HP calculators including usage, repairs, sources of replacement parts, general information etc.

Says nothing about being limited to older models. In point of fact, there have been
many threads about using current models, participated in by lots of members. It seems to me that this complaint comes up primarily when the OP is a newcomer. Am I wrong?

#60

Quote:
It seems to me that this complaint comes up primarily when the OP is a newcomer. Am I wrong?
Martin, my personal experience is that you are indeed wrong (said as a straight answer to your question, no malice intended). I joined this forum less than a year ago and have always received friendly replies.

What gets peoples backs up is when someone uses the forum instead of the manual (ferroburak did not even bother to read up how to clear the screen) or to get instant answers to homework tasks.

The answers that have been posted in this thread actually testify of the willingness of this forum's members to help. Many other forums would have ignored or flamed him/her long ago.

To ferroburak: please feel free to use the forum as a supplement to the manual, not a substition (easy way out). Many enjoy a challenge (hence the posting of mini-challenges and the numerous replies) but are wary when they see questions that they know are answered in the manual - yes we have read them, that's what helped us on the road to becoming proficient users in the first place!!
#61

Quote:
Says nothing about being limited to older models.
Neither did I. In fact, quoting myself:
Quote:
I see no problems posting here about the new models, what I see is that there are many follow-ups.
Once again, quoting myself:
Quote:
Anyway, both posts relate to very new models, and contributors at MoHPC (keep in mind it is a MUSEUM, not a BRAND_NEW forum) have always been very friendly accepting and answering such questions. I for one prefer to stick with Pioneers, Voyagers, Spices and Nuts (Coconuts, Halfnuts, any nuts...).
Except for Dave Hicks, I cannot think of anyone else here that had not, at least once, been a newcomer at the MoHPC forum. I hope you do not take it wrongly, but I cannot agree with you.

As a matter of fact, I decided to post for clarifying (as I always try to do), not disturbing. Am I wrong?

Cheers.

Luiz (Brazil)


Edited: 27 Nov 2009, 6:16 p.m.

#62

Quote:
Hp help forum for calculators is dead

Is this the dead one? http://tinyurl.com/yf4ku7f. If so, Tim Wessman (HP) checks in there (and here) quite often.

Edited: 25 Nov 2009, 7:52 p.m.


Possibly Related Threads...
Thread Author Replies Views Last Post
  Use 82240B as computer printer R. Pienne 3 1,000 12-09-2013, 12:19 PM
Last Post: Marcus von Cube, Germany
  emu48 - copy stack doesn't work (as expected) Thomas Radtke 2 831 11-11-2013, 02:19 PM
Last Post: Thomas Radtke
  Another Prime mystery - templates don't work anymore Michael de Estrada 2 640 11-02-2013, 11:34 AM
Last Post: Michael de Estrada
  OT: Jeppesen E6B Wind-Easy Computer (Slide Rule) Eddie W. Shore 18 2,737 10-12-2013, 03:26 PM
Last Post: George Litauszky
  Does the HP Prime software only work with Win 7/ 8 ? Michael de Estrada 3 798 10-12-2013, 02:52 PM
Last Post: John Ioannidis
  Back to School/Work/Other Calculator Poll Eddie W. Shore 63 7,049 09-12-2013, 06:03 AM
Last Post: bhtooefr
  hp50g screen weird line Sok-khieng Chum Hun 2 609 09-10-2013, 08:11 AM
Last Post: Sok-khieng Chum Hun
  Documentation about Hp50g / 49g+ / 48gII and wikis Pier Aiello 9 1,247 09-10-2013, 04:22 AM
Last Post: Software49g
  Computer-scientist functions on HP Prime? Michael O. Tjebben 12 1,432 08-22-2013, 06:59 PM
Last Post: plivesey
  Paper on the errors in HP Calculators vs some older computer processors Les Koller 3 742 08-19-2013, 12:37 PM
Last Post: Mike Morrow

Forum Jump: