Post Reply 
Better way to organize function and programs?
06-13-2014, 12:29 AM (This post was last modified: 06-13-2014 12:30 AM by Rich.)
Post: #1
Better way to organize function and programs?
Hi, I was wondering if there is a way to organize programs or functions other than viewing a long list of functions? [Shift] [Programs]

As a student, I am taking a lot of different courses and I find it difficult to organize to all of my programs and functions. I think this was brought up before, but having some sort of folder system, at least visually, to organize them would help myself and other students with this issue. It would be great, since i could separate each set of functions by class or topic.

I name my functions and programs around 3 characters long to reduce my typing time during an exam. Without any description element in the initial view and the long list of programs i have, it's becomes more difficult to quickly narrow down what function i need, if i am not using that particular program over a length of time.

I do like that i can use my functions anywhere in any program and the file structure, but I would like to visually categorize or "tag" my functions.

Thanks,
Find all posts by this user
Quote this message in a reply
06-13-2014, 05:14 AM
Post: #2
RE: Better way to organize function and programs?
Hello,

Sorry, not at this point.

The original thinking was that you would organize all related functions in a single program, thus you would have one program per class (for example) and that this would be manageable...

But this might not be appropriate in your case.

cyrille
Find all posts by this user
Quote this message in a reply
06-13-2014, 10:55 AM
Post: #3
RE: Better way to organize function and programs?
(06-13-2014 05:14 AM)cyrille de brébisson Wrote:  Hello,

Sorry, not at this point.

The original thinking was that you would organize all related functions in a single program, thus you would have one program per class (for example) and that this would be manageable...

But this might not be appropriate in your case.

cyrille

Thanks. I'd like to see how this is easily done on the Prime. I don't see examples of this thinking in the UG or on line help.
Find all posts by this user
Quote this message in a reply
06-13-2014, 11:12 AM (This post was last modified: 06-13-2014 11:19 AM by Angus.)
Post: #4
RE: Better way to organize function and programs?
I can follow cyrille's explanation. However there seem to be some drawbacks.
You need an empty program with the class' name to create a pseudo-directory in the Toolbox/User menu. That shows that you must have had the desire for some kind of 'directory' i.e. a grouping for one class in mind....
I can follow the description, but given that you need a program with the class-name to arrange other programs in that source file shows to me that this is half thought at the best. The original thinking had no pracical use in mind.

And again. Some well written tutorials and hand ons would do no harm at all to all users. Students and professionals....


edit: I hope it is understandable what I mean with creating a program for adding some directory like structure in the toolbox. Hard to explain.
Find all posts by this user
Quote this message in a reply
06-13-2014, 11:34 AM
Post: #5
RE: Better way to organize function and programs?
(06-13-2014 05:14 AM)cyrille de brébisson Wrote:  The original thinking was that you would organize all related functions in a single program, thus you would have one program per class (for example)

I will try to be more creative. Sometimes I have a lot little specific functions that are just starting to accumulate, such a bi-linear interpolation, or building types of arrays (Routh hurwitz), etc...

Thank you
Find all posts by this user
Quote this message in a reply
06-13-2014, 04:32 PM (This post was last modified: 06-13-2014 05:06 PM by CR Haeger.)
Post: #6
RE: Better way to organize function and programs?
I hope we can get some help here. Its suggested that we can organize related functions in an HP Prime program. I and I suspect many others don't have a clue how to do this but would like to create, save and use our favorite equations/functions.

Unfortunately, after searching the original UG (pg 273?), ver 6030 UG and the internet, I can not find out how to do this.

Furthermore, when I do go to create a new program, I am presented now with an option to create a CAS function as shown. What do I do with this - again cant find anything in UG on this?

   

I am not a skilled programmer, but am willing to learn enough to do this properly. Otherwise, I'm stuck with other workarounds I have been using (saving functions/equations in Notes or custom Spreadsheet App that creates CAS variables once launched...)
Find all posts by this user
Quote this message in a reply
06-13-2014, 05:28 PM (This post was last modified: 06-13-2014 05:30 PM by Rich.)
Post: #7
RE: Better way to organize function and programs?
I am definitely not a programmer, but after reading Cyrille's post i came up with this method. I am not sure if this is the what the designers intended for students, but as a work around for me, it'll do. I still hope there is a better way.

1) Create a program titled after the subject. See screen 1 attachment.
   
2) Edit and enter a list of functions/equations within the program. See screen 2 attachment.
   
3) Load the program in the CAS screen. Which then loads the functions in the program list. See screen 3 and 4 attachments. (equations abc and def)
       
4) You are able to manipulate the functions like any CAS item now (at least from what I can see). See screen 5 attachment
   
5) When you are done delete the functions from the program list, so you only view the original edited program title, (ENGR123).
Find all posts by this user
Quote this message in a reply
06-13-2014, 06:21 PM
Post: #8
RE: Better way to organize function and programs?
Rich, thanks for your time to explain this. I'll try it and see if it's any better than what I've been using.
Find all posts by this user
Quote this message in a reply
06-14-2014, 01:32 PM
Post: #9
RE: Better way to organize function and programs?
I thought about home programs when cyrille talked about the grouping.

But well, could you explain your program? I seem to have problems with cas syntax. What are the (h,h) parameters for in the program? They are not used somewhere and the functions inside the program have variable number of parameters?

Thank you
Find all posts by this user
Quote this message in a reply
06-14-2014, 02:47 PM (This post was last modified: 06-14-2014 03:16 PM by Rich.)
Post: #10
RE: Better way to organize function and programs?
(06-14-2014 01:32 PM)Angus Wrote:  What are the (h,h) parameters for in the program? They are not used somewhere and the functions inside the program have variable number of parameters?

Hi, to be honest, I know very little about programming. The (h,h) are used as a place holder so i can load the functions internally from the ENGR123() program into the CAS program list temporally while working with that course subject. They do not load into another function as an argument. This is probably a horrible way to do this, but its all i have for now...

The benefit of this to me is, I do not have to retype the whole equation (or copy from Notes), I only see 4-5 course topics instead of 40-100 functions (assuming 10-20 equations per course), and its loaded into the system's function list to manipulate, saving me time on my exam. Also, i can write a small description about it in the original program entry.

Within the program ENGR123() I have two functions called abc(x,y) and def(t,u,v). Each function represents an equation i need for my class/course.

One equation is abc(x,y):= x + y, in this equation the abc(x,y) are mapped to the the x + y. So typing in abc(1,2) in CAS should give you 3 for the command output. Typing in abc(fff,ddd) will give you fff + ddd for the command output.

Pairing this with any other CAS function now works well. You can type sin(abc((45,45)) and get the result of sin(90), then using the approximation shortcut [shift][enter] you should get the result of 1. I often use this with the solve command, as shown in the example. Typing in solve(sin(abc(x,45))=1,x) should result in 45. (In degree mode)

When I'm done with my exam or homework I delete all of the functions from the program list, with the exception of ENGR123

I hope that it explains it well.
Find all posts by this user
Quote this message in a reply
06-14-2014, 03:24 PM
Post: #11
RE: Better way to organize function and programs?
Thank you I appreciate your help.
I still don't quite understand how the place holding works and what is happening, but that will change soon, I hope.
Did you find the corresponding section in the manual? I searched for cas program and did not succeed.
Find all posts by this user
Quote this message in a reply
06-14-2014, 05:16 PM (This post was last modified: 06-14-2014 05:52 PM by Rich.)
Post: #12
RE: Better way to organize function and programs?
Hi, no i didn't find an exact representation in the manual, but I use MuPad a similar CAS a lot, and I have read some of B. Parisse's CAS manual. The Hp Prime CAS is based off of B. Parisse's XCAS, so a lot of the concepts transfer over successfully.

http://www.hpmuseum.org/forum/thread-818.html Item 13 has a lot of good information.

Again, i just want to point out that I am sure this isn't the best way to do this, but I really haven't spent the time to learn the HP programming language. In comparison to other similarly priced calculators, I really thought that some type of equation or document handler would come as an added feature.
Find all posts by this user
Quote this message in a reply
06-14-2014, 07:44 PM (This post was last modified: 06-14-2014 07:52 PM by CR Haeger.)
Post: #13
RE: Better way to organize function and programs?
Rich - thanks again for your programming methods. Im still working on them.

For info, here is what I have tried using a saved spreadsheet (PHY123):

   

I create a CAS expression in each of the yellow cells that will create/store a CAS variable in PHY123.01, 02, 03 and 04. Note that when entering, you need to have the CAS* softkey selected. Note also that since uppercase F, N are preassigned (grrr), I use F_ and N_ as the variables.

   

In the blue cells, I created a CAS expression that stores the new PHY123_01 into Solve.E1. This will let me use it for single or multiple numerical solving later**. Note, instead of Solve.E1, you could save it to a different (saved) solve app.E1 .

   

In CAS, the CAS equations are available for use.

In the PHY123 spreadsheet, you can save other objects into these CAS variables. You could also save values into User variables (CAS softkey off when editing) here. Finally, the spreadsheet itself seems to support almost all Home or CAS commands, so you could do some analysis right from there.

If you later delete the PHY123.01-04 variables and want to recreate them, open the PHY123 spreadsheet and edit at least one cell somewhere - this will recalc or execute the other cells.

**Current firmware gives an error in Symb view of Solver app. Ignore it and allow it to create user variables for you. Delete them after using Solver or they may screw up your nice CAS variables (equations)...
Find all posts by this user
Quote this message in a reply
06-14-2014, 08:41 PM
Post: #14
RE: Better way to organize function and programs?
Rich - thanks again as the programming method may be another good workaround. I added a couple of lines to your program which seem to allow CAS equations, expressions to be stored.

   

The only issue I could find is that the (CAS) programs don't show up on the conn kit so I dont know how easy to edit/send from there or emulator.
Find all posts by this user
Quote this message in a reply
06-14-2014, 10:26 PM
Post: #15
RE: Better way to organize function and programs?
Hi, the spreadsheet method looks like it could work for me, too. At first i stayed away from the spreadsheet because of the crashes it was giving me prior to firmware update but I'll give it another go.

As a side note, I am not sure (or at least I haven't figured out) how to edit CAS programs in the connectivity connect. You can see and start non CAS checked programs in the connectivity kit but not CAS programs under the Programs drop down.
Find all posts by this user
Quote this message in a reply
06-15-2014, 07:46 AM (This post was last modified: 06-15-2014 11:30 AM by Angus.)
Post: #16
RE: Better way to organize function and programs?
First my apologies for my stupidity. But I still did not understand the frame of the cas program. Maybe someone could elaborate what is actualy happening? I'm coming to the question later.

First I have had some improvement for usability in mind when reading what you two guys are doing during class. What I don't like is browsing the mem/variable view to purge unneeded expressions. And that is what you have to do.
call myclass(h,h) for preparation of the cas. That means storing often used expressions and functions into their variables. After class is over you browse for these variables and purge them.
So from my engineering perspective I would prefer

myclass(1) // 1 considered true, variables are created
myclass(0) // false, the cas program tries to purge the variables by itself



About my cas program confusion:

What seems obvious is that by calling myclass(h,h) the variable assignments inside the program are processed in a sequential order just like you would type them in in cas.
Functional notation aswell as pure expressions. (you soon might get to the point where assign and unassign become important)
That results in a program frame like

(h,h)->BEGIN
//Sequential commands totally independant of h's
END;

I spent some time on google tonight but did not find anything that would have enligtened me....
Look at the myclass(true|false) idea. that would require some IF statement in the program to check for input value. It seems no h is ever checked/used.
So help is really appreciated. Maybe parisse could clear things up?

Thanks
Find all posts by this user
Quote this message in a reply
06-15-2014, 01:52 PM
Post: #17
RE: Better way to organize function and programs?
I probably shouldn't keep this thread going because my intentions were a quick fix and not to confuse to anyone. If you are having trouble then maybe another method is better for you until someone develops an actual program with an input, variable storage, and correct purge system.

An example to have a CAS program to purge all your equations can be seen in this attachment.
       

Just list all your variables that you want to purged in the {} as shown... run that to delete everything.
Find all posts by this user
Quote this message in a reply
06-15-2014, 04:27 PM (This post was last modified: 06-15-2014 04:31 PM by Angus.)
Post: #18
RE: Better way to organize function and programs?
I think we might close the thread, too. It seems it is not getting clear to the people what exactly my question is.
Rather getting an understanding on the funcionality of the cas programs than having a reciepe to achieve something.
Well, thanks to you your effords, you were helpful somehow.
Find all posts by this user
Quote this message in a reply
06-16-2014, 05:56 AM
Post: #19
RE: Better way to organize function and programs?
Hello,

The original idea was that you would create a program called, for example, My_Special_Math_Functions.

In this program, you would create multiple (lots) of functions such as:
EXPORT SIN2(a) begin return 2*SIN(A); end;
EXPORT COS2(a) begin return 2*cos(a); end;

etc, etc, etc...

The EXPORT keyword being there to tell the system which of your funcitons you want to expose to the outside world (and, by default, which you do not)...

so, you could have 1 program per subject, each program containing all the functions important for this subject...

This works well for a large list of small functions.
This works well for a small number of large program (with only 1 function per program, such as a Game)...
Where it breaks down is when you have lots of medium size programs, each with only 1 function in the program.

cyrille
Find all posts by this user
Quote this message in a reply
Post Reply 




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