HP Prime: how to insert and save formulas in a sort of "Equation library"
02-10-2020, 07:49 AM (This post was last modified: 02-18-2020 12:07 PM by Gene.)
Post: #1
 marprime80 Junior Member Posts: 3 Joined: Feb 2020
HP Prime: how to insert and save formulas in a sort of "Equation library"
Good morning,

I've recently bought an HP Prime.

I'm trying to insert and save some executable formulas in a sort of "equation library" where formulas are subdivided in categories: accounting formulas,economics formula ans so on...

I've seen that in the d HP50g it was possible to organize and save formulas...

However I've some difficulties with my HP Prime.

Can somebody help me in solving my problem please? I need it urgently...

Thank you very much for your supply.

Mark
02-10-2020, 01:32 PM
Post: #2
 Thomas_Sch Senior Member Posts: 310 Joined: Dec 2013
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"
Here is a great subforums for solutions, you find it at https://www.hpmuseum.org/forum/forum-15....order=desc

For e.g. please have a look at
and

Maybe there a more solutions at hpcalc.org

calculators: Prime G1/G2, HP48, 49, 42S, 50, WP34s, DM42
02-10-2020, 05:37 PM
Post: #3
 marprime80 Junior Member Posts: 3 Joined: Feb 2020
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"
I'll have a look at the links..
Today to test solver, i tried to insert some formula in solver with long name variables,like Gains=Revenues-Costs.
However Solver app pops up a "synthax error" when wrinting the tree "economic" variables..and surprisingly Solver decomposes Gains in G*a*i*n*s and so on...creating a variable for each letter...instead of creating just 3"economic variables...
With old hp 17bll Solver automatically recognized the variables as long names instead of creating many letters
How can I solve this problem in HP Prime?
I hope it is only an entry mode error...

Thank you very much for your kind support..

Best regards,

Mark
02-11-2020, 08:01 AM (This post was last modified: 02-11-2020 08:09 AM by pinkman.)
Post: #4
 pinkman Member Posts: 114 Joined: Mar 2018
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"
(02-10-2020 05:37 PM)marprime80 Wrote:  Dear Thomas thank you very much for your reply.
I'll have a look at the links..
Today to test solver, i tried to insert some formula in solver with long name variables,like Gains=Revenues-Costs.
However Solver app pops up a "synthax error" when wrinting the tree "economic" variables..and surprisingly Solver decomposes Gains in G*a*i*n*s and so on...creating a variable for each letter...instead of creating just 3"economic variables...
With old hp 17bll Solver automatically recognized the variables as long names instead of creating many letters
How can I solve this problem in HP Prime?
I hope it is only an entry mode error...

Thank you very much for your kind support..

Best regards,

Mark

Hello Mark,
No the Solver won't create vars on the fly, and math some math students might be helped by the translation of AB into A*B.

Two workarounds:

First (my prefered one): create a program, name it "AllMyVars" or whatever you want, and insert all the vars you need, ie:
Code:
 EXPORT Gain, Revenues, Cost; EXPORT GrossMargin, EBITDA; // etc.

Second:
In Home view, create directly a var, by using the 'Sto' soft or hard key. This is usually done after a calculus.
Code:
 Ans▶MyResult

You can then use all those created vars in the Solver. You can find them with the 'Vars' key, under the 'User' softkey menu.
02-11-2020, 08:22 AM
Post: #5
 CyberAngel Member Posts: 231 Joined: Jul 2018
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"
(02-11-2020 08:01 AM)pinkman Wrote:  X
Hello Mark,
No the Solver won't create vars on the fly, and math some math students might be helped by the translation of AB into A*B.

Two workarounds:

First (my prefered one): create a program, name it "AllMyVars" or whatever you want, and insert all the vars you need, ie:
Code:
 EXPORT Gain, Revenues, Cost; EXPORT GrossMargin, EBITDA; // etc.
X
You can then use all those created vars in the Solver. You can find them with the 'Vars' key, under the 'User' softkey menu.

OR - combining another post
refer them using AllMyVars.Gain, AllMyVars.Revenues, AllMyVars.Cost
I would rather save my own Solver app version
and use, say, 'Finance' main app to declare the variables
(among other things)
One can also use START() and RESET() in your own version of an app
I avoid polluting the name space
- -
VPN
02-11-2020, 10:45 AM
Post: #6
 marprime80 Junior Member Posts: 3 Joined: Feb 2020
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"
It is not really a trivial process as it was with the old one..
I would like to be able to program the calculator,but I'm more and more convinced that HP Prime is not an easy calculator for beginners..some programming knowledge are required even for some basic solver calculation..sometimes it is quite frustrating..
Is there any specific course on how to program the calculator or some teaching lessons?
I'm a beginner and I need some direct help..
Let me know...
Thank you very much

Marco Russo
02-11-2020, 09:05 PM (This post was last modified: 02-11-2020 09:09 PM by pinkman.)
Post: #7
 pinkman Member Posts: 114 Joined: Mar 2018
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"
Yes, despite the (receivable) arguments often debated here, HP Prime is a high level tool, but it is not a too high mountain to be climbed.

First, stay tuned here!

Then don’t be afraid by the programming module. You just need to write the names of a few vars in a text file from a module called ‘program’, you’re not yet into programming, so it will be easy.

Before programming, use the tools offered by the Prime, they are really powerful.

Then :
My advice for your library of functions is to create another program file, just to make your functions usable anywhere.

Code:
 EXPORT FGains(theRevenues,theCosts) BEGIN RETURN theRevenues-theCosts; END;

That’s a bit of programming, but I think you will recognize your original function.
I intentionally used other variable names to avoid confusion between these ones and the previous ones.

Then you can use the solver:
Code:
 Gains=FGains(Revenues, Costs)

And here you are!

02-11-2020, 10:15 PM (This post was last modified: 02-11-2020 10:16 PM by BruceH.)
Post: #8
 BruceH Member Posts: 257 Joined: Dec 2013
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"
There's a very good equation library for the Prime here.

You might like to look at the source to pick-up some tips or modify it to add any missing equations that you use.
02-13-2020, 07:40 AM
Post: #9
 Dirk.nl Member Posts: 165 Joined: Apr 2015
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"
Sorry for my late response and sorry if this had been explained before.
I do this in the following way.
Open Apps Window, select Solve App and save it with a new name based on Solve.
In the App window select the new Solve App. The focus of the Prime is now focused on this new Solve App.
Go to Program Editor (Shift Program) and select your "new name (APP)" and type EXPORT VarName, VarName, ...; Possibly several EXPORTs. Close the Progam editor. You can now use your variables in your new Solve App. They are visible and selectable in Vars, App, "new name", Program.
In this way you can possibly use the same variable names for different Apps, while they are not the same variables.

— Dirk Hartland
02-17-2020, 02:09 PM
Post: #10
 BERNARD MICHAUD Member Posts: 113 Joined: Aug 2015
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"

BM
02-18-2020, 06:03 AM
Post: #11
 cyrille de brébisson Senior Member Posts: 936 Joined: Dec 2013
RE: Hp Prime: how to insert and save formulas in a sort of "Equation library"
Hello,

You can also create AVars (App Variables), which are not program variables...
a first call to
AVars("name"):=value
Will create the app variable. From there on, you can use it as a regular variable.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
02-18-2020, 04:33 PM (This post was last modified: 02-23-2020 09:34 PM by BERNARD MICHAUD.)
Post: #12
 BERNARD MICHAUD Member Posts: 113 Joined: Aug 2015
RE: HP Prime: how to insert and save formulas in a sort of "Equation library"
HI Cyrille
Since we are on this topic of vars and its use in programs, could I impose upon you with this question or perhaps experience I had with the use of polar_coordinates(); When used from the command line polar_coordinates(3+4*i) produces [5 53.13],
but when used from inside a program it produces [5,0.9273]. Of course, 53.13*pi/180 is 53.13. So due to this phenomenon, I undertook to use ABS() and ARG() to generate the proper result 5 < 53.13 in my EE_Analyses program which I will publish soon. Do you have any idea as to why that is ??

Thank you
Bernard Michaud
02-18-2020, 09:26 PM
Post: #13
 pinkman Member Posts: 114 Joined: Mar 2018
RE: HP Prime: how to insert and save formulas in a sort of "Equation library"
(02-18-2020 06:03 AM)cyrille de brébisson Wrote:  Hello,

You can also create AVars (App Variables), which are not program variables...
a first call to
AVars("name"):=value
Will create the app variable. From there on, you can use it as a regular variable.

Cyrille

So I discover this functionality. Thanks, looks interesting.
A few questions:
- Why are AVars and DelAVars not mentioned in the catalog menu?
- Once an AVar is created, such as AVars(“vtest”):=123.456, what’s the difference between vtest:=654.321 and AVars(“vtest”):=654.321 ?
02-19-2020, 08:28 AM
Post: #14
 Tim Wessman Senior Member Posts: 2,209 Joined: Dec 2013
RE: HP Prime: how to insert and save formulas in a sort of "Equation library"
(02-18-2020 09:26 PM)pinkman Wrote:  So I discover this functionality. Thanks, looks interesting.
A few questions:
- Why are AVars and DelAVars not mentioned in the catalog menu?
- Once an AVar is created, such as AVars(“vtest”):=123.456, what’s the difference between vtest:=654.321 and AVars(“vtest”):=654.321 ?

They are. They appear under the app var function menu as they are app specific. If you press the CATLG button however, do you see how it has a > on the side and a multi app icon? You will see a copy of each app there to pick a specific one.

Nothing essentially. The first will be slightly faster however.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
 « Next Oldest | Next Newest »

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