Post Reply 
28S graphing multiple equations?
11-15-2022, 06:32 PM
Post: #1
28S graphing multiple equations?
Hi Folks,
Can I graph multiple equations simultaneously on the hp 28S? On my 50G and 48gx, I can put a list of equations into the equation register and it will plot them all on the same screen. This doesn't seem to work on my 28S...does it not have that functionality, or is it implemented in a different fashion?
Thanks, and best regards, Hal
Find all posts by this user
Quote this message in a reply
11-20-2022, 05:49 AM (This post was last modified: 11-21-2022 05:58 PM by C.Ret.)
Post: #2
RE: 28S graphing multiple equations?
Hello Hal,

On the HP-28S, there are many ways to combine the trace of several functions in one screen.
It all depends on the number of expressions to trace.

Basic method:

In the case where there are only two functions to trace, one may use the trick given in the operating manual by using an equation:

'SIN(X)=COS(X)' [ ] (PLOT) [STEQ] [DRAW] will plot the sine and cosine curves simultaneously.

Programmable method:

The DRAW instruction can be used in a program, but contrary to the soft-menu touches, it does not erase the screen of the HP-28S. This allows the display of multiple functions to be combined at will.
To erase the screen, we will use the instruction CLLCD.
Ending the program with the instruction DGTIZ will leave the graphic cursor active to traverse the screen as done by the [DRAW] soft-menu's touch.

Thus, the following code takes a function as an argument and trace it, then it traces the corresponding derivative. Note the use of 2 RES to space the points of the second curve and thus distinguish it from the first.

« STEQ CLLCD 1 RES DRAW RCEQ 'X' SHOW 'X' δ STEQ 2 RES DRAW DGTIZ » 'DDRW' STO

Thus, 'SIN(X)' DDRW will successively trace the curve of the sine and, in demi-points, its derivative. The display will then ressemble the one obtained with the previous method but will be slower to trace.

Method using a liste:

Inspired by the previous method, it is possible to compose a general code that allows you to trace all the functions of the same variable from a list.
For example:
« CLLCD
1 DO GETI OVER RES STEQ DRAW UNTIL DUP 1 SAME END DROP2
DGTIZ » 'LDRW' STO


The DUP RES sequence is optional, but be carefull several traces on the small HP-28S's screen are difficult to distinguish!!

Usage { 'SIN(X)' 'COS(X)' } LDRW .

Graphical method:

To save time, or use different independent variables, a more elaborate code can be developed that memorizes in the list the name of the tracking variable to be used.
Depending on the problem to be solved, it is possible to save time when tracing the function on the same graphic screen using the instructions LCD→ and →LCD and memorizing the graphic screen after tracing. The OR instruction will combine the trace of a new function with the previous traces.


Conclusion

I hope that these methods will help solve the problem in question with great efficiency.
As often with the HP-28S there are several ways to do any task. Any ones can adapt their codes to their preferred ways of solving it.


EDIT: Corrected Code. See the following posts.
Find all posts by this user
Quote this message in a reply
11-20-2022, 06:20 PM (This post was last modified: 11-20-2022 06:26 PM by Giuseppe Donnini.)
Post: #3
RE: 28S graphing multiple equations?
Now, that's the way helpful information should be presented in this forum: complete, thorough, clearly structured, and well written. Thank you very much.

I just want to observe that the GETI command, as applied to a list, places the extracted object at stack level 1, leaving the (incremented) index in stack level 2. Here is the complete stack diagram of GETI for lists:

{list} index --> {list} index+1 object(i)

So in order for your example to work properly, you have to replace the first DUP in LDRW with OVER.

( Readers should also be aware that the calculator has to be in radians mode in order to draw appropriately scaled graphs for the given examples. This should be obvious to anyone interested, but one never knows… )
Find all posts by this user
Quote this message in a reply
11-21-2022, 05:48 PM (This post was last modified: 11-21-2022 05:48 PM by C.Ret.)
Post: #4
RE: 28S graphing multiple equations?
(11-20-2022 06:20 PM)Giuseppe Donnini Wrote:  So in order for your example to work properly, you have to replace the first DUP in LDRW with OVER.

Hi Giuseppe,

Thank you very much for your careful reading of my post and the relevant details given.
Indeed, there an error in this code; I typed it too quickly and incorrectly placed the GETI instruction.

One can effectively correct my error with the help of the OVER instruction, or put the GETI instruction back in good order.

Here's what my code should have look like:

« CLLCD
1 DO DUP RES GETI STEQ DRAW UNTIL DUP 1 SAME END DROP2
DGTIZ » 'LDRW' STO



Sorry for that.
Find all posts by this user
Quote this message in a reply
Post Reply 




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