Post Reply 
Finding small equation solutions with great precision with Solvesys and Longfloat
07-25-2020, 01:49 AM (This post was last modified: 07-25-2020 01:52 AM by math7.)
Post: #1
Finding small equation solutions with great precision with Solvesys and Longfloat
Hi, I was playing with my HP 50g for a while, especially with the Solvesys application which I think is great, and also with the excellent library created long ago "longfloat" that allows you to choose the number of digits to work with extended integers. On the other hand I have noticed that for some equations whose solution are numbers like x = 1.1618E-16 neither Solvesys nor the application incorporated in the HP 50g can find these values as solutions. However, I have seen that in this extraordinary calculator you can do "almost everything" in terms of calculations, but there is some way to combine the Longfloat or similar library with Solvesys so that the calculator can work internally with more decimals and of the correct answer?
The following link refers to a type of these equations or systems.
https://www.hpmuseum.org/forum/thread-76...t=solvesys
Find all posts by this user
Quote this message in a reply
07-25-2020, 01:29 PM (This post was last modified: 07-25-2020 01:33 PM by John Keith.)
Post: #2
RE: Finding small equation solutions with great precision with Solvesys and Longfloat
Like most HP 50 applications (and built-in functions), SolveSys works with 12-digit floating-point numbers. LongFloat defines a new data type which is not compatible with existing commands and functions. This is why LongFloat has its own functions (FDIV, FEXP, FPI, etc.).

I believe you will have to write your own user programs using LongFloat functions . Since SolveSys is open source, you can read the source code and see how the program works. This does not sound like an easy undertaking to me though.

Also, since LongFloat is quite slow, I would expect such a user program to be very slow indeed.

John

Edit: another possibility is to use exact rational arithmetic, i.e. exact mode. This may not be suitable for your intended uses but exact integers tend to be significantly faster than LongFloats.
Find all posts by this user
Quote this message in a reply
07-25-2020, 10:50 PM (This post was last modified: 07-25-2020 10:52 PM by math7.)
Post: #3
RE: Finding small equation solutions with great precision with Solvesys and Longfloat
(07-25-2020 01:29 PM)John Keith Wrote:  Like most HP 50 applications (and built-in functions), SolveSys works with 12-digit floating-point numbers. LongFloat defines a new data type which is not compatible with existing commands and functions. This is why LongFloat has its own functions (FDIV, FEXP, FPI, etc.).

I believe you will have to write your own user programs using LongFloat functions . Since SolveSys is open source, you can read the source code and see how the program works. This does not sound like an easy undertaking to me though.

Also, since LongFloat is quite slow, I would expect such a user program to be very slow indeed.

John

Edit: another possibility is to use exact rational arithmetic, i.e. exact mode. This may not be suitable for your intended uses but exact integers tend to be significantly faster than LongFloats.

Hi John ... Well, I have tried some longfloat commands and it does not seem so slow, even with 25 decimal places it takes more or less 1 or 2 seconds to perform 5 calculations in a row. But what do you say about using exact arithmetic what does it mean? How can I do that with the HP 50g? And something else: according to the link I shared about that system of equations, how can such a system be solved on the HP 50g if its precision is 12 digits? It means that if that system or another similar one appears we would not be able to solve it with our calculator and we would have to resort to software like Mathematica?

Can something be done using System RPL and have the calculator do calculations with more decimals?
Find all posts by this user
Quote this message in a reply
07-26-2020, 11:22 AM
Post: #4
RE: Finding small equation solutions with great precision with Solvesys and Longfloat
The point that I was trying to make is that in either case you will have do do your own programming. SolveSys and LongFloat will not work together as-is. Both of those libraries are large and complex, and integrating or re-writing them will not be a trivial task.

If you are in exact mode (equal sign rather than tilde in the top line of the status area) pressing 3 ENTER 5 / will return '3/5' rather than .6. For example from your link, 127*10^-12 will evaluate to '127/1000000000000'. Once again, you will have to write your own solver program to work with exact arguments.
Find all posts by this user
Quote this message in a reply
07-26-2020, 12:24 PM
Post: #5
RE: Finding small equation solutions with great precision with Solvesys and Longfloat
Good news: It turns out that the built-in command MSLV does what you want. If you enter the equations as in post #2 of your link and enter [1 1] as initial guesses, the correct results are returned. Still only 12-digit accuracy though, MSLV does not seem able to find an exact solution in this case.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)