Post Reply 
Plus42 Equations, Preview Release
05-08-2022, 12:57 PM
Post: #621
RE: Plus42 Equations, Preview Release
Loving Plus42!

Two units questions:

- can we get a milligram unit in the mass section? I know I can custom define, but mg would be nice built in…
- when I use ASSIGN, there is a submenu for UNIT. However there is nothing in it. My custom defined units are in OTHER. What goes in the UNIT submen?
Find all posts by this user
Quote this message in a reply
05-08-2022, 02:37 PM
Post: #622
RE: Plus42 Equations, Preview Release
Actually, what happens is that in ASSIGN, the PGM, REAL, CPX, MAT, LIST, EQN, and OTHER sections will show the variables belonging to those categories. Specifically: PGM shows global labels, REAL shows real variables and strings, MAT shows real and complex matrices, LIST shows lists, EQN shows equation variables (and the black-on-white EQN, which is the list of named equation in EQN mode, is blocked), and OTHER shows all variables not belonging to the aforementioned categories, meaning, numbers with attached units, and all three types of references.

MEM shows available memory and can't be assigned; FCN contains HP-42S functions; and TIME, XFCN, BASE, PRGM, STR, STK, EQNS, UNIT, STAT, DIR, DISP, and MISC contain Free42/Plus42 built-in functions.

Which leaves DIRS and UNITS. DIRS really should be blocked, since assigning a directory name to the CUSTOM menu doesn't actually work. UNITS is blocked because assigning built-in units to CUSTOM doesn't actually work, either.

Assigning units is a special case of assigning variables. When a CUSTOM menu key is pressed, and the assignment does not match a LBL, it is next matched against variables. If a matching variable exists and is not a number with a unit, RCL is performed; if a matching variable exists and *is* a number with a unit, the assignment is considered to be a user-defined unit, and is applied to the number in X.

There is no mechanism for assigning built-in units to CUSTOM, so you'd have to create a user-defined unit matching a built-in unit, e.g. 1_m STO "m" so you could then use ASSIGN "m" TO 01.

Of course this is not ideal. I'm not sure how to improve this yet. The standard HP-42S CUSTOM behavior is: look for a LBL and perform XEQ; if not found, look for a variable and perform RCL; if also not found, look for a built-in function and execute it. This could be extended to also search for units and directories, but maybe it would be better to add the type of item being assigned to the menu key.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-08-2022, 09:58 PM
Post: #623
RE: Plus42 Equations, Preview Release
So I think I have all the details of my theme worked out (an updated version of GDW for Plus42) except for one issue. The alternate keys for equation mode. They work fine on macOS, but in my iPhone, all four keys have a doubled appearance. Any thoughts would be appreciated.

Theme and a screenshot of the issue are here: link to theme
Find all posts by this user
Quote this message in a reply
05-08-2022, 10:50 PM
Post: #624
RE: Plus42 Equations, Preview Release
You've defined the alternate backgrounds in the part of the skin that is getting duplicated when the display area is stretched. When creating a skin that allows display stretching, you should make sure that the entire horizontal strip between y coordinates "display top" and "display bottom" can be safely replicated, or else find a sub-strip than can be, and declare its top and bottom y coordinates using a DisplayExpansionZone: line. Take a look at the PortraitShort skin to see how this is used (gif, layout).
Visit this user's website Find all posts by this user
Quote this message in a reply
05-09-2022, 12:53 AM
Post: #625
RE: Plus42 Equations, Preview Release
(05-08-2022 10:50 PM)Thomas Okken Wrote:  You've defined the alternate backgrounds in the part of the skin that is getting duplicated when the display area is stretched. When creating a skin that allows display stretching, you should make sure that the entire horizontal strip between y coordinates "display top" and "display bottom" can be safely replicated, or else find a sub-strip than can be, and declare its top and bottom y coordinates using a DisplayExpansionZone: line. Take a look at the PortraitShort skin to see how this is used (gif, layout).

Ahhhh that makes sense. I will try to fix this.
Find all posts by this user
Quote this message in a reply
05-09-2022, 02:39 AM
Post: #626
RE: Plus42 Equations, Preview Release
(05-09-2022 12:53 AM)tgray Wrote:  Ahhhh that makes sense. I will try to fix this.

That fixed it. This whole time I was working off of the PortraitTall theme and probably should have been using the short one. Thanks!
Find all posts by this user
Quote this message in a reply
05-09-2022, 07:37 AM (This post was last modified: 05-09-2022 07:41 AM by level7.)
Post: #627
RE: Plus42 Equations, Preview Release
(05-08-2022 08:00 AM)level7 Wrote:  Hi Thomas, first of all congratulations on your achievement and very happy to purchase Plus42 to support your efforts on this and Free42.
  • Overall enjoying it so far but the extra rows of buttons makes it a bit less desirable to use on a smaller screen as the buttons are even smaller. Very much looking forward to an iPad app when you get around to it.
  • I can't seem to pinpoint but I'm definitely have some stability issues with the application just crashing out at certain circumstances (will try to report if repeatable)
  • I did notice that there is now the ability to exit the app with "OFF" which is off by default for Plus42 ... Can we turn this off? In the documentation not sure why this is highlighted under the Plot Viewer.
  • Am I nuts or does it seem to provide the opposite sign? For example the integral for Y=X^2, with LLIM=0 and ULIM=1 I'm getting -0.3333 ... In my experimentation I was also getting some weird results with integrals but perhaps that was on me.

Kind regards,
S

Hope it's ok to bump my own post here as it fell behind as it was going through new member moderation. Some more irregularities with the integration:

Code:

iPhone SE (1st gen), iOS latest, latest Plus42, New State
iOS latest, latest Plus42

New State

EQN
NEW
Y=X^2 ENTER
EXIT
INTEGRATION
TOP MENU =
TOP MENU CALC
TOP MENU Y
0 LLIM
1 ULIM
TOP MENU INTEGRATION
(result is 0.5??) what does it mean to integrate Y=X^2 with respect to Y
EXIT
EXIT
EXIT
EXIT (main menu)
INTEGRATION
TOP MENU =
TOP MENU CALC
TOP MENU X
TOP MENU INTEGRATION
(result is 0.6638) seems wrong?
EXIT
EXIT
EXIT
EXIT (main menu)
INTEGRATION
TOP MENU =
TOP MENU CALC
TOP MENU Y
TOP MENU INTEGRATION
(result is -0.5) seems different result
[/code]
Find all posts by this user
Quote this message in a reply
05-09-2022, 08:40 AM
Post: #628
RE: Plus42 Equations, Preview Release
The integrator doesn't solve the equation, it just evaluates it, and evaluating an equation with a top-level = sign means evaluating its left- and right-hand sides and subtracting the latter from the former. So if you're integrating Y=X^2 with integration variable Y, you're integrating Y-X^2, where X will be whatever value it happens to be when you start the integration.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-09-2022, 08:42 AM
Post: #629
RE: Plus42 Equations, Preview Release
As far as crashes are concerned, of course it's hard to deal with those if they can't be reproduced. However, I'm keeping my eye on the Android and iOS developer consoles, and once I start seeing crash logs there, I should be able to make progress on those issues.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-09-2022, 09:49 AM
Post: #630
RE: Plus42 Equations, Preview Release
No crash logs for Android so far, but 7 for iOS, 5 of which are in the code that draws the axis tick marks for PLOT, and the other two appear to be app initialization failures. I'll focus on the PLOT thing first, it's probably a failure to detect invalid plot boundaries...
Visit this user's website Find all posts by this user
Quote this message in a reply
05-09-2022, 11:58 AM
Post: #631
RE: Plus42 Equations, Preview Release
It does look like invalid plot boundaries, but I don't see how they could get into that state, since there are checks for that when setting XMIN etc.
I'll add some code to the next release to at least make sure it doesn't get stuck in an infinite loop in axis_ticks(), and instead simply skips plotting the axes when it gets into that state.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-09-2022, 01:57 PM
Post: #632
RE: Plus42 Equations, Preview Release
(05-08-2022 08:06 AM)Thomas Okken Wrote:  
(05-07-2022 10:40 PM)TeamTricky Wrote:  I have a question regarding TVM. Perhaps I am simply using this incorrectly. Please try this:

1. Open TVM menu
2. Key in 12 for N
3. Key in 0 for I%YR
4. Key in -10000 for PV
5. Key in 1000 for PMT
6. Press FV.

I expect to see 2000, but instead I see -2000. It seems (to me) like the sign is not handled properly once the balance changes sign.

That is the correct result.

The sign indicates which way the payment is going. Let's say negative means money you pay, while positive means money you receive. (You could do it the other way around. Either choice is fine, as long as it's applied consistently.)

So in this case, you start by paying 10,000, so it looks like you're lending money to someone else. Next, you receive 12 payments of 1,000 each. So now you've actually been repaid more than you lent out, so you end up owing, and the future value, which is the final payment, is -2000, because you have to pay what you've been overpaid.

(05-07-2022 10:40 PM)TeamTricky Wrote:  If I try the same thing in the AMRT table, I see what I expect.

That's because the AMRT table shows the balance, which is the opposite of the future value. That is, it represents the unpaid part of the loan, while FV represents the final payment. Thus, BAL represents a payment to the borrower, while FV represents a payment to the lender, so the quantities have the same magnitude but opposite signs.

Thank you for that explanation.

I was (incorrectly) equating FV with BAL. When I check FV after 9 payments, it is 1000, which is the opposite of BAL. And after 12 payments, FV is -2000, again, the opposite of BAL.
Find all posts by this user
Quote this message in a reply
05-10-2022, 06:25 AM (This post was last modified: 05-10-2022 06:25 AM by n3mmr.)
Post: #633
RE: Plus42 Equations, Preview Release
In the plus42 history you say you added the TYPE? and UNIT? functions (in 1.0.1).
I can find the UNIT? function, but TYPE? is nowhere to be found, it seems?

Where is it, and what does it do?
Find all posts by this user
Quote this message in a reply
05-10-2022, 06:35 AM
Post: #634
RE: Plus42 Equations, Preview Release
(05-08-2022 09:58 PM)tgray Wrote:  So I think I have all the details of my theme worked out (an updated version of GDW for Plus42) except for one issue. The alternate keys for equation mode. They work fine on macOS, but in my iPhone, all four keys have a doubled appearance. Any thoughts would be appreciated.

Theme and a screenshot of the issue are here: link to theme

Very nice work. Avoiding skeuomorphism whilst retaining a distinct personality isn't the easiest of tasks; but you've nailed it.
Find all posts by this user
Quote this message in a reply
05-10-2022, 08:42 AM
Post: #635
RE: Plus42 Equations, Preview Release
(05-10-2022 06:25 AM)n3mmr Wrote:  In the plus42 history you say you added the TYPE? and UNIT? functions (in 1.0.1).
I can find the UNIT? function, but TYPE? is nowhere to be found, it seems?

Where is it, and what does it do?

It's in CATALOG→PRGM (note: not PGM).
In the equation editor, the type check functions are grouped together in PGM.FCN, although CPXMAT? and EQN? are missing.

TYPE? returns an integer identifying the type of the object in X. This is partly documented in the Free42 page under Programming Utilities:

Quote:TYPE? Returns an integer, representing the type of the object in the X register. The numbers correspond to object types as follows:

 1: Real Number
 2: Complex Number
 3: Real Matrix
 4: Complex Matrix
 5: String
 6: List

Plus42 adds more types:

 7: Equation
 8: Unit
 9: Directory Reference
10: Program Reference
11: Variable Reference
Visit this user's website Find all posts by this user
Quote this message in a reply
05-10-2022, 08:53 AM
Post: #636
RE: Plus42 Equations, Preview Release
(05-08-2022 09:58 PM)tgray Wrote:  So I think I have all the details of my theme worked out (an updated version of GDW for Plus42) except for one issue. The alternate keys for equation mode. They work fine on macOS, but in my iPhone, all four keys have a doubled appearance. Any thoughts would be appreciated.

Theme and a screenshot of the issue are here: link to theme

If you like, I'll be happy to put it in the Plus42 skins collection on my web site once it's finished.
The more choices, the better!
Visit this user's website Find all posts by this user
Quote this message in a reply
05-10-2022, 10:06 AM
Post: #637
RE: Plus42 Equations, Preview Release
(05-10-2022 08:42 AM)Thomas Okken Wrote:  
(05-10-2022 06:25 AM)n3mmr Wrote:  In the plus42 history you say you added the TYPE? and UNIT? functions (in 1.0.1).
I can find the UNIT? function, but TYPE? is nowhere to be found, it seems?

Where is it, and what does it do?

It's in CATALOG→PRGM (note: not PGM).
In the equation editor, the type check functions are grouped together in PGM.FCN, although CPXMAT? and EQN? are missing.

TYPE? returns an integer identifying the type of the object in X. ......

Thank you!
Find all posts by this user
Quote this message in a reply
05-10-2022, 01:49 PM
Post: #638
RE: Plus42 Equations, Preview Release
(05-09-2022 08:40 AM)Thomas Okken Wrote:  The integrator doesn't solve the equation, it just evaluates it, and evaluating an equation with a top-level = sign means evaluating its left- and right-hand sides and subtracting the latter from the former. So if you're integrating Y=X^2 with integration variable Y, you're integrating Y-X^2, where X will be whatever value it happens to be when you start the integration.
Thanks for the explanation - sorry if this was something that I should have known! I still think I was having some crashes with integration earlier, but it may also be me fat fingering the shift and off bottom.

(05-09-2022 09:49 AM)Thomas Okken Wrote:  No crash logs for Android so far, but 7 for iOS, 5 of which are in the code that draws the axis tick marks for PLOT, and the other two appear to be app initialization failures. I'll focus on the PLOT thing first, it's probably a failure to detect invalid plot boundaries...
I was having issues with graphs not rendering or crashing, appreciate the quick fix!
Find all posts by this user
Quote this message in a reply
05-10-2022, 02:18 PM
Post: #639
RE: Plus42 Equations, Preview Release
(05-10-2022 01:49 PM)level7 Wrote:  I was having issues with graphs not rendering or crashing, appreciate the quick fix!

No problem!

Note that the fix will only prevent PLOT from getting stuck in an infinite loop when the plot limits are out of whack; it doesn't do anything to prevent those limits from getting out of whack in the first place. So you may still end up getting screwy plots, i.e. axes missing or nothing getting drawn at all. If you could send me your state file when that happens, it may help me find the root cause of the issue.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-11-2022, 05:22 PM
Post: #640
RE: Plus42 Equations, Preview Release
I can make PLOT to go into an infinite loop if I create an equation like:

Y=X^2+5*X+6

and set the XAXIS to Y and the YAXIS to X.

It seems like PLOT doesn't handle multiple solutions well.

Perhaps if there are multiple solutions in one orientation, it should flip the axes and try solving again.

If it works, then rotate the results to get the desired plot.
Find all posts by this user
Quote this message in a reply
Post Reply 




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