Post Reply 
Request for suggestions: algebraic equations in Free42
07-10-2020, 03:37 PM
Post: #21
RE: Request for suggestions: algebraic equations in Free42
As the wish list gets longer it seems to be diverging further and further away from an actual HP 42S. I would prefer seeing Free42 development frozen except for bug fixes and remain true to it's
"42ness".

I am all in favor of then branching off in the directions suggested here but calling it something else.
Find all posts by this user
Quote this message in a reply
07-10-2020, 03:51 PM
Post: #22
RE: Request for suggestions: algebraic equations in Free42
I know it’s not related to algebraic equations, but two things that you may consider as extensions for Free42 if they are not already on your list:
  • ANUM, this function from the 41 XFunction module was strangely missing in the 42S, it would make sense to add it to Free42 I think
  • Reorganizing the way the CATALOG is managed for the Free42 Extensions to the HP-42S Instruction Set: Instead of having them just listed at the end of CATALOG>FCN (or in addition), I would suggest to add a second menu line to the CATALOG menu, and to have entries on this second menu line to group the functions as if they were in modules: there could be a TIME entry for all the TIME functions, a BASE or XBASE entry for the BASE enhancements …
Find all posts by this user
Quote this message in a reply
07-10-2020, 06:04 PM
Post: #23
RE: Request for suggestions: algebraic equations in Free42
It looks like fully emulating the 27S/17B/etc. expression functionality will require implementing direct solutions. It sounds like this is rather simplistic, using additions and subtractions to isolate the unknown on one side of the equals sign, and using exact inverses to get it to its bare form. Is that really all there is to it? Is this documented anywhere?
Visit this user's website Find all posts by this user
Quote this message in a reply
07-10-2020, 06:11 PM
Post: #24
RE: Request for suggestions: algebraic equations in Free42
(07-10-2020 03:37 PM)twoweims Wrote:  As the wish list gets longer it seems to be diverging further and further away from an actual HP 42S. I would prefer seeing Free42 development frozen except for bug fixes and remain true to it's
"42ness".

I am all in favor of then branching off in the directions suggested here but calling it something else.

Since the new version will be paid, calling it Free42 wouldn't be very appropriate. I haven't decided what it will be called yet. But it will be a fork from the existing Free42, and the existing Free42 will continue to be maintained along with the commercial version. Some of the minor improvements suggested in this thread may end up in both versions, but the big new features will be only in the paid version.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-10-2020, 06:23 PM (This post was last modified: 07-10-2020 06:25 PM by Sylvain Cote.)
Post: #25
RE: Request for suggestions: algebraic equations in Free42
Antonio Lagana excellent i41CX+ uses REDUCE for its CAS implementation and gnuplot for graphical representation.
Find all posts by this user
Quote this message in a reply
07-10-2020, 10:09 PM
Post: #26
RE: Request for suggestions: algebraic equations in Free42
One option worth considering may be a feature to convert an algebraic equation to the equivalent HP-42S RPN program, and maybe link the algebraic view to the RPN program somehow until you edit one of them and invalidate the link.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
07-11-2020, 02:19 AM
Post: #27
RE: Request for suggestions: algebraic equations in Free42
(07-10-2020 06:11 PM)Thomas Okken Wrote:  Since the new version will be paid, calling it Free42 wouldn't be very appropriate.
Are you planning to make the paid version open source?
Find all posts by this user
Quote this message in a reply
07-11-2020, 02:51 AM
Post: #28
RE: Request for suggestions: algebraic equations in Free42
(07-11-2020 02:19 AM)johanw Wrote:  
(07-10-2020 06:11 PM)Thomas Okken Wrote:  Since the new version will be paid, calling it Free42 wouldn't be very appropriate.
Are you planning to make the paid version open source?

The core and the Linux version, yes, since that will be shareware so distributed on the honor system. The others, I think I'll keep closed source at first, then release the source later, like after a year or so. The aim being to make sure that the name recognition for the new version is firmly established before any parasites start trying to sell their own builds from my code. (Several people have tried this with Free42 on iOS in the past, so it's not a paranoid scenario.)
Visit this user's website Find all posts by this user
Quote this message in a reply
07-11-2020, 08:04 AM
Post: #29
RE: Request for suggestions: algebraic equations in Free42
(07-10-2020 06:04 PM)Thomas Okken Wrote:  It looks like fully emulating the 27S/17B/etc. expression functionality will require implementing direct solutions. It sounds like this is rather simplistic, using additions and subtractions to isolate the unknown on one side of the equals sign, and using exact inverses to get it to its bare form. Is that really all there is to it? Is this documented anywhere?
This is described in details in the 27S/19B Technical applications book.
This will happen only if the unknown appears formally only once in the equation. So you can force iterative solutions by writing something like X+0*X rather than just X. Yes direct solutions are basic and straightforward, since the Pionniers are RPL-based a bit of RPL symbolics were embedded in them, but not much.
Find all posts by this user
Quote this message in a reply
07-11-2020, 05:09 PM
Post: #30
RE: Request for suggestions: algebraic equations in Free42
I would like to have a recursive integration and solver!
Find all posts by this user
Quote this message in a reply
07-11-2020, 07:46 PM
Post: #31
RE: Request for suggestions: algebraic equations in Free42
List of wants:

* Numerical derivative
* Function graphing (even with the limited screen, I could work as a basic graphing calculator with a table stored in a table)
* All the Greek symbols available in the ALPHA register
* While/Repeat loops
Visit this user's website Find all posts by this user
Quote this message in a reply
07-11-2020, 07:49 PM
Post: #32
RE: Request for suggestions: algebraic equations in Free42
(07-11-2020 08:04 AM)Vincent Weber Wrote:  
(07-10-2020 06:04 PM)Thomas Okken Wrote:  It looks like fully emulating the 27S/17B/etc. expression functionality will require implementing direct solutions. It sounds like this is rather simplistic, using additions and subtractions to isolate the unknown on one side of the equals sign, and using exact inverses to get it to its bare form. Is that really all there is to it? Is this documented anywhere?
This is described in details in the 27S/19B Technical applications book.
This will happen only if the unknown appears formally only once in the equation. So you can force iterative solutions by writing something like X+0*X rather than just X. Yes direct solutions are basic and straightforward, since the Pionniers are RPL-based a bit of RPL symbolics were embedded in them, but not much.
The direct solution feature can be annoying. For example, it means that solving \((x-5)^2-9=0\) will always return \(x=8\) as the solution regardless of the starting guess for \(x\), because \(\sqrt{9}\) is always taken as \(+3\). A similar thing can happen with an equation involving trig functions. Although the direct solution feature can be disabled, it would be simpler not to bother with it at all. The speed advantage that direct solution provides is surely unimportant on modern hardware.

Nigel (UK)
Find all posts by this user
Quote this message in a reply
07-11-2020, 08:19 PM
Post: #33
RE: Request for suggestions: algebraic equations in Free42
(07-11-2020 02:51 AM)Thomas Okken Wrote:  The aim being to make sure that the name recognition for the new version is firmly established before any parasites start trying to sell their own builds from my code. (Several people have tried this with Free42 on iOS in the past, so it's not a paranoid scenario.)
I know. I maintain a fork of Signal messenger for Android with some extra options, but there are also people there who rebrand the app, put Facebook ads in it and publish it on the Google Play Store. The Signal folks usually get them removed after a while because they use their infrastructure, while my non-commercial fork (which is not even in Play) is tolerated.

But I am a little surprised that it happened with Free42, which seems a rather niche app for me. I recently tried to teach my girlfriend some basic operations on a DM15 but that was more difficult than I anticipated.
Find all posts by this user
Quote this message in a reply
07-11-2020, 09:09 PM
Post: #34
RE: Request for suggestions: algebraic equations in Free42
(07-11-2020 07:49 PM)Nigel (UK) Wrote:  The direct solution feature can be annoying. For example, it means that solving \((x-5)^2-9=0\) will always return \(x=8\) as the solution regardless of the starting guess for \(x\), because \(\sqrt{9}\) is always taken as \(+3\). A similar thing can happen with an equation involving trig functions. Although the direct solution feature can be disabled, it would be simpler not to bother with it at all. The speed advantage that direct solution provides is surely unimportant on modern hardware.

I agree that it the numerical solver is fast enough, but I'm under the impression that the direct solutions are required for certain use cases involving repeated evaluation when using L() and G().
(Does this apply to the 32SII/33S/35S as well?)

(07-11-2020 08:19 PM)johanw Wrote:  
(07-11-2020 02:51 AM)Thomas Okken Wrote:  The aim being to make sure that the name recognition for the new version is firmly established before any parasites start trying to sell their own builds from my code. (Several people have tried this with Free42 on iOS in the past, so it's not a paranoid scenario.)
[...] I am a little surprised that it happened with Free42, which seems a rather niche app for me.

So was I. And they were charging money for their version while mine was available for free! But of course that also means that if people will try this when the odds of success are close to zero, they will definitely try again when I release a paid version, giving them the opportunity to undercut my price. It's all good fun when you're giving away your software, but less so when you're trying to make a bit of money from it.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-11-2020, 11:15 PM
Post: #35
RE: Request for suggestions: algebraic equations in Free42
(07-11-2020 09:09 PM)Thomas Okken Wrote:  
(07-11-2020 07:49 PM)Nigel (UK) Wrote:  The direct solution feature can be annoying. For example, it means that solving \((x-5)^2-9=0\) will always return \(x=8\) as the solution regardless of the starting guess for \(x\), because \(\sqrt{9}\) is always taken as \(+3\). A similar thing can happen with an equation involving trig functions. Although the direct solution feature can be disabled, it would be simpler not to bother with it at all. The speed advantage that direct solution provides is surely unimportant on modern hardware.

I agree that it the numerical solver is fast enough, but I'm under the impression that the direct solutions are required for certain use cases involving repeated evaluation when using L() and G().
(Does this apply to the 32SII/33S/35S as well?)
I don't think so.
Take the equation X=G(X)+1 as a example of repeated evaluation. It should not be read as X=X+1 (no roots obviously), but as X=C+1, where C is not a variable but a constant that just happens to hold the current value of X. So setting X to 1 and solving to X will lead to 2, then 3 and so on. The 27S does that with a direct solution, but it could as well do it by iteration. I believe only performance is at stake here. But read the book, just in case I forgot something...

The 32SII/33S/35S equation system is far less elaborated. No L() and G(), no SIGMA, no IF, no ITEM, no S()... just plain vanilla equations.

Cheers

Vincent
Find all posts by this user
Quote this message in a reply
07-12-2020, 12:50 PM
Post: #36
RE: Request for suggestions: algebraic equations in Free42
(07-11-2020 11:15 PM)Vincent Weber Wrote:  Take the equation X=G(X)+1 as a example of repeated evaluation. It should not be read as X=X+1 (no roots obviously), but as X=C+1, where C is not a variable but a constant that just happens to hold the current value of X. So setting X to 1 and solving to X will lead to 2, then 3 and so on. The 27S does that with a direct solution, but it could as well do it by iteration. I believe only performance is at stake here.

I see. And L() could be dealt with in a similar manner, by making its side effects apply only during the first iteration. Could be a bit tricky but should be possible. I'll read the relevant sections of the 27S/19B book to make sure, but I like the idea of dropping the direct solutions while otherwise maintaining all the advanced functionality of the 27S/17B/19B/etc. equations, and not having to put up with the limitations of the 32SII/33S/35S version.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-12-2020, 01:09 PM
Post: #37
RE: Request for suggestions: algebraic equations in Free42
(07-12-2020 12:50 PM)Thomas Okken Wrote:  
(07-11-2020 11:15 PM)Vincent Weber Wrote:  Take the equation X=G(X)+1 as a example of repeated evaluation. It should not be read as X=X+1 (no roots obviously), but as X=C+1, where C is not a variable but a constant that just happens to hold the current value of X. So setting X to 1 and solving to X will lead to 2, then 3 and so on. The 27S does that with a direct solution, but it could as well do it by iteration. I believe only performance is at stake here.

I see. And L() could be dealt with in a similar manner, by making its side effects apply only during the first iteration. Could be a bit tricky but should be possible. I'll read the relevant sections of the 27S/19B book to make sure, but I like the idea of dropping the direct solutions while otherwise maintaining all the advanced functionality of the 27S/17B/19B/etc. equations, and not having to put up with the limitations of the 32SII/33S/35S version.
Yes indeed.
Just be careful this is tricky, that G(X) is a constant only happens if X appears formally once in the equation.
The 2 following equations look identical but do very different things:

1) X=2*G(X)+1 : X appears formally once, so entering 1 in X then solving for it will return 3, then 7, and so in.

2) X=0*X+2*G(X) + 1: X appears formally twice, so iteration is forced, and solving for X will return the root of X = 2X+1, i.e. -1. In this case G(X) is evaluated at each iteration.

L() and G() are also used for hiding internal variables (a variable that never appears outside of them is not shown in the menu) and other stuff (menu reordering..)

The books show this well.

Cheers,

Vincent
Find all posts by this user
Quote this message in a reply
07-14-2020, 07:41 PM
Post: #38
RE: Request for suggestions: algebraic equations in Free42
(07-08-2020 09:16 PM)Thomas Okken Wrote:  I am looking for inspiration about how to approach the algebraic equations in particular.

Well, how difficult it is to implement algebraic equations depends on what limits you put on what is considered an "algebraic equation".

For example, if you want to support basic arithmetic operators, such as "+" , "-" , "/" , "*" , "^" etc., functions with a variable number of arguments eg. "F(X,Y)", and variables, then you could use Dijkstra's Shunting-yard algorithm, with lazy evaluation, to easily parse such equations into an intermediate format such as an abstract syntax tree ( AST ). The AST can be used as the internal representation for algebraic equations. Also, you'd need to implement a term re-writing system that operates on the ASTs.

If you want more complex syntax in your expressions, then you may need to use an operator precedence parser, or even a recursive descent LL(1) or shift-reduce bottom-up LALR(1) parser.

Ideally, you probably wouldn't want to reinvent the wheel and instead use a third-party library, but, I don't know if there are any good third-party CAS libraries that are licensed under the GNU LGPL -- eg. Xcas / Giac is dual licensed under the GNU GPL and a commercial license, so, you'd have to pay royalties to use it if you want to sell a paid version of Free42.

Regards,

Jonathan

Aeternitas modo est. Longa non est, paene nil.
Find all posts by this user
Quote this message in a reply
07-16-2020, 12:59 AM (This post was last modified: 07-16-2020 01:02 AM by Thomas Okken.)
Post: #39
RE: Request for suggestions: algebraic equations in Free42
(07-10-2020 03:28 PM)johanw Wrote:  Something I would love to have, and would probably (I hope) be quite easy to implement, is an extension of the BASE menu to include some functions now found only on the 16C: 1 and 2 complement, signed / unsingned, and the option to work with bitmasks.

Just noticed this upon re-reading the thread... Free42 already supports signed and unsigned; take a look at the MODES menu and you'll find a third row there with BASE-related settings that were added in 2.4. They are documented here.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-11-2021, 11:24 PM
Post: #40
RE: Request for suggestions: algebraic equations in Free42
I think an equation writer such as that of the 35s would help sell the app. Let's not forget that the 35s solves equations numerically and, in a way, symbolically.
Find all posts by this user
Quote this message in a reply
Post Reply 




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